error: Clean up after recent changes
v2 cover error: Clean up after recent changes
Cleaner integration of location tracking with qemu-tool.c. Move qerror_report() where it belongs.
v2: Remove an assertion that unreachable code can't be reached, at Blue Swirl's request. Rebased.
Markus Armbruster (6):
error: Trim includes after "Move qemu_error & friends..."
error: Trim includes in qerror.c
error: Trim includes after "Infrastructure to track locations..."
error: Make use of error_set_progname() optional
error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o
error: Move qerror_report() from qemu-error.[ch] to qerror.[ch]
Makefile | 6 +++--- hw/qdev-properties.c | 1 + monitor.c | 2 -- monitor.h | 1 - qemu-error.c | 20 +------------------- qemu-error.h | 6 ------ qemu-tool.c | 49 +++++++++++++++---------------------------------- qerror.c | 22 ++++++++++++++++++++-- qerror.h | 5 +++++ sysemu.h | 2 -- 10 files changed, 45 insertions(+), 69 deletions(-)
PATCH v2 1/6 error: Trim includes after "Move qemu_error & friends..."
Missed in commit 2f792016.
--- hw/qdev-properties.c | 1 + monitor.c | 2 -- sysemu.h | 2 -- 3 files changed, 1 insertions(+), 4 deletions(-)
hw/qdev-properties.c +1 -0
@@ -1,6 +1,7 @@#include "sysemu.h" #include "net.h" #include "qdev.h" +#include "qerror.h" void *qdev_get_prop_ptr (DeviceState *dev,Property *prop) {
monitor.c +0 -2
@@ -49,10 +49,8 @@#include "qint.h" #include "qfloat.h" #include "qlist.h" -#include "qdict.h" #include "qbool.h" #include "qstring.h" -#include "qerror.h" #include "qjson.h" #include "json-streamer.h" #include "json-parser.h"
sysemu.h +0 -2
@@ -6,8 +6,6 @@#include "qemu-option.h" #include "qemu-queue.h" #include "qemu-timer.h" -#include "qdict.h" -#include "qerror.h" #ifdef _WIN32#include <windows.h>
Signature · 1 line
1.6.6.1
PATCH v2 2/6 error: Trim includes in qerror.c
In reply to Markus Armbruster--- qerror.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
qerror.c +0 -2
@@ -11,9 +11,7 @@*/ #include "qjson.h" #include "qerror.h" -#include "qstring.h" #include "qemu-common.h" -#include "qemu-error.h" static void qerror_destroy_obj (QObject *obj);
Signature · 1 line
1.6.6.1
PATCH v2 3/6 error: Trim includes after "Infrastructure to track locations..."
In reply to Markus ArmbrusterMissed in commit 827b0813.
--- monitor.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
monitor.h +0 -1
@@ -3,7 +3,6 @@#include "qemu-common.h" #include "qemu-char.h" -#include "qemu-error.h" #include "qerror.h" #include "qdict.h" #include "block.h"
Signature · 1 line
1.6.6.1
PATCH v2 4/6 error: Make use of error_set_progname() optional
In reply to Markus Armbruster--- qemu-error.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
qemu-error.c +1 -1
@@ -167,7 +167,7 @@ void error_print_loc(void)int i;const char *const *argp; -if (!cur_mon) { +if (!cur_mon && progname) {fprintf (stderr,"%s:" , progname); sep =" " ; }
Signature · 1 line
1.6.6.1
PATCH v2 5/6 error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o
In reply to Markus ArmbrusterThe location tracking interface is used by code shared with qemi-img, qemu-nbd and qemu-io, so it needs to be available there. Commit 827b0813 provides it in a rather hamfisted way: it adds a dummy implementation to qemu-tool.c.
It's cleaner to provide the real thing, and put a few more dummy monitor functions into qemu-tool.c.
--- Makefile | 6 +++--- qemu-tool.c | 49 +++++++++++++++---------------------------------- 2 files changed, 18 insertions(+), 37 deletions(-)
Makefile +3 -3
@@ -129,11 +129,11 @@ bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS) qemu-img.o: qemu-img-cmds.h qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o: $(GENERATED_HEADERS) -qemu-img$(EXESUF): qemu-img.o qemu-tool.o $(block-obj-y) $(qobject-obj-y) +qemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o $(block-obj-y) $(qobject-obj-y) -qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o $(block-obj-y) $(qobject-obj-y) +qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(block-obj-y) $(qobject-obj-y) -qemu-io$(EXESUF): qemu-io.o qemu-tool.o cmd.o $(block-obj-y) $(qobject-obj-y) +qemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o $(block-obj-y) $(qobject-obj-y) qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $@")
qemu-tool.c +15 -34
64 lines not on this page · raw message
Signature · 1 line
1.6.6.1
PATCH v2 6/6 error: Move qerror_report() from qemu-error.[ch] to qerror.[ch]
In reply to Markus Armbruster--- qemu-error.c | 18 ------------------ qemu-error.h | 6 ------ qerror.c | 20 ++++++++++++++++++++ qerror.h | 5 +++++ 4 files changed, 25 insertions(+), 24 deletions(-)
qemu-error.c +0 -18
@@ -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); - } -}
qemu-error.h +0 -6
@@ -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
qerror.c +20 -0
@@ -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 */
qerror.h +5 -0
@@ -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);/*
Signature · 1 line
1.6.6.1
Quoted 6 lines · On Mon, 22 Mar 2010 10:28:59 +0100 Markus Armbruster <[email protected]> wrote:
Cleaner integration of location tracking with
qemu-tool.c. Moveqerror_report()where it belongs.v2: Remove an assertion that unreachable code can't be reached, at Blue Swirl's request. Rebased.
Quoted 7 lines
Markus Armbruster (6):
error: Trim includes after "Moveqemu_error& friends..."
error: Trim includes inqerror.c
error: Trim includes after "Infrastructure to track locations..."
error: Make use oferror_set_progname()optional
error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o
error: Moveqerror_report()from qemu-error.[ch] to qerror.[ch]
Looks good.
Quoted 13 lines
Makefile | 6 +++--- hw/qdev-properties.c | 1 + monitor.c | 2 -- monitor.h | 1 - qemu-error.c | 20 +------------------- qemu-error.h | 6 ------ qemu-tool.c | 49 +++++++++++++++---------------------------------- qerror.c | 22 ++++++++++++++++++++-- qerror.h | 5 +++++ sysemu.h | 2 -- 10 files changed, 45 insertions(+), 69 deletions(-)
Aurelien Jarno
AppliedQuoted 6 lines · Markus Armbruster
Cleaner integration of location tracking with
qemu-tool.c. Moveqerror_report()where it belongs.v2: Remove an assertion that unreachable code can't be reached, at Blue Swirl's request. Rebased.
Quoted 7 lines
Markus Armbruster (6):
error: Trim includes after "Moveqemu_error& friends..."
error: Trim includes inqerror.c
error: Trim includes after "Infrastructure to track locations..."
error: Make use oferror_set_progname()optional
error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o
error: Moveqerror_report()from qemu-error.[ch] to qerror.[ch]
Thanks, applied.
Quoted 15 lines
Makefile | 6 +++--- hw/qdev-properties.c | 1 + monitor.c | 2 -- monitor.h | 1 - qemu-error.c | 20 +------------------- qemu-error.h | 6 ------ qemu-tool.c | 49 +++++++++++++++---------------------------------- qerror.c | 22 ++++++++++++++++++++-- qerror.h | 5 +++++ sysemu.h | 2 -- 10 files changed, 45 insertions(+), 69 deletions(-)
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net