mirror of
https://git.proxmox.com/git/pve-qemu
synced 2025-08-16 21:40:39 +00:00

Commit f06b222
("fixes for QEMU 9.0") included a revert for the QEMU
commit 2ce6cff94d ("virtio-pci: fix use of a released vector"). That
commit caused some regressions which sounded just as bad as the fix.
Those regressions have now been addressed upstream, so pick up the fix
and drop the revert. Dropping the revert fixes the original issue that
commit 2ce6cff94d ("virtio-pci: fix use of a released vector")
addressed.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
56 lines
2.3 KiB
Diff
56 lines
2.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
|
Date: Thu, 11 Apr 2024 11:29:22 +0200
|
|
Subject: [PATCH] block/copy-before-write: fix permission
|
|
|
|
In case when source node does not have any parents, the condition still
|
|
works as required: backup job do create the parent by
|
|
|
|
block_job_create -> block_job_add_bdrv -> bdrv_root_attach_child
|
|
|
|
Still, in this case checking @perm variable doesn't work, as backup job
|
|
creates the root blk with empty permissions (as it rely on CBW filter
|
|
to require correct permissions and don't want to create extra
|
|
conflicts).
|
|
|
|
So, we should not check @perm.
|
|
|
|
The hack may be dropped entirely when transactional insertion of
|
|
filter (when we don't try to recalculate permissions in intermediate
|
|
state, when filter does conflict with original parent of the source
|
|
node) merged (old big series
|
|
"[PATCH v5 00/45] Transactional block-graph modifying API"[1] and it's
|
|
current in-flight part is "[PATCH v8 0/7] blockdev-replace"[2])
|
|
|
|
[1] https://patchew.org/QEMU/20220330212902.590099-1-vsementsov@openvz.org/
|
|
[2] https://patchew.org/QEMU/20231017184444.932733-1-vsementsov@yandex-team.ru/
|
|
|
|
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
|
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
|
---
|
|
block/copy-before-write.c | 10 +++++++---
|
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/block/copy-before-write.c b/block/copy-before-write.c
|
|
index 026fa9840f..5a9456d426 100644
|
|
--- a/block/copy-before-write.c
|
|
+++ b/block/copy-before-write.c
|
|
@@ -364,9 +364,13 @@ cbw_child_perm(BlockDriverState *bs, BdrvChild *c, BdrvChildRole role,
|
|
perm, shared, nperm, nshared);
|
|
|
|
if (!QLIST_EMPTY(&bs->parents)) {
|
|
- if (perm & BLK_PERM_WRITE) {
|
|
- *nperm = *nperm | BLK_PERM_CONSISTENT_READ;
|
|
- }
|
|
+ /*
|
|
+ * Note, that source child may be shared with backup job. Backup job
|
|
+ * does create own blk parent on copy-before-write node, so this
|
|
+ * works even if source node does not have any parents before backup
|
|
+ * start
|
|
+ */
|
|
+ *nperm = *nperm | BLK_PERM_CONSISTENT_READ;
|
|
*nshared &= ~(BLK_PERM_WRITE | BLK_PERM_RESIZE);
|
|
}
|
|
}
|