diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-02-13 12:50:26 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-06-22 18:20:39 +0200 |
commit | 70b9433109ed99217b812f19800de550e2e0ecd5 (patch) | |
tree | 5108fd06d2106dfc495b9defab7212eb89b65ab3 /tests | |
parent | f006cf7fa9a63ba8e4ccf57d46231ce594301727 (diff) |
QemuOpts: Wean off qerror_report_err()
qerror_report_err() is a transitional interface to help with
converting existing monitor commands to QMP. It should not be used
elsewhere.
The only remaining user in qemu-option.c is qemu_opts_parse(). Is it
used in QMP context? If not, we can simply replace
qerror_report_err() by error_report_err().
The uses in qemu-img.c, qemu-io.c, qemu-nbd.c and under tests/ are
clearly not in QMP context.
The uses in vl.c aren't either, because the only QMP command handlers
there are qmp_query_status() and qmp_query_machines(), and they don't
call it.
Remaining uses:
* drive_def(): Command line -drive and such, HMP drive_add and pci_add
* hmp_chardev_add(): HMP chardev-add
* monitor_parse_command(): HMP core
* tmp_config_parse(): Command line -tpmdev
* net_host_device_add(): HMP host_net_add
* net_client_parse(): Command line -net and -netdev
* qemu_global_option(): Command line -global
* vnc_parse_func(): Command line -display, -vnc, default display, HMP
change, QMP change. Bummer.
* qemu_pci_hot_add_nic(): HMP pci_add
* usb_net_init(): Command line -usbdevice, HMP usb_add
Propagate errors through qemu_opts_parse(). Create a convenience
function qemu_opts_parse_noisily() that passes errors to
error_report_err(). Switch all non-QMP users outside tests to it.
That leaves vnc_parse_func(). Propagate errors through it. Since I'm
touching it anyway, rename it to vnc_parse().
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-opts-visitor.c | 3 | ||||
-rw-r--r-- | tests/test-qemu-opts.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/test-opts-visitor.c b/tests/test-opts-visitor.c index ebeee5d589..1c753d9824 100644 --- a/tests/test-opts-visitor.c +++ b/tests/test-opts-visitor.c @@ -39,7 +39,8 @@ setup_fixture(OptsVisitorFixture *f, gconstpointer test_data) QemuOpts *opts; OptsVisitor *ov; - opts = qemu_opts_parse(qemu_find_opts("userdef"), opts_string, 0); + opts = qemu_opts_parse(qemu_find_opts("userdef"), opts_string, false, + NULL); g_assert(opts != NULL); ov = opts_visitor_new(opts); diff --git a/tests/test-qemu-opts.c b/tests/test-qemu-opts.c index da564923d0..0c1136d1b2 100644 --- a/tests/test-qemu-opts.c +++ b/tests/test-qemu-opts.c @@ -323,7 +323,7 @@ static void test_qemu_opt_unset(void) int ret; /* dynamically initialized (parsed) opts */ - opts = qemu_opts_parse(&opts_list_03, "key=value", 0); + opts = qemu_opts_parse(&opts_list_03, "key=value", false, NULL); g_assert(opts != NULL); /* check default/parsed value */ |