]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0044-alloc-track-avoid-seemingly-superfluous-child-permis.patch
update submodule and patches to QEMU 8.2.2
[pve-qemu.git] / debian / patches / pve / 0044-alloc-track-avoid-seemingly-superfluous-child-permis.patch
CommitLineData
f1eed34a
FE
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Fiona Ebner <f.ebner@proxmox.com>
3Date: Wed, 27 Mar 2024 11:15:39 +0100
4Subject: [PATCH] alloc-track: avoid seemingly superfluous child permission
5 update
6
7Doesn't seem necessary nowadays (maybe after commit "alloc-track: fix
8deadlock during drop" where the dropping is not rescheduled and delayed
9anymore or some upstream change). Should there really be some issue,
10instead of having a drop state, this could also be just based off the
11fact whether there is still a backing child.
12
13Dumping the cumulative (shared) permissions for the BDS with a debug
14print yields the same values after this patch and with QEMU 8.1,
15namely 3 and 5.
16
17Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
18---
19 block/alloc-track.c | 26 --------------------------
20 1 file changed, 26 deletions(-)
21
22diff --git a/block/alloc-track.c b/block/alloc-track.c
23index dad8fe6375..7aff9763ad 100644
24--- a/block/alloc-track.c
25+++ b/block/alloc-track.c
26@@ -25,15 +25,9 @@
27
28 #define TRACK_OPT_AUTO_REMOVE "auto-remove"
29
30-typedef enum DropState {
31- DropNone,
32- DropInProgress,
33-} DropState;
34-
35 typedef struct {
36 BdrvDirtyBitmap *bitmap;
37 uint64_t granularity;
38- DropState drop_state;
39 } BDRVAllocTrackState;
40
41 static QemuOptsList runtime_opts = {
42@@ -137,8 +131,6 @@ static int track_open(BlockDriverState *bs, QDict *options, int flags,
43 goto fail;
44 }
45
46- s->drop_state = DropNone;
47-
48 fail:
49 if (ret < 0) {
50 bdrv_graph_wrlock(bs);
51@@ -289,18 +281,8 @@ track_child_perm(BlockDriverState *bs, BdrvChild *c, BdrvChildRole role,
52 BlockReopenQueue *reopen_queue, uint64_t perm, uint64_t shared,
53 uint64_t *nperm, uint64_t *nshared)
54 {
55- BDRVAllocTrackState *s = bs->opaque;
56-
57 *nshared = BLK_PERM_ALL;
58
59- /* in case we're currently dropping ourselves, claim to not use any
60- * permissions at all - which is fine, since from this point on we will
61- * never issue a read or write anymore */
62- if (s->drop_state == DropInProgress) {
63- *nperm = 0;
64- return;
65- }
66-
67 if (role & BDRV_CHILD_DATA) {
68 *nperm = perm & DEFAULT_PERM_PASSTHROUGH;
69 } else {
70@@ -326,14 +308,6 @@ track_co_change_backing_file(BlockDriverState *bs, const char *backing_file,
71 * kinda fits better, but in the long-term, a special parameter would be
72 * nice (or done via qemu-server via upcoming blockdev-replace QMP command).
73 */
74- if (backing_file == NULL) {
75- BDRVAllocTrackState *s = bs->opaque;
76- bdrv_drained_begin(bs);
77- s->drop_state = DropInProgress;
78- bdrv_child_refresh_perms(bs, bs->file, &error_abort);
79- bdrv_drained_end(bs);
80- }
81-
82 return 0;
83 }
84