]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block: Add bdrv_runtime_opts to query-command-line-options
authorKevin Wolf <kwolf@redhat.com>
Thu, 6 Oct 2016 09:33:17 +0000 (11:33 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 7 Oct 2016 11:34:07 +0000 (13:34 +0200)
Recently we moved a few options from QemuOptsLists in blockdev.c to
bdrv_runtime_opts in block.c in order to make them accissble using
blockdev-add. However, this has the side effect that these options are
missing from query-command-line-options now, and libvirt consequently
disables the corresponding feature.

This problem was reported as a regression for the 'discard' option,
introduced in commit 818584a4. However, it is more general than that.

Fix it by adding bdrv_runtime_opts to the list of QemuOptsLists that are
returned in query-command-line-options. For the future, libvirt is
advised to use QMP schema introspection for block device options.

Reported-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Gerd Hoffmann <kraxel@redhat.com>
block.c
include/sysemu/sysemu.h
util/qemu-config.c
vl.c

diff --git a/block.c b/block.c
index bb1f1ec95764b008a8db07896cdc3e4da3d12d10..40eb570389b3ad7dd63ff8e515605cd1af30fe85 100644 (file)
--- a/block.c
+++ b/block.c
@@ -926,7 +926,7 @@ out:
     g_free(gen_node_name);
 }
 
-static QemuOptsList bdrv_runtime_opts = {
+QemuOptsList bdrv_runtime_opts = {
     .name = "bdrv_common",
     .head = QTAILQ_HEAD_INITIALIZER(bdrv_runtime_opts.head),
     .desc = {
index ef2c50bb04e3fab3416724835acdc8aa704bb8f2..b66883328df229e9ab9687a1076870478433bbfe 100644 (file)
@@ -235,6 +235,7 @@ bool defaults_enabled(void);
 extern QemuOptsList qemu_legacy_drive_opts;
 extern QemuOptsList qemu_common_drive_opts;
 extern QemuOptsList qemu_drive_opts;
+extern QemuOptsList bdrv_runtime_opts;
 extern QemuOptsList qemu_chardev_opts;
 extern QemuOptsList qemu_device_opts;
 extern QemuOptsList qemu_netdev_opts;
index fb973074d304cb1aaed5fd3a9a22d71174b65934..5527100a01269ed0686411949d6fbe49b4581815 100644 (file)
@@ -6,7 +6,7 @@
 #include "qmp-commands.h"
 
 static QemuOptsList *vm_config_groups[48];
-static QemuOptsList *drive_config_groups[4];
+static QemuOptsList *drive_config_groups[5];
 
 static QemuOptsList *find_list(QemuOptsList **lists, const char *group,
                                Error **errp)
diff --git a/vl.c b/vl.c
index f3abd99eb2f9b2e7153d06f911d20b5d21cca61b..9a2e7d5a5e4a2568c8c1bb24ca9ec3d2731fa8c7 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3035,6 +3035,7 @@ int main(int argc, char **argv, char **envp)
     qemu_add_drive_opts(&qemu_legacy_drive_opts);
     qemu_add_drive_opts(&qemu_common_drive_opts);
     qemu_add_drive_opts(&qemu_drive_opts);
+    qemu_add_drive_opts(&bdrv_runtime_opts);
     qemu_add_opts(&qemu_chardev_opts);
     qemu_add_opts(&qemu_device_opts);
     qemu_add_opts(&qemu_netdev_opts);