From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NAp4r-0007Z2-6R for qemu-devel@nongnu.org; Wed, 18 Nov 2009 13:16:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NAp4m-0007SQ-7s for qemu-devel@nongnu.org; Wed, 18 Nov 2009 13:16:24 -0500 Received: from [199.232.76.173] (port=55466 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NAp4l-0007S1-Vn for qemu-devel@nongnu.org; Wed, 18 Nov 2009 13:16:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:19409) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NAp4l-0006We-0a for qemu-devel@nongnu.org; Wed, 18 Nov 2009 13:16:19 -0500 Date: Wed, 18 Nov 2009 18:16:16 +0000 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [PATCH 08/10] monitor: QError support Message-ID: <20091118181616.GB29178@redhat.com> References: <1258487037-24950-1-git-send-email-lcapitulino@redhat.com> <1258487037-24950-9-git-send-email-lcapitulino@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1258487037-24950-9-git-send-email-lcapitulino@redhat.com> Reply-To: "Daniel P. Berrange" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: aliguori@us.ibm.com, kraxel@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Tue, Nov 17, 2009 at 05:43:55PM -0200, Luiz Capitulino wrote: > This commit adds QError support in the Monitor. > > A QError member is added to the Monitor struct. This new member > stores error information and is also used to check if an error > has occurred when the called handler returns. > > Additionally, a new macro called qemu_error_new() is introduced. > It builds on top of the QemuErrorSink API and should be used in > place of qemu_error(). > > When all conversion to qemu_error_new() is done, qemu_error() can > be turned private. > diff --git a/sysemu.h b/sysemu.h > index b1887ef..656f6a4 100644 > --- a/sysemu.h > +++ b/sysemu.h > @@ -7,6 +7,7 @@ > #include "qemu-queue.h" > #include "qemu-timer.h" > #include "qdict.h" > +#include "qerror.h" > > #ifdef _WIN32 > #include > @@ -71,6 +72,11 @@ void qemu_errors_to_file(FILE *fp); > void qemu_errors_to_mon(Monitor *mon); > void qemu_errors_to_previous(void); > void qemu_error(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); > +void qemu_error_full(const char *file, int linenr, const char *fmt, ...) > + __attribute__ ((format(printf, 3, 4))); Add in a 3rd param, 'const char *func' > + > +#define qemu_error_new(fmt, ...) \ > + qemu_error_full(__FILE__, __LINE__, fmt, ## __VA_ARGS__) And use __func__ here Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|