提交 c5f3014b 编写于 作者: K Kevin Wolf

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.
Reported-by: NMichal Privoznik <mprivozn@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
Tested-by: NMichal Privoznik <mprivozn@redhat.com>
Tested-by: NGerd Hoffmann <kraxel@redhat.com>
上级 fffb6e12
......@@ -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 = {
......
......@@ -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;
......
......@@ -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)
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部