From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 04/10] block: Add bdrv_runtime_opts to query-command-line-options
Date: Fri, 7 Oct 2016 15:42:53 +0200 [thread overview]
Message-ID: <1475847779-7336-5-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1475847779-7336-1-git-send-email-kwolf@redhat.com>
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 | 2 +-
include/sysemu/sysemu.h | 1 +
util/qemu-config.c | 2 +-
vl.c | 1 +
4 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index bb1f1ec..40eb570 100644
--- 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 = {
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index ef2c50b..b668833 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -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;
diff --git a/util/qemu-config.c b/util/qemu-config.c
index fb97307..5527100 100644
--- a/util/qemu-config.c
+++ b/util/qemu-config.c
@@ -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 f3abd99..9a2e7d5 100644
--- 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);
--
1.8.3.1
next prev parent reply other threads:[~2016-10-07 13:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-07 13:42 [Qemu-devel] [PULL 00/10] Block layer patches Kevin Wolf
2016-10-07 13:42 ` [Qemu-devel] [PULL 01/10] block: use bdrv_add_before_write_notifier Kevin Wolf
2016-10-07 13:42 ` [Qemu-devel] [PULL 02/10] async: add aio_bh_schedule_oneshot Kevin Wolf
2016-10-07 13:42 ` [Qemu-devel] [PULL 03/10] block: use aio_bh_schedule_oneshot Kevin Wolf
2016-10-07 13:42 ` Kevin Wolf [this message]
2016-10-07 13:42 ` [Qemu-devel] [PULL 05/10] block: Add node name to BLOCK_IO_ERROR event Kevin Wolf
2016-10-07 13:42 ` [Qemu-devel] [PULL 06/10] block-backend: Remember if attached device is non-qdev Kevin Wolf
2016-10-07 13:42 ` [Qemu-devel] [PULL 07/10] block: Add qdev ID to DEVICE_TRAY_MOVED Kevin Wolf
2016-10-07 13:42 ` [Qemu-devel] [PULL 08/10] scripts: Allow block module to not define BlockDriver Kevin Wolf
2016-10-07 13:42 ` [Qemu-devel] [PULL 09/10] module: Don't load the same module if requested multiple times Kevin Wolf
2016-10-07 13:42 ` [Qemu-devel] [PULL 10/10] dmg: Move libbz2 code to dmg-bz2.so Kevin Wolf
2016-10-10 9:39 ` [Qemu-devel] [PULL 00/10] Block layer patches Peter Maydell
2016-10-10 11:37 ` Kevin Wolf
2016-10-10 15:23 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1475847779-7336-5-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).