[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 06/13] error: remove error_printf_unless_qmp()
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 06/13] error: remove error_printf_unless_qmp() |
Date: |
Fri, 18 Oct 2013 11:39:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
Il 18/10/2013 03:11, Wenchao Xia ha scritto:
> monitor_vprintf() is called in the code path, and it will not print
> when monitor is in qmp mode, so checking monitor mode in
> error_printf_unless_qmp() is useless, remove it to simplify the code.
>
> Signed-off-by: Wenchao Xia <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
> ---
> hw/usb/bus.c | 2 +-
> hw/usb/hcd-ehci.c | 4 ++--
> include/qemu/error-report.h | 1 -
> util/qemu-error.c | 11 -----------
> 4 files changed, 3 insertions(+), 15 deletions(-)
>
> diff --git a/hw/usb/bus.c b/hw/usb/bus.c
> index 72d5b92..817a69a 100644
> --- a/hw/usb/bus.c
> +++ b/hw/usb/bus.c
> @@ -328,7 +328,7 @@ int usb_register_companion(const char *masterbus, USBPort
> *ports[],
> qerror_report(QERR_INVALID_PARAMETER_VALUE, "masterbus",
> "an USB masterbus");
> if (bus) {
> - error_printf_unless_qmp(
> + error_report(
> "USB bus '%s' does not allow companion controllers\n",
> masterbus);
> }
> diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
> index 22bdbf4..bb7e003 100644
> --- a/hw/usb/hcd-ehci.c
> +++ b/hw/usb/hcd-ehci.c
> @@ -848,7 +848,7 @@ static int ehci_register_companion(USBBus *bus, USBPort
> *ports[],
> if (firstport + portcount > NB_PORTS) {
> qerror_report(QERR_INVALID_PARAMETER_VALUE, "firstport",
> "firstport on masterbus");
> - error_printf_unless_qmp(
> + error_report(
> "firstport value of %u makes companion take ports %u - %u, which
> "
> "is outside of the valid range of 0 - %u\n", firstport,
> firstport,
> firstport + portcount - 1, NB_PORTS - 1);
> @@ -859,7 +859,7 @@ static int ehci_register_companion(USBBus *bus, USBPort
> *ports[],
> if (s->companion_ports[firstport + i]) {
> qerror_report(QERR_INVALID_PARAMETER_VALUE, "masterbus",
> "an USB masterbus");
> - error_printf_unless_qmp(
> + error_report(
> "port %u on masterbus %s already has a companion assigned\n",
> firstport + i, bus->qbus.name);
> return -1;
> diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h
> index 3b098a9..5297e65 100644
> --- a/include/qemu/error-report.h
> +++ b/include/qemu/error-report.h
> @@ -36,7 +36,6 @@ void loc_set_file(const char *fname, int lno);
>
> void error_vprintf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0);
> void error_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
> -void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
> void error_print_loc(void);
> void error_set_progname(const char *argv0);
> void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
> diff --git a/util/qemu-error.c b/util/qemu-error.c
> index fec02c6..85e8a79 100644
> --- a/util/qemu-error.c
> +++ b/util/qemu-error.c
> @@ -40,17 +40,6 @@ void error_printf(const char *fmt, ...)
> va_end(ap);
> }
>
> -void error_printf_unless_qmp(const char *fmt, ...)
> -{
> - va_list ap;
> -
> - if (!monitor_cur_is_qmp()) {
> - va_start(ap, fmt);
> - error_vprintf(fmt, ap);
> - va_end(ap);
> - }
> -}
> -
> static Location std_loc = {
> .kind = LOC_NONE
> };
>
- [Qemu-devel] [PATCH 00/13] trivial patches for event, error and monitor, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 02/13] block: do not include monitor.h in block.c, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 01/13] block: use type MonitorEvent directly, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 06/13] error: remove error_printf_unless_qmp(), Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 07/13] error: make error_print_loc() static, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 05/13] error: define struct Error in only one place, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 04/13] qapi: rename MonitorEvent to QEvent, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 03/13] qapi: move MonitorEvent define, Wenchao Xia, 2013/10/18