]> git.proxmox.com Git - pve-qemu.git/blame - debian/patches/pve/0043-alloc-track-error-out-when-auto-remove-is-not-set.patch
update submodule and patches to QEMU 8.2.2
[pve-qemu.git] / debian / patches / pve / 0043-alloc-track-error-out-when-auto-remove-is-not-set.patch
CommitLineData
f1eed34a
FE
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Fiona Ebner <f.ebner@proxmox.com>
3Date: Tue, 26 Mar 2024 14:57:51 +0100
4Subject: [PATCH] alloc-track: error out when auto-remove is not set
5
6Since replacing the node now happens in the stream job, where the
7option cannot be read from (it's internal to the driver), it will
8always be treated as on.
9
10qemu-server will always set it, make sure to have other users notice
11the change (should they even exist). The option can be fully dropped
12in the future while adding a version guard in qemu-server.
13
14Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
15---
16 block/alloc-track.c | 7 +++++--
17 1 file changed, 5 insertions(+), 2 deletions(-)
18
19diff --git a/block/alloc-track.c b/block/alloc-track.c
20index 14698c362e..dad8fe6375 100644
21--- a/block/alloc-track.c
22+++ b/block/alloc-track.c
23@@ -34,7 +34,6 @@ typedef struct {
24 BdrvDirtyBitmap *bitmap;
25 uint64_t granularity;
26 DropState drop_state;
27- bool auto_remove;
28 } BDRVAllocTrackState;
29
30 static QemuOptsList runtime_opts = {
31@@ -86,7 +85,11 @@ static int track_open(BlockDriverState *bs, QDict *options, int flags,
32 goto fail;
33 }
34
35- s->auto_remove = qemu_opt_get_bool(opts, TRACK_OPT_AUTO_REMOVE, false);
36+ if (!qemu_opt_get_bool(opts, TRACK_OPT_AUTO_REMOVE, false)) {
37+ error_setg(errp, "alloc-track: requires auto-remove option to be set to on");
38+ ret = -EINVAL;
39+ goto fail;
40+ }
41
42 /* open the target (write) node, backing will be attached by block layer */
43 file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,