]>
Commit | Line | Data |
---|---|---|
f1eed34a FE |
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
2 | From: Fiona Ebner <f.ebner@proxmox.com> | |
3 | Date: Tue, 26 Mar 2024 14:57:51 +0100 | |
4 | Subject: [PATCH] alloc-track: error out when auto-remove is not set | |
5 | ||
6 | Since replacing the node now happens in the stream job, where the | |
7 | option cannot be read from (it's internal to the driver), it will | |
8 | always be treated as on. | |
9 | ||
10 | qemu-server will always set it, make sure to have other users notice | |
11 | the change (should they even exist). The option can be fully dropped | |
12 | in the future while adding a version guard in qemu-server. | |
13 | ||
14 | Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> | |
15 | --- | |
16 | block/alloc-track.c | 7 +++++-- | |
17 | 1 file changed, 5 insertions(+), 2 deletions(-) | |
18 | ||
19 | diff --git a/block/alloc-track.c b/block/alloc-track.c | |
20 | index 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, |