]> git.proxmox.com Git - pve-qemu.git/log
pve-qemu.git
5 months agobump version to 8.1.2-5
Thomas Lamprecht [Mon, 11 Dec 2023 15:59:16 +0000 (16:59 +0100)]
bump version to 8.1.2-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agopick fix for potential deadlock with QMP resize and iothread
Fiona Ebner [Mon, 11 Dec 2023 13:28:39 +0000 (14:28 +0100)]
pick fix for potential deadlock with QMP resize and iothread

While the patch gives bdrv_graph_wrlock() as an example where the
issue can manifest, something similar can happen even when that is
disabled. Was able to reproduce the issue with
while true; do qm resize 115 scsi0 +4M; sleep 1; done
while running
fio --name=make-mirror-work --size=100M --direct=1 --rw=randwrite \
 --bs=4k --ioengine=psync --numjobs=5 --runtime=1200 --time_based
in the VM.

Fix picked up from:
https://lists.nongnu.org/archive/html/qemu-devel/2023-12/msg01102.html

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
5 months agoadd patch to work around stuck guest IO with iothread and VirtIO block/SCSI
Fiona Ebner [Mon, 11 Dec 2023 13:28:38 +0000 (14:28 +0100)]
add patch to work around stuck guest IO with iothread and VirtIO block/SCSI

When using iothread, after commits
1665d9326f ("virtio-blk: implement BlockDevOps->drained_begin()")
766aa2de0f ("virtio-scsi: implement BlockDevOps->drained_begin()")
it can happen that polling gets stuck when draining. This would cause
IO in the guest to get completely stuck.

A workaround for users is stopping and resuming the vCPUs because that
would also stop and resume the dataplanes which would kick the host
notifiers.

This can happen with block jobs like backup and drive mirror as well
as with hotplug [2].

Reports in the community forum that might be about this issue[0][1]
and there is also one in the enterprise support channel.

As a workaround in the code, just re-enable notifications and kick the
virt queue after draining. Draining is already costly and rare, so no
need to worry about a performance penalty here. This was taken from
the following comment of a QEMU developer [3] (in my debugging,
I had already found re-enabling notification to work around the issue,
but also kicking the queue is more complete).

[0]: https://forum.proxmox.com/threads/137286/
[1]: https://forum.proxmox.com/threads/137536/
[2]: https://issues.redhat.com/browse/RHEL-3934
[3]: https://issues.redhat.com/browse/RHEL-3934?focusedId=23562096&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-23562096

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
5 months agobump version to 8.1.2-4
Thomas Lamprecht [Wed, 22 Nov 2023 13:28:25 +0000 (14:28 +0100)]
bump version to 8.1.2-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoadd fix for vnc clipboard
Fiona Ebner [Wed, 22 Nov 2023 12:41:14 +0000 (13:41 +0100)]
add fix for vnc clipboard

This fixes the host->guest direction with noNVC as a client (and
likely others).

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
6 months agobump version to 8.1.2-3
Thomas Lamprecht [Mon, 20 Nov 2023 09:35:10 +0000 (10:35 +0100)]
bump version to 8.1.2-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agofix #5054: backport fix for software reset with SATA
Fiona Ebner [Mon, 20 Nov 2023 09:16:17 +0000 (10:16 +0100)]
fix #5054: backport fix for software reset with SATA

The issue prevented FreeBSD 14 VMs with SATA disk from booting.

