block: Add bdrv_runtime_opts to query-command-line-options
PATCH 1/1 block: Add bdrv_runtime_opts to query-command-line-options
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.
--- block.c | 2 +- include/sysemu/sysemu.h | 1 + util/qemu-config.c | 2 +- vl.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)
block.c +1 -1
@@ -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 = {
include/sysemu/sysemu.h +1 -0
@@ -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;
util/qemu-config.c +1 -1
@@ -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)
vl.c +1 -0
@@ -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);
Signature · 1 line
1.8.3.1
Quoted 9 lines · Kevin Wolf
Recently we moved a few options from QemuOptsLists in
blockdev.ctobdrv_runtime_optsinblock.cin 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.
Quoted 6 lines
Fix it by adding
bdrv_runtime_optsto 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 <[email protected]>Signed-off-by Kevin Wolf <[email protected]>
Thank you for such a prompt fix!
Michal
Quoted 65 lines · Kevin Wolf
Recently we moved a few options from QemuOptsLists in
blockdev.ctobdrv_runtime_optsinblock.cin 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_optsto 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 <[email protected]>Signed-off-by Kevin Wolf <[email protected]>---
block.c | 2 +- include/sysemu/sysemu.h | 1 + util/qemu-config.c | 2 +- vl.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)block.c +1
-1@@ -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 = {include/sysemu/sysemu.h +1
-0@@ -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;util/qemu-config.c +1
-1@@ -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)vl.c +0
-0
vl.c int main(int argc, char **argv, char **envp) · line 3036
Quoted 2 lines
vl.c +0
-0@@ -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);
I'm guessing this doesn't pose a problem with e.g.g "detect-zeroes" which is in this (&qemu_common_drive_opts) as well as
vl.c int main(int argc, char **argv, char **envp) · line 3038
Quoted 2 lines
vl.c +1
-0qemu_add_drive_opts (&qemu_drive_opts); +qemu_add_drive_opts (&bdrv_runtime_opts);
here ^^, right? Just wanted to make sure ;) Thanks for the fix.
Quoted 6 lines
vl.c +0
-1qemu_add_opts (&qemu_chardev_opts);qemu_add_opts (&qemu_device_opts);qemu_add_opts (&qemu_netdev_opts); --1.8.3.1
Am 06.10.2016 um 12:58 hat Martin Kletzander geschrieben:
Quoted 72 lines · Kevin Wolf
Quoted 65 lines
Recently we moved a few options from QemuOptsLists in
blockdev.ctobdrv_runtime_optsinblock.cin 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_optsto 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 <[email protected]>Signed-off-by Kevin Wolf <[email protected]>---
block.c | 2 +- include/sysemu/sysemu.h | 1 + util/qemu-config.c | 2 +- vl.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)block.c +1
-1@@ -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 = {include/sysemu/sysemu.h +1
-0@@ -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;util/qemu-config.c +1
-1@@ -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)vl.c +0
-0vl.c int main(int argc, char **argv, char **envp) · line 3036
Quoted 2 lines
vl.c +0
-0@@ -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);I'm guessing this doesn't pose a problem with e.g.g "detect-zeroes" which is in this (
&qemu_common_drive_opts) as well as
Quoted 4 lines
vl.c int main(int argc, char **argv, char **envp) · line 3038
Quoted 2 lines
vl.c +1
-0qemu_add_drive_opts (&qemu_drive_opts); +qemu_add_drive_opts (&bdrv_runtime_opts);here ^^, right? Just wanted to make sure ;) Thanks for the fix.
Yes, cleanup_infolist() removes duplicates before they are sent to the client.
Kevin
Quoted 9 lines · Kevin Wolf
Recently we moved a few options from QemuOptsLists in
blockdev.ctobdrv_runtime_optsinblock.cin 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.
Quoted 6 lines
Fix it by adding
bdrv_runtime_optsto 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 <[email protected]>Signed-off-by Kevin Wolf <[email protected]>
Quoted 57 lines
--- block.c | 2 +- include/sysemu/sysemu.h | 1 + util/qemu-config.c | 2 +- vl.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)block.c +1
-1@@ -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 = {include/sysemu/sysemu.h +1
-0@@ -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;util/qemu-config.c +1
-1@@ -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)vl.c +1
-0@@ -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);