qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cole Robinson <crobinso@redhat.com>
To: qemu-devel@nongnu.org
Cc: Cole Robinson <crobinso@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: [Qemu-devel] [PATCH 5/6] error: Remove redundant error_printf_unless_qmp
Date: Tue, 11 Mar 2014 19:15:21 -0400	[thread overview]
Message-ID: <78acad01f5b2a08eea750d428a9337bb4c6b4527.1394579440.git.crobinso@redhat.com> (raw)
In-Reply-To: <cover.1394579440.git.crobinso@redhat.com>
In-Reply-To: <cover.1394579440.git.crobinso@redhat.com>

error_printf is just a wrapper around monitor_printf, which already
drops the requested output if cur_mon is qmp.

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 hw/usb/bus.c                |  2 +-
 hw/usb/hcd-ehci.c           |  4 ++--
 include/qemu/error-report.h |  1 -
 util/qemu-error.c           | 11 -----------
 util/qemu-option.c          |  7 -------
 5 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index fe70429..f860631 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -348,7 +348,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_printf(
                 "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 355bbd6..81ef01d 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -855,7 +855,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_printf(
             "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);
@@ -866,7 +866,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_printf(
                 "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 000eae3..a08ee95 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_set_progname(const char *argv0);
 void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 const char *error_get_progname(void);
diff --git a/util/qemu-error.c b/util/qemu-error.c
index 80df49a..0ccd3e9 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
 };
diff --git a/util/qemu-option.c b/util/qemu-option.c
index 9d898af..552fd06 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -201,10 +201,6 @@ void parse_option_size(const char *name, const char *value,
             break;
         default:
             error_set(errp, QERR_INVALID_PARAMETER_VALUE, name, "a size");
-#if 0 /* conversion from qerror_report() to error_set() broke this: */
-            error_printf_unless_qmp("You may use k, M, G or T suffixes for "
-                    "kilobytes, megabytes, gigabytes and terabytes.\n");
-#endif
             return;
         }
     } else {
@@ -811,9 +807,6 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id,
     if (id) {
         if (!id_wellformed(id)) {
             error_set(errp,QERR_INVALID_PARAMETER_VALUE, "id", "an identifier");
-#if 0 /* conversion from qerror_report() to error_set() broke this: */
-            error_printf_unless_qmp("Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.\n");
-#endif
             return NULL;
         }
         opts = qemu_opts_find(list, id);
-- 
1.8.5.3

  parent reply	other threads:[~2014-03-11 23:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 23:15 [Qemu-devel] [PATCH 0/6] error: Misc cleanups and improvements Cole Robinson
2014-03-11 23:15 ` [Qemu-devel] [PATCH 1/6] slirp: Remove default_mon usage Cole Robinson
2014-03-12  7:22   ` Jan Kiszka
2014-03-12 13:06     ` Luiz Capitulino
2014-03-22 18:27     ` Andreas Färber
2014-03-22 21:36       ` Cole Robinson
2014-03-12  8:13   ` Markus Armbruster
2014-03-12 13:22     ` Cole Robinson
2014-03-12 14:45       ` Markus Armbruster
2014-03-11 23:15 ` [Qemu-devel] [PATCH 2/6] vnc: " Cole Robinson
2014-03-12  7:35   ` Gerd Hoffmann
2014-03-22 20:14     ` Andreas Färber
2014-03-11 23:15 ` [Qemu-devel] [PATCH 3/6] error: Privatize error_print_loc Cole Robinson
2014-03-22 20:04   ` Andreas Färber
2014-03-11 23:15 ` [Qemu-devel] [PATCH 4/6] monitor: Remove unused monitor_print_filename Cole Robinson
2014-03-22 20:06   ` Andreas Färber
2014-03-22 21:44     ` Cole Robinson
2014-03-24 13:09     ` Luiz Capitulino
2014-03-24 13:46       ` Andreas Färber
2014-03-26 13:46         ` Markus Armbruster
2014-03-11 23:15 ` Cole Robinson [this message]
2014-03-12  8:56   ` [Qemu-devel] [PATCH 5/6] error: Remove redundant error_printf_unless_qmp Markus Armbruster
2014-03-21 23:41     ` Cole Robinson
2014-03-11 23:15 ` [Qemu-devel] [PATCH 6/6] error: Print error_report() to stderr if using qmp Cole Robinson

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=78acad01f5b2a08eea750d428a9337bb4c6b4527.1394579440.git.crobinso@redhat.com \
    --to=crobinso@redhat.com \
    --cc=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --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).