The commit it fixes e2a5d9b3d9c3 ("hw/ide/ahci: simplify and document
PxCI handling") is part of stable 8.1.2.

The patch was already applied to the block branch upstream:
https://lists.nongnu.org/archive/html/qemu-devel/2023-11/msg02711.html

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
6 months agobump version to 8.1.2-2
Thomas Lamprecht [Fri, 17 Nov 2023 10:55:26 +0000 (11:55 +0100)]
bump version to 8.1.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agorevert commit breaking VirtIO network adapters for certain versions of Windows
Fiona Ebner [Fri, 17 Nov 2023 10:45:41 +0000 (11:45 +0100)]
revert commit breaking VirtIO network adapters for certain versions of Windows

As reported in the community forum [0] and reproduced locally this
breaks VirtIO network adapters in (at least) the German ISO of Windows
Server 2022. The fix itself was for

> Issue is not fatal but as result acpi-index/"PCI Label ID" property
> is either not shown in device details page or shows incorrect value.

so revert and tolerate that as a stop-gap, rather than have the
devices not working at all.

[0]: https://forum.proxmox.com/threads/92094/post-605684

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
6 months agofix #4710: vma create: don't use O_DIRECT for tmpfs
Fiona Ebner [Tue, 7 Nov 2023 14:28:24 +0000 (15:28 +0100)]
fix #4710: vma create: don't use O_DIRECT for tmpfs

The implementation of the helper is_path_tmpfs() is similar to the
existing qemu_fd_getfs() function in util/mmap-alloc.c, which
unfortunately only takes an existing fd.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
6 months agobump version to 8.1.2-1
Thomas Lamprecht [Tue, 24 Oct 2023 11:43:10 +0000 (13:43 +0200)]
bump version to 8.1.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agod/control: add python3-venv as build-dependency
Thomas Lamprecht [Tue, 24 Oct 2023 12:59:49 +0000 (14:59 +0200)]
d/control: add python3-venv as build-dependency

Seems to be required since commit 81e2b198a8 ("configure: create a
python venv unconditionally").

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agod/control: add versioned Breaks for qemu-server <= 8.0.6
Fiona Ebner [Tue, 17 Oct 2023 12:10:12 +0000 (14:10 +0200)]
d/control: add versioned Breaks for qemu-server <= 8.0.6

Upstream QEMU commit 4271f40383 ("virtio-net: correctly report maximum
tx_queue_size value") made setting an invalid tx_queue_size for a
non-vDPA/vhost-user net device a hard error. Now, qemu-server before
commit 089aed81 ("cfg2cmd: netdev: fix value for tx_queue_size") did
just that, so the newer QEMU version would break start-up for most VMs
(a default vNIC configuration would be affected).

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoadd patch to avoid huge snapshot performance regression
Fiona Ebner [Tue, 17 Oct 2023 12:10:11 +0000 (14:10 +0200)]
add patch to avoid huge snapshot performance regression

Taking a snapshot became prohibitively slow because of the
migration_transferred_bytes() call in migration_rate_exceeded() [0].

This also applied to the async snapshot taking in Proxmox VE, so
work around the issue until it is fixed upstream.

[0]: https://gitlab.com/qemu-project/qemu/-/issues/1821

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoadd patch to disable graph locking
Fiona Ebner [Tue, 17 Oct 2023 12:10:10 +0000 (14:10 +0200)]
add patch to disable graph locking

There are still some issues with graph locking, e.g. deadlocks during
backup canceling [0] and initial attempts to fix it didn't work [1].
Because the AioContext locks still exist, it should still be safe to
disable graph locking.

[0]: https://lists.nongnu.org/archive/html/qemu-devel/2023-09/msg00729.html
[1]: https://lists.nongnu.org/archive/html/qemu-devel/2023-09/msg06905.html

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoupdate submodule and patches to QEMU 8.1.2
Fiona Ebner [Tue, 17 Oct 2023 12:10:09 +0000 (14:10 +0200)]
update submodule and patches to QEMU 8.1.2

Bigger notable changes:

* Commit 1a30b0f5d7 ("block: .bdrv_open is non-coroutine and
  unlocked") broke the PVE backup patches, in particular setting up
  the backup dump block driver, because bdrv_new_open_driver() cannot
  be called from a coroutine. To fix it, bdrv_co_open() is used
  instead, and while it's a much more involved function, the result
  should be essentially the same. The only difference I noticed is
  that the BDRV_O_ALLOW_RDWR flag is also set in the resulting bds
  (block driver state), but that shouldn't hurt.

Smaller notable changes:

* aio_set_fd_handler() dropped its 'is_external' parameter stating
  that all callers now pass false in 60f782b6b7 ("aio: remove
  aio_disable_external() API"). The calls in the PVE patches also
  passed false, so just drop the parameter too.

* global_state_store() does not have a return value anymore, so the
  user in the PVE savevm-async patch was adapted. For context, see
  c33f1829f8 ("migration: never fail in global_state_store()").

* Renames affecting the PVE savevm-async patch:
  migrate_use_block() -> migrate_block() and ram_counters -> mig_stats
  9d4b1e5f22 ("migration: Move migrate_use_block() to options.c")
  aff3f6606d ("migration: Rename ram_counters to mig_stats")

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: use QEMU's keycodemapdb again
Fiona Ebner [Tue, 17 Oct 2023 12:10:08 +0000 (14:10 +0200)]
buildsys: use QEMU's keycodemapdb again

instead of the split-out version that was last updated for QEMU 6.0.
This reverts the relevant part of 6838f03 ("bump version to 2.11.1-1")
which doesn't state a reason why the splitting was done. If something
breaks, we can still re-do it and document the reason this time.

Alternatively, it would be necessary to adapt the paths, because
keycodemapdb lives in subprojects/ rather than ui/ since QEMU commit
c53648abba ("meson: use subproject for keycodemapdb").

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: fixup submodule target
Fiona Ebner [Tue, 17 Oct 2023 12:10:07 +0000 (14:10 +0200)]
buildsys: fixup submodule target

It's not enough to initialize the submodules anymore, as some got
replaced by wrap files, see QEMU commit 2019cabfee ("meson:
subprojects: replace submodules with wrap files").

Download the subprojects during initialization of the QEMU submodule,
so building (without the automagical --enable-download) can succeeed
afterwards.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agod/rules: use disable-download option instead of git-submodules=ignore
Fiona Ebner [Tue, 17 Oct 2023 12:10:06 +0000 (14:10 +0200)]
d/rules: use disable-download option instead of git-submodules=ignore

See the following QEMU commits for reference:
0c5f3dcbb2 ("configure: add --enable-pypi and --disable-pypi")
ac4ccac740 ("configure: rename --enable-pypi to --enable-download, control subprojects too")
6f3ae23b29 ("configure: remove --with-git-submodules=") removed

The last one removed the option and the closest thing to
git-submodule=ignore is using disable-download. Which will then just
verify that the submodules are present.

Building now will require running either
* Running 'meson subprojects download' in the qemu submodule first.
* Using --enable-download, but then the submodules would be downloaded
  for each build (if not already downloaded in the submodule first)
  and it's just a bit too surprising if downloads happen during build.

The disable-download option will also disable automatic downloading of
missing Python modules from PyPI. Hopefully, it's enough to add them
as Debian build dependencies when required.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agobump version to 8.0.2-7
Thomas Lamprecht [Wed, 4 Oct 2023 06:33:39 +0000 (08:33 +0200)]
bump version to 8.0.2-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 months agofix #2874: SATA: avoid unsolicited write to sector 0 during reset
Fiona Ebner [Thu, 24 Aug 2023 13:51:11 +0000 (15:51 +0200)]
fix #2874: SATA: avoid unsolicited write to sector 0 during reset

If there is a pending DMA operation during ide_bus_reset(), the fact
that the IDEstate is already reset before the operation is canceled
can be problematic. In particular, ide_dma_cb() might be called and
then use the reset IDEstate which contains the signature after the
reset. When used to construct the IO operation this leads to
ide_get_sector() returning 0 and nsector being 1. This is particularly
bad, because a write command will thus destroy the first sector which
often contains a partition table or similar.

Upstream discussion:
https://lists.nongnu.org/archive/html/qemu-devel/2023-08/msg04239.html

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
8 months agovma: avoid compiler warning about incompatible pointer type
Fiona Ebner [Fri, 8 Sep 2023 09:18:30 +0000 (11:18 +0200)]
vma: avoid compiler warning about incompatible pointer type

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
8 months agobackup: Fix spelling error in function name
Filip Schauer [Fri, 8 Sep 2023 08:49:07 +0000 (10:49 +0200)]
backup: Fix spelling error in function name

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
[FE: fixup patch context]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
8 months agobump version to 8.0.2-6
Thomas Lamprecht [Wed, 6 Sep 2023 15:04:04 +0000 (17:04 +0200)]
bump version to 8.0.2-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
8 months agobackup: drop broken BACKUP_FORMAT_DIR
Fiona Ebner [Wed, 6 Sep 2023 08:45:12 +0000 (10:45 +0200)]
backup: drop broken BACKUP_FORMAT_DIR

Since upstream QEMU 8.0, it's no longer possible to call
bdrv_img_create() from a coroutine anymore, meaning a backup with the
directory format would crash the QEMU instance.

The feature is only exposed via the monitor and was intended to be
experimental. There were no user reports about the breakage and it
only was noticed during the rebase for QEMU 8.1, because other parts
of the backup code needed adaptation and I decided to check the
BACKUP_FORMAT_DIR case too.

It should not stay in a broken state of course, but avoid the
maintenance cost and just make it a removed feature for Proxmox VE 8
retroactively.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
8 months agobackup: create jobs in a drained section
Fiona Ebner [Wed, 6 Sep 2023 08:45:11 +0000 (10:45 +0200)]
backup: create jobs in a drained section

With the drive-backup QMP command, upstream QEMU uses a drained
section for the source drive when creating the backup job. Do the same
here to avoid subtle bugs.

There, the drained section extends until after the job is started, but
this cannot be done here for multi-disk backups (could at most start
the first job). The important thing is that the cbw
(copy-before-write) node is in place and the bcs (block-copy-state)
bitmap is initialized, which both happen during job creation (ensured
by the "block/backup: move bcs bitmap initialization to job creation"
PVE patch).

One such bug is one reported in the community forum [0], where using a
drive with iothread can lead to an overlapping block-copy request and
consequently an assertion failure. The block-copy code relies on the
bcs bitmap to determine if a request for a certain range can be
created. Each time a request is created, it resets the bcs bitmap at
that range to indicate that it's being handled.

The duplicate request can happen as follows:
Thread A attaches the cbw node
Thread B creates a request and resets the bitmap at that range
Thread A clears the bitmap and merges it with the PBS bitmap
The merging can lead to the bitmap being set again at the range of
the previous request, so the block-copy code thinks it's fine to
create a request there.
Thread B creates another requests at an overlapping range before the
other request is finished.

The drained section ensures that nothing else can interfere with the
bcs bitmap between attaching the copy-before-write block node and
initialization of the bitmap.

[0]: https://forum.proxmox.com/threads/133149/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
8 months agoregenerate patch stats
Fiona Ebner [Wed, 6 Sep 2023 08:45:10 +0000 (10:45 +0200)]
regenerate patch stats

Apparently wasn't correct in 0cff91a ("fix #1534: vma: Add extract
filter for disk images").

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
8 months agofix #1534: vma: Add extract filter for disk images
Filip Schauer [Wed, 30 Aug 2023 08:33:47 +0000 (10:33 +0200)]
fix #1534: vma: Add extract filter for disk images

Add a filter to the "vma extract" command. A comma seperated list of
disk images that should be extracted can be passed with the "-d" option.

Example to extract an IDE drive and an SCSI drive from vzdump.vma:

vma extract vzdump.vma -d "drive-ide0,drive-scsi0" extractdir

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
9 months agobump version to 8.0.2-5
Fiona Ebner [Wed, 16 Aug 2023 09:56:49 +0000 (11:56 +0200)]
bump version to 8.0.2-5

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
9 months agobackup: trim heap after finishing
Fiona Ebner [Mon, 14 Aug 2023 08:53:19 +0000 (10:53 +0200)]
backup: trim heap after finishing

Reported in the community forum [0]. By default, there can be large
amounts of memory left assigned to the QEMU process after backup.
Likely because of fragmentation, it's necessary to explicitly call
malloc_trim() to tell glibc that it shouldn't keep all that memory
resident for the process.

QEMU itself already does a malloc_trim() in the RCU thread, but that
code path might not be reached (or not for a long time) under usual
operation. The value of 4 MiB for the argument was also copied from
there.

Example with the following configuration:
> agent: 1
> boot: order=scsi0
> cores: 4
> cpu: x86-64-v2-AES
> ide2: none,media=cdrom
> memory: 1024
> name: backup-mem
> net0: virtio=DA:58:18:26:59:9F,bridge=vmbr0,firewall=1
> numa: 0
> ostype: l26
> scsi0: rbd:base-107-disk-0/vm-106-disk-1,size=4302M
> scsihw: virtio-scsi-pci
> smbios1: uuid=b2d4511e-8d01-44f1-afd6-9581b30c24a6
> sockets: 2
> startup: order=2
> virtio0: lvmthin:vm-106-disk-1,iothread=1,size=1G
> virtio1: lvmthin:vm-106-disk-2,iothread=1,size=1G
> virtio2: lvmthin:vm-106-disk-3,iothread=1,size=1G
> vmgenid: 0a1d8751-5e02-449d-977e-c0160e900231

Before the change:

> root@pve8a1 ~ # grep VmRSS /proc/$(cat /var/run/qemu-server/106.pid)/status
> VmRSS:   370948 kB
> root@pve8a1 ~ # vzdump 106 --storage pbs
> (...)
> INFO: Backup job finished successfully
> root@pve8a1 ~ # grep VmRSS /proc/$(cat /var/run/qemu-server/106.pid)/status
> VmRSS:  2114964 kB

After the change:

> root@pve8a1 ~ # grep VmRSS /proc/$(cat /var/run/qemu-server/106.pid)/status
> VmRSS:   398788 kB
> root@pve8a1 ~ # vzdump 106 --storage pbs
> (...)
> INFO: Backup job finished successfully
> root@pve8a1 ~ # grep VmRSS /proc/$(cat /var/run/qemu-server/106.pid)/status
> VmRSS:   424356 kB

[0]: https://forum.proxmox.com/threads/131339/

Co-diagnosed-by: Friedrich Weber <f.weber@proxmox.com>
Co-diagnosed-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agorefresh patch context
Fiona Ebner [Mon, 14 Aug 2023 08:52:25 +0000 (10:52 +0200)]
refresh patch context

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
9 months agoAdd format attributes to function candidates
Filip Schauer [Mon, 7 Aug 2023 13:19:42 +0000 (15:19 +0200)]
Add format attributes to function candidates

Add format attributes to functions that take printf-like arguments. This
provides additional compile-time checking that the correct parameters
are passed to the functions.

This fixes compiler warnings generated by the -Wsuggest-attribute=format
flag.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
9 months agoadd patch fixing fd leak for vhost
Fiona Ebner [Thu, 3 Aug 2023 13:56:30 +0000 (15:56 +0200)]
add patch fixing fd leak for vhost

Each pause+resume operation (which is also done as part of taking a VM
snapshot) would increase the number of open file descriptors by the
number of vhost devices (e.g. network devices by default). This could
lead to crashes during backup and surely other issues once the system
limit (default 1024) was reached [0].

[0]: https://forum.proxmox.com/threads/131603/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
9 months agobump version to 8.0.2-4
Fabian Grünbichler [Fri, 28 Jul 2023 10:59:10 +0000 (12:59 +0200)]
bump version to 8.0.2-4

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
9 months agoadd patch fixing resume for snapshot and hibernate with drive with iothread and a...
Fiona Ebner [Fri, 28 Jul 2023 09:44:57 +0000 (11:44 +0200)]
add patch fixing resume for snapshot and hibernate with drive with iothread and a dirty bitmap

Not difficult to run into, just have a drive with iothread, take a PBS
backup and then take a snapshot or hibernate. Resuming will fail with
> qemu: qemu_mutex_unlock_impl: Operation not permitted
because of not acquiring the correct AioContext first.

Migration is not affected, because it runs in coroutine context.

Reported in the community forum:
https://forum.proxmox.com/threads/129899/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 months agobump version to 8.0.2-3
Thomas Lamprecht [Thu, 15 Jun 2023 11:59:12 +0000 (13:59 +0200)]
bump version to 8.0.2-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agofix checks for drive mirror with bitmap
Fiona Ebner [Thu, 15 Jun 2023 11:39:00 +0000 (13:39 +0200)]
fix checks for drive mirror with bitmap

The QAPI change for QEMU 8.0 dropped redundant has_foo parameters, but
in the blockdev_mirror_common() function (which is not part of the
QAPI itself but called from there) the argument pair was has_bitmap
and bitmap_name rather than has_bitmap and bitmap.

Reported-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 months agoregenerate patches
Fiona Ebner [Thu, 15 Jun 2023 11:38:59 +0000 (13:38 +0200)]
regenerate patches

There's still some context changes not covered by earlier series. No
functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 months agobump version to 8.0.2-2
Thomas Lamprecht [Fri, 9 Jun 2023 05:58:59 +0000 (07:58 +0200)]
bump version to 8.0.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agodrop deprecated custom drive snapshot QMP commands
Fiona Ebner [Wed, 24 May 2023 13:56:53 +0000 (15:56 +0200)]
drop deprecated custom drive snapshot QMP commands

They are not required anymore since qemu-server >= 5.0-36.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 months agodrop patch for custom get_link_status QMP command
Fiona Ebner [Wed, 24 May 2023 13:56:52 +0000 (15:56 +0200)]
drop patch for custom get_link_status QMP command

There doesn't seem to be any Proxmox VE code using this.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 months agobump version to 8.0.2-1
Thomas Lamprecht [Tue, 6 Jun 2023 14:35:20 +0000 (16:35 +0200)]
bump version to 8.0.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agoupdate reentrancy patches to version in upstream git
Fiona Ebner [Tue, 6 Jun 2023 08:58:50 +0000 (10:58 +0200)]
update reentrancy patches to version in upstream git

The previous version was picked from the mailing list and still had
an object_dynamic_cast call in a hot path, which is avoided with the
version that landed in git.

Also adds a few more exceptions for devices that need reentrancy.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 months agoupdate submodule and patches to QEMU 8.0.2
Fiona Ebner [Tue, 6 Jun 2023 08:58:49 +0000 (10:58 +0200)]
update submodule and patches to QEMU 8.0.2

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 months agobuildsys: remove edk2 source tree when assembling build-dir
Thomas Lamprecht [Wed, 24 May 2023 08:37:07 +0000 (10:37 +0200)]
buildsys: remove edk2 source tree when assembling build-dir

we ship it via pve-edk2-firmware anyway and it only results in bigger
source tar balls and lintian yelling at us due to edk2 not being the
simplest repo to ensure DFSG compat.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobump version to 8.0.0-1
Thomas Lamprecht [Mon, 22 May 2023 11:49:22 +0000 (13:49 +0200)]
bump version to 8.0.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
11 months agobuildsys: avoid handling noopt locally, rather extend CFLAGS
Thomas Lamprecht [Tue, 23 May 2023 12:09:03 +0000 (14:09 +0200)]
buildsys: avoid handling noopt locally, rather extend CFLAGS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/rules: add identation for configure switches for readability
Thomas Lamprecht [Mon, 22 May 2023 13:23:20 +0000 (15:23 +0200)]
d/rules: add identation for configure switches for readability

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/control: drop obsolete build dependencies
Thomas Lamprecht [Mon, 22 May 2023 13:09:36 +0000 (15:09 +0200)]
d/control: drop obsolete build dependencies

drop autotools-dev, texi2html and texinfo build dependencies, they
are not used and have no effect

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: auto-generate dbgsym package
Thomas Lamprecht [Mon, 22 May 2023 11:51:22 +0000 (13:51 +0200)]
buildsys: auto-generate dbgsym package

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agosquash related patches
Fiona Ebner [Mon, 15 May 2023 13:39:56 +0000 (15:39 +0200)]
squash related patches

where there is no good reason to keep them separate. It's a pain
during rebase if there are multiple patches changing the same code
over and over again. This was especially bad for the backup-related
patches. If the history of patches really is needed, it can be
extracted via git. Additionally, compilation with partial application
of patches was broken since a long time, because one of the master key
changes became part of an earlier patch during a past rebase.

If only the same files were changed by a subsequent patch and the
changes felt to belong together (obvious for later bug fixes, but also
done for features e.g. adding master key support for PBS), the patches
were squashed together.

The PBS namespace support patch was split into the individual parts
it changes, i.e. PBS block driver, pbs-restore binary and QMP backup
infrastructure, and squashed into the respective patches.

No code change is intended, git diff in the submodule should not show
any difference between applying all patches before this commit and
applying all patches after this commit.

The query-proxmox-support QMP function has been left as part of the
"PVE-Backup: Proxmox backup patches for QEMU" patch, because it's
currently only used there. If it ever is used elsewhere too, it can
be split out from there.

The recent alloc-track and BQL-related savevm-async changes have been
left separate for now, because it's not 100% clear they are the best
approach yet. This depends on what upstream decides about the BQL
stuff and whether and what kind of issues with the changes pop up.

The qemu-img dd snapshot patch has been re-ordered to after the other
qemu-img dd patches.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
12 months agoPVE backup: don't call no_co_wrapper function from coroutine
Fiona Ebner [Mon, 15 May 2023 13:39:55 +0000 (15:39 +0200)]
PVE backup: don't call no_co_wrapper function from coroutine

Namely, pvebackup_co_prepare() needs to call bdrv_co_open() rather
than bdrv_open(), because it is a coroutine itself.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
12 months agoadd stable patches for 8.0.0
Fiona Ebner [Mon, 15 May 2023 13:39:54 +0000 (15:39 +0200)]
add stable patches for 8.0.0

Changes to other patches are all just metadata/context changes except
for pvebackup_co_prepare() needing to call bdrv_co_unref() rather than
bdrv_unref(), because it is a coroutine itself. This is documented in
d6ee2e324e ("block-coroutine-wrapper: Introduce no_co_wrapper"). The
change is necessary, because one of the stable fixes converts
bdrv_unref and blk_unref into no_co_wrappers (in preparation for a
second patch to fix a hang with the block resize QMP command).

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
12 months agoupdate submodule and patches to QEMU 8.0.0
Fiona Ebner [Mon, 15 May 2023 13:39:53 +0000 (15:39 +0200)]
update submodule and patches to QEMU 8.0.0

Many changes were necessary this time around:

* QAPI was changed to avoid redundant has_* variables, see commit
44ea9d9be3 ("qapi: Start to elide redundant has_FOO in generated C")
for details. This affected many QMP commands added by Proxmox too.

* Pending querying for migration got split into two functions, one to
estimate, one for exact value, see commit c8df4a7aef ("migration:
Split save_live_pending() into state_pending_*") for details. Relevant
for savevm-async and PBS dirty bitmap.

* Some block (driver) functions got converted to coroutines, so the
Proxmox block drivers needed to be adapted.

* Alloc track auto-detaching during PBS live restore got broken by
AioContext-related changes resulting in a deadlock. The current, hacky
method was replaced by a simpler one. Stefan apparently ran into a
problem with that when he wrote the driver, but there were
improvements in the stream job code since then and I didn't manage to
reproduce the issue. It's a separate patch "alloc-track: fix deadlock
during drop" for now, you can find the details there.

* Async snapshot-related changes:
  - The pending querying got adapted to the above-mentioned split and
  a patch is added to optimize it/make it more similar to what
  upstream code does.
  - Added initialization of the compression counters (for
    future-proofing).
  - It's necessary the hold the BQL (big QEMU lock = iothread mutex)
  during the setup phase, because block layer functions are used there
  and not doing so leads to racy, hard-to-debug crashes or hangs. It's
  necessary to change some upstream code too for this, a version of
  the patch "migration: for snapshots, hold the BQL during setup
  callbacks" is intended to be upstreamed.
  - Need to take the bdrv graph read lock before flushing.

* hmp_info_balloon was moved to a different file.

* Needed to include a new headers from time to time to still get the
correct functions.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
12 months agod/rules: drop virtiofsd switch
Fiona Ebner [Mon, 15 May 2023 13:39:50 +0000 (15:39 +0200)]
d/rules: drop virtiofsd switch

virtiofsd is no longer part of QEMU 8.0. It got replaced by a separate
implementation written in Rust, which will be its own package.

See QEMU commit 0aaf44776e ("Merge tag 'pull-virtiofs-20230216b' of
https://gitlab.com/dagrh/qemu into staging").

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
12 months agomakefile: convert to use simple parenthesis
Thomas Lamprecht [Mon, 22 May 2023 11:53:03 +0000 (13:53 +0200)]
makefile: convert to use simple parenthesis

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/lintian-overrides: ignore groff line breakage/adjustment warnings
Thomas Lamprecht [Mon, 22 May 2023 13:08:38 +0000 (15:08 +0200)]
d/lintian-overrides: ignore groff line breakage/adjustment warnings

not much we can do here anyway..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/lintian-overrides: sort
Thomas Lamprecht [Mon, 22 May 2023 13:07:15 +0000 (15:07 +0200)]
d/lintian-overrides: sort

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/parse-machines: produce stable json output
Thomas Lamprecht [Mon, 22 May 2023 13:02:42 +0000 (15:02 +0200)]
d/parse-machines: produce stable json output

Enabling the "canonical" option the keys will be sorted, improving
build reproducibility.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/control: define compat level via build-depends and raise to 13
Fiona Ebner [Fri, 19 May 2023 11:20:13 +0000 (13:20 +0200)]
d/control: define compat level via build-depends and raise to 13

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agoalso exclude hppa-firmware.img ROM from build
Thomas Lamprecht [Mon, 22 May 2023 10:01:05 +0000 (12:01 +0200)]
also exclude hppa-firmware.img ROM from build

We don't use it and with debhelper compat level >= 11, the switch
from detecting files for strip through patters to checking for an ELF
header caused a build failure with the hppa-firmware.img ROM, as some
tools cannot cope with HP PARISC files.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agomove cleanup of unused ROMs from d/rules to build-dir generation
Thomas Lamprecht [Mon, 22 May 2023 10:00:03 +0000 (12:00 +0200)]
move cleanup of unused ROMs from d/rules to build-dir generation

this way we save a bit of space and should make build also slightly
faster, otherwise nothing should change.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/rules: fix debian-rules-missing-required-target
Thomas Lamprecht [Mon, 22 May 2023 10:24:06 +0000 (12:24 +0200)]
d/rules: fix debian-rules-missing-required-target

until we switch fully over to the dh sequencer

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/rules: cleanup cruft and use dpkg makefile fragements
Thomas Lamprecht [Mon, 22 May 2023 09:53:07 +0000 (11:53 +0200)]
d/rules: cleanup cruft and use dpkg makefile fragements

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: update lintian overrides
Thomas Lamprecht [Mon, 22 May 2023 10:04:22 +0000 (12:04 +0200)]
buildsys: update lintian overrides

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agoadd .gitignore file
Thomas Lamprecht [Mon, 22 May 2023 09:52:12 +0000 (11:52 +0200)]
add .gitignore file

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: use shorter variable name $@ in $(BUILDIR) target
Thomas Lamprecht [Mon, 22 May 2023 08:55:57 +0000 (10:55 +0200)]
buildsys: use shorter variable name $@ in $(BUILDIR) target

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: only run lintian for phony dsc target
Thomas Lamprecht [Mon, 22 May 2023 08:30:49 +0000 (10:30 +0200)]
buildsys: only run lintian for phony dsc target

This allows the sbuild to start much faster (lintian takes ~ minutes
for such big packages), and that without loss as sbuild will run
lintian on both binary and source package anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/control: avoid versioned build-dependcies with a -1 revision
Thomas Lamprecht [Sun, 21 May 2023 13:48:16 +0000 (15:48 +0200)]
d/control: avoid versioned build-dependcies with a -1 revision

no effect besides making it harder to build this for an eventual
backport.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agodebian: normalize packaging files with wrap-and-sort -tkn
Thomas Lamprecht [Sun, 21 May 2023 13:47:38 +0000 (15:47 +0200)]
debian: normalize packaging files with wrap-and-sort -tkn

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/rules: fix comment about when clean target is executed
Fiona Ebner [Fri, 19 May 2023 12:31:30 +0000 (14:31 +0200)]
d/rules: fix comment about when clean target is executed

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/rules: move copying config.guess and config.sub to config.status target
Fiona Ebner [Fri, 19 May 2023 12:21:11 +0000 (14:21 +0200)]
d/rules: move copying config.guess and config.sub to config.status target

It causes problems when done as part of the clean target when building
the dsc with the following error due to the additional files:
dpkg-source: error: aborting due to unexpected upstream changes

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: fix lintian overrides
Fiona Ebner [Mon, 15 May 2023 13:28:47 +0000 (15:28 +0200)]
buildsys: fix lintian overrides

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1007002 for more
information.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agod/rules: set job flag for make based on DEB_BUILD_OPTIONS
Fiona Ebner [Fri, 12 May 2023 11:39:08 +0000 (13:39 +0200)]
d/rules: set job flag for make based on DEB_BUILD_OPTIONS

Copied from Debian's QEMU package's d/rules. Otherwise, ninja will end
up using only a single job (in Debian Bookworm/Proxmox VE 8).

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: expand clean target
Fiona Ebner [Fri, 19 May 2023 11:22:00 +0000 (13:22 +0200)]
buildsys: expand clean target

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
 [ T: remove all tarballs for a package and any .deb ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: create build directory atomically
Fiona Ebner [Fri, 19 May 2023 11:41:49 +0000 (13:41 +0200)]
buildsys: create build directory atomically

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: add sbuild convenience target
Fiona Ebner [Fri, 19 May 2023 11:31:05 +0000 (13:31 +0200)]
buildsys: add sbuild convenience target

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: add dsc target
Fiona Ebner [Fri, 19 May 2023 11:30:23 +0000 (13:30 +0200)]
buildsys: add dsc target

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agobuildsys: derive upload dist automatically
Fiona Ebner [Fri, 19 May 2023 11:24:32 +0000 (13:24 +0200)]
buildsys: derive upload dist automatically

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agobump version to 7.2.0-8
Thomas Lamprecht [Fri, 17 Mar 2023 14:48:12 +0000 (15:48 +0100)]
bump version to 7.2.0-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agocherry-pick TCG-related stable fixes for 7.2
Fiona Ebner [Fri, 17 Mar 2023 12:47:11 +0000 (13:47 +0100)]
cherry-pick TCG-related stable fixes for 7.2

When turning off the "KVM hardware virtualization" checkbox in Proxmox
VE, the TCG accelerator is used, so these fixes are relevant then.

The first patch is included to allow cherry-picking the others without
changes.

Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agobump version to 7.2.0-8
Thomas Lamprecht [Fri, 17 Mar 2023 11:12:02 +0000 (12:12 +0100)]
bump version to 7.2.0-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agoadd patch fixing ACPI CPU hotplug issue with TCG
Fiona Ebner [Fri, 17 Mar 2023 10:39:52 +0000 (11:39 +0100)]
add patch fixing ACPI CPU hotplug issue with TCG

Required for the debian/edk2-vars-generator.py script in the
pve-edk2-firmware repository when building the edk2-stable202302
release. Without this patch, the QEMU process spawned by the script
would hang indefinietly.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agobump version to 7.2.0-7
Thomas Lamprecht [Mon, 13 Mar 2023 16:42:52 +0000 (17:42 +0100)]
bump version to 7.2.0-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agoadd patches to fix regression with LSI SCSI controller
Fiona Ebner [Mon, 13 Mar 2023 11:43:54 +0000 (12:43 +0100)]
add patches to fix regression with LSI SCSI controller

The patch 0008-memory-prevent-dma-reentracy-issues.patch introduced a
regression for the LSI SCSI controller leading to boot failures [0],
because, in its current form, it relies on reentrancy for a particular
ram_io region.

[0]: https://forum.proxmox.com/threads/123843

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agoadd more stable fixes
Fiona Ebner [Thu, 9 Mar 2023 13:37:35 +0000 (14:37 +0100)]
add more stable fixes

The patches were selected from the recent "Patch Round-up for stable
7.2.1" [0]. Those that should be relevant for our supported use-cases
(and the upcoming nvme use-case) were picked. Most of the patches
added now have not been submitted to qemu-stable before.

The follow-up for the virtio-rng-pci migration fix will break
migration between versions with the fix and without the fix when a
virtio-pci-rng(-non)-transitional device is used. Luckily Proxmox VE
only uses the virtio-pci-rng device, and this was fixed by
0006-virtio-rng-pci-fix-migration-compat-for-vectors.patch which was
applied before any public version of Proxmox VE's QEMU 7.2 package was
released.

[0]: https://lists.nongnu.org/archive/html/qemu-stable/2023-03/msg00010.html
[1]: https://bugzilla.redhat.com/show_bug.cgi?id=2162569

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agofixup patch "ide: avoid potential deadlock when draining during trim"
Fiona Ebner [Thu, 9 Mar 2023 13:37:34 +0000 (14:37 +0100)]
fixup patch "ide: avoid potential deadlock when draining during trim"

The patch was incomplete and (re-)introduced an issue with a potential
failing assertion upon cancelation of the DMA request.

There is a patch on qemu-devel now[0], and it's the same as this one
code-wise (except for comments). But the discussion is still ongoing.
While there shouldn't be a real issue with the patch, there might be
better approaches. The plan is to use this as a stop-gap for now and
pick up the proper solution once it's ready.

[0]: https://lists.nongnu.org/archive/html/qemu-devel/2023-03/msg03325.html

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agobump version to 7.2.0-6
Thomas Lamprecht [Wed, 8 Mar 2023 13:32:22 +0000 (14:32 +0100)]
bump version to 7.2.0-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agoadd patch to avoid potential deadlock with trim for IDE/SATA and draining
Fiona Ebner [Wed, 8 Mar 2023 11:51:05 +0000 (12:51 +0100)]
add patch to avoid potential deadlock with trim for IDE/SATA and draining

In particular, the deadlock can occur, together with unlucky timing
between the QEMU threads, when the guest is issuing trim requests
during the start of a backup operation.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
 [ T: resolve trivial merge conflict in series file ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agoadd patch fixing Linux boot failures with megasas SCSI
Fiona Ebner [Mon, 6 Mar 2023 07:41:37 +0000 (08:41 +0100)]
add patch fixing Linux boot failures with megasas SCSI

A regression in 7.2 and easily reproduced.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agobump version to 7.2.0-5
Thomas Lamprecht [Tue, 21 Feb 2023 12:50:08 +0000 (13:50 +0100)]
bump version to 7.2.0-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
14 months agoadd fix for iscsi double free issue leading to crashes
Fiona Ebner [Tue, 21 Feb 2023 12:21:02 +0000 (13:21 +0100)]
add fix for iscsi double free issue leading to crashes

Reported here[0] and here[1].

[0]: https://gitlab.com/qemu-project/qemu/-/issues/1378
[1]: https://forum.proxmox.com/threads/122776/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agoadd patch fixing DMA reentrancy issues
Fiona Ebner [Tue, 21 Feb 2023 09:08:59 +0000 (10:08 +0100)]
add patch fixing DMA reentrancy issues

that could lead to use-after-frees and stack overflows with a
malicious (or buggy) guest. See [0] for a good summary:

[0]: https://lore.kernel.org/qemu-devel/CAFEAcA_23vc7hE3iaM-JVA6W38LK4hJoWae5KcknhPRD5fPBZA@mail.gmail.com

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agoQMP backup: use correct errno when getting blockdrive length fails
Fiona Ebner [Mon, 30 Jan 2023 10:20:42 +0000 (11:20 +0100)]
QMP backup: use correct errno when getting blockdrive length fails

di->size would only be set later. The errno is minus the return value
from the function.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agosavevm-async: keep more free space when entering final stage
Fiona Ebner [Thu, 26 Jan 2023 13:46:14 +0000 (14:46 +0100)]
savevm-async: keep more free space when entering final stage

In qemu-server, we already allocate 2 * $mem_size + 500 MiB for driver
state (which was 32 MiB long ago according to git history). It seems
likely that the 30 MiB cutoff in the savevm-async implementation was
chosen based on that.

In bug #4476 [0], another issue caused the iteration to not make any
progress and the state file filled up all the way to the 30 MiB +
pending_size cutoff. Since the guest is not stopped immediately after
the check, it can still dirty some RAM and the current cutoff is not
enough for a reproducer VM (was done while bug #4476 still was not
fixed), dirtying memory with
> stress-ng -B 2 --bigheap-growth 64.0M'
After entering the final stage, savevm actually filled up the state
file completely, leading to an I/O error. It's probably the same
scenario as reported in the bug report, the error message was fixed in
commit a020815 ("savevm-async: fix function name in error message")
after the bug report.

If not for the bug, the cutoff will only be reached by a VM that's
dirtying RAM faster than can be written to the storage, so increase
the cutoff to 100 MiB to have a bigger chance to finish successfully,
while still trying to not increase downtime too much for
non-hibernation snapshots.

[0]: https://bugzilla.proxmox.com/show_bug.cgi?id=4476

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
14 months agofix #4476: savevm-async: avoid looping without progress
Fiona Ebner [Thu, 26 Jan 2023 13:46:13 +0000 (14:46 +0100)]
fix #4476: savevm-async: avoid looping without progress

when pend_postcopy is large. By definition, pend_postcopy won't
decrease when iterating, so a value larger than the cutoff of 400000
would lead to essentially empty iterations, filling up the state file
until only 30 MiB + pending_size remain and the second half of the
check would trigger.

Avoid this, by not considering pend_postcopy for the cutoff to enter
the final phase.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
15 months agod/rules: add note explaining why using noopt doesn't currenlty work
Fiona Ebner [Fri, 10 Feb 2023 09:39:24 +0000 (10:39 +0100)]
d/rules: add note explaining why using noopt doesn't currenlty work

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
15 months agod/rules: add missing export for CFLAGS
Fiona Ebner [Fri, 10 Feb 2023 09:39:23 +0000 (10:39 +0100)]
d/rules: add missing export for CFLAGS

Otherwise, they don't affect the build of QEMU at all.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
15 months agobump version to 7.2.0-4
Thomas Lamprecht [Fri, 27 Jan 2023 08:37:53 +0000 (09:37 +0100)]
bump version to 7.2.0-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
15 months agoadd patch to fix issue with VirtIO disk using detect-zeroes=unmap
Fiona Ebner [Fri, 27 Jan 2023 08:13:35 +0000 (09:13 +0100)]
add patch to fix issue with VirtIO disk using detect-zeroes=unmap

Affects Proxmox VE, when the discard disk setting is used for a
VirtIO disk.

Upstream bug report:
https://gitlab.com/qemu-project/qemu/-/issues/1404

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>