[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/11] QemuOpts: Wean off qerror_report_err()
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 01/11] QemuOpts: Wean off qerror_report_err() |
Date: |
Mon, 15 Jun 2015 17:19:23 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sat, Jun 13, 2015 at 04:20:48PM +0200, Markus Armbruster wrote:
> 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
>
> Propoagate 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 <address@hidden>
> ---
> blockdev.c | 2 +-
> hmp.c | 2 +-
> hw/usb/dev-network.c | 2 +-
> include/qemu/option.h | 5 ++-
> include/ui/console.h | 2 +-
> monitor.c | 2 +-
> net/net.c | 5 ++-
> qdev-monitor.c | 2 +-
> qemu-img.c | 3 +-
> qemu-io.c | 2 +-
> qemu-nbd.c | 3 +-
> qmp.c | 2 +-
> tests/test-opts-visitor.c | 3 +-
> tests/test-qemu-opts.c | 2 +-
> tpm.c | 2 +-
> ui/vnc.c | 4 +-
> util/qemu-option.c | 25 ++++++++---
> vl.c | 103
> +++++++++++++++++++++++++++++-----------------
> 18 files changed, 109 insertions(+), 62 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
pgpvA8jhnjxki.pgp
Description: PGP signature
- [Qemu-devel] [PATCH 11/11] Include monitor/monitor.h exactly where needed, (continued)
- [Qemu-devel] [PATCH 11/11] Include monitor/monitor.h exactly where needed, Markus Armbruster, 2015/06/13
- [Qemu-devel] [PATCH 07/11] qmp: Wean off qerror_report(), Markus Armbruster, 2015/06/13
- [Qemu-devel] [PATCH 01/11] QemuOpts: Wean off qerror_report_err(), Markus Armbruster, 2015/06/13
- [Qemu-devel] [PATCH 10/11] Include qapi/qmp/qerror.h exactly where needed, Markus Armbruster, 2015/06/13
- [Qemu-devel] [PATCH 09/11] qerror: Move #include out of qerror.h, Markus Armbruster, 2015/06/13
- [Qemu-devel] [PATCH 05/11] qerror: Clean up QERR_ macros to expand into a single string, Markus Armbruster, 2015/06/13