
Hi Kevin, On Mon, Nov 04, 2013 at 12:27:10PM +0100, Kevin Wolf wrote:
Am 04.11.2013 um 08:01 hat Amos Kong geschrieben:
Currently we have three QemuOptsList (qemu_common_drive_opts, qemu_legacy_drive_opts, and qemu_drive_opts), only qemu_drive_opts is added to vm_config_groups[].
We query commandline options by checking information in vm_config_groups[], so we can only get a NULL parameter list now.
This patch copied desc items of qemu_legacy_drive_opts and qemu_common_drive_opts to qemu_drive_opts.
Signed-off-by: Amos Kong <akong@redhat.com>
This breaks driver-specific options because they aren't (and cannot be) listed in the QemuOptsList.
For example:
$ x86_64-softmmu/qemu-system-x86_64 -drive file.driver=nbd,file.host=localhost qemu-system-x86_64: -drive file.driver=nbd,file.host=localhost: Invalid parameter 'file.driver'
query-command-line-options isn't an appropriate API to query the -drive capabilities in the blockdev-add world. You really want to have introspection for that.
For compatibility, we might want to at least expose part of the provided options there. In this case you should modify the monitor command to access the local QemuOptsLists of drive_init() and blockdev_init() for option="drive".
It's to access the local QemuOptsLists of drive_init() and blockdev_init() for option="drive". I saw there are two repeat items ("copy-on-read", "read-only") I will merge the two desc lists together, remove the repeat items, and output once. Attached my draft patch, I can use it to compile qemu binary, but touched following error, any note? ------------------------ [amos@amosk qemu]$ make CC util/qemu-config.o AR libqemuutil.a LINK qemu-ga LINK qemu-nbd LINK qemu-img LINK qemu-io libqemuutil.a(qemu-config.o): In function `qmp_query_command_line_options': /home/devel/qemu/util/qemu-config.c:141: undefined reference to `qemu_legacy_drive_opts' /home/devel/qemu/util/qemu-config.c:142: undefined reference to `qemu_common_drive_opts' /home/devel/qemu/util/qemu-config.c:144: undefined reference to `qemu_drive_opts' collect2: error: ld returned 1 exit status make: *** [qemu-nbd] Error 1 make: *** Waiting for unfinished jobs.... libqemuutil.a(qemu-config.o): In function `qmp_query_command_line_options': /home/devel/qemu/util/qemu-config.c:141: undefined reference to `qemu_legacy_drive_opts' /home/devel/qemu/util/qemu-config.c:142: undefined reference to `qemu_common_drive_opts' /home/devel/qemu/util/qemu-config.c:144: undefined reference to `qemu_drive_opts' collect2: error: ld returned 1 exit status make: *** [qemu-img] Error 1 libqemuutil.a(qemu-config.o): In function `qmp_query_command_line_options': /home/devel/qemu/util/qemu-config.c:141: undefined reference to `qemu_legacy_drive_opts' /home/devel/qemu/util/qemu-config.c:142: undefined reference to `qemu_common_drive_opts' /home/devel/qemu/util/qemu-config.c:144: undefined reference to `qemu_drive_opts' collect2: error: ld returned 1 exit status make: *** [qemu-io] Error 1 LINK x86_64-softmmu/qemu-system-x86_64 -- Amos.