qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: lcapitulino@redhat.com
Subject: [Qemu-devel] [PATCH 6/6] error: Move qerror_report() from qemu-error.[ch] to qerror.[ch]
Date: Wed, 17 Mar 2010 18:56:54 +0100	[thread overview]
Message-ID: <1268848614-6844-7-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1268848614-6844-1-git-send-email-armbru@redhat.com>


Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 qemu-error.c |   18 ------------------
 qemu-error.h |    6 ------
 qerror.c     |   20 ++++++++++++++++++++
 qerror.h     |    5 +++++
 4 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/qemu-error.c b/qemu-error.c
index 9b9c0a1..57d7555 100644
--- a/qemu-error.c
+++ b/qemu-error.c
@@ -207,21 +207,3 @@ void error_report(const char *fmt, ...)
     va_end(ap);
     error_printf("\n");
 }
-
-void qerror_report_internal(const char *file, int linenr, const char *func,
-                            const char *fmt, ...)
-{
-    va_list va;
-    QError *qerror;
-
-    va_start(va, fmt);
-    qerror = qerror_from_info(file, linenr, func, fmt, &va);
-    va_end(va);
-
-    if (monitor_cur_is_qmp()) {
-        monitor_set_error(cur_mon, qerror);
-    } else {
-        qerror_print(qerror);
-        QDECREF(qerror);
-    }
-}
diff --git a/qemu-error.h b/qemu-error.h
index e63c6ab..a45609f 100644
--- a/qemu-error.h
+++ b/qemu-error.h
@@ -37,11 +37,5 @@ void error_printf_unless_qmp(const char *fmt, ...)
 void error_print_loc(void);
 void error_set_progname(const char *argv0);
 void error_report(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
-void qerror_report_internal(const char *file, int linenr, const char *func,
-                            const char *fmt, ...)
-    __attribute__ ((format(printf, 4, 5)));
-
-#define qerror_report(fmt, ...) \
-    qerror_report_internal(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__)
 
 #endif
diff --git a/qerror.c b/qerror.c
index ff2fbd5..eaa1deb 100644
--- a/qerror.c
+++ b/qerror.c
@@ -9,6 +9,8 @@
  * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
  * See the COPYING.LIB file in the top-level directory.
  */
+
+#include "monitor.h"
 #include "qjson.h"
 #include "qerror.h"
 #include "qemu-common.h"
@@ -377,6 +379,24 @@ void qerror_print(QError *qerror)
     QDECREF(qstring);
 }
 
+void qerror_report_internal(const char *file, int linenr, const char *func,
+                            const char *fmt, ...)
+{
+    va_list va;
+    QError *qerror;
+
+    va_start(va, fmt);
+    qerror = qerror_from_info(file, linenr, func, fmt, &va);
+    va_end(va);
+
+    if (monitor_cur_is_qmp()) {
+        monitor_set_error(cur_mon, qerror);
+    } else {
+        qerror_print(qerror);
+        QDECREF(qerror);
+    }
+}
+
 /**
  * qobject_to_qerror(): Convert a QObject into a QError
  */
diff --git a/qerror.h b/qerror.h
index d96abe1..dd298d4 100644
--- a/qerror.h
+++ b/qerror.h
@@ -37,6 +37,11 @@ QError *qerror_from_info(const char *file, int linenr, const char *func,
                          const char *fmt, va_list *va);
 QString *qerror_human(const QError *qerror);
 void qerror_print(QError *qerror);
+void qerror_report_internal(const char *file, int linenr, const char *func,
+                            const char *fmt, ...)
+    __attribute__ ((format(printf, 4, 5)));
+#define qerror_report(fmt, ...) \
+    qerror_report_internal(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__)
 QError *qobject_to_qerror(const QObject *obj);
 
 /*
-- 
1.6.6.1

      parent reply	other threads:[~2010-03-17 17:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17 17:56 [Qemu-devel] [PATCH 0/6] error: Clean up after recent changes Markus Armbruster
2010-03-17 17:56 ` [Qemu-devel] [PATCH 1/6] error: Trim includes after "Move qemu_error & friends..." Markus Armbruster
2010-03-18 21:30   ` [Qemu-devel] " Luiz Capitulino
2010-03-19 21:31     ` Markus Armbruster
2010-03-22  0:40       ` Luiz Capitulino
2010-03-22  8:38         ` Markus Armbruster
2010-03-17 17:56 ` [Qemu-devel] [PATCH 2/6] error: Trim includes in qerror.c Markus Armbruster
2010-03-18 21:32   ` [Qemu-devel] " Luiz Capitulino
2010-03-19 21:33     ` Markus Armbruster
2010-03-22  0:38       ` Luiz Capitulino
2010-03-17 17:56 ` [Qemu-devel] [PATCH 3/6] error: Trim includes after "Infrastructure to track locations..." Markus Armbruster
2010-03-17 17:56 ` [Qemu-devel] [PATCH 4/6] error: Make use of error_set_progname() optional Markus Armbruster
2010-03-17 17:56 ` [Qemu-devel] [PATCH 5/6] error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o Markus Armbruster
2010-03-17 19:53   ` Blue Swirl
2010-03-17 21:17     ` Markus Armbruster
2010-03-18 17:58       ` Blue Swirl
2010-03-18 18:09         ` Markus Armbruster
2010-03-18 18:20           ` Blue Swirl
2010-03-18 18:55             ` Markus Armbruster
2010-03-18 19:32               ` Blue Swirl
2010-03-22  9:37                 ` Markus Armbruster
2010-03-17 17:56 ` Markus Armbruster [this message]

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=1268848614-6844-7-git-send-email-armbru@redhat.com \
    --to=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).