qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 08/10] monitor: QError support


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH 08/10] monitor: QError support
Date: Wed, 18 Nov 2009 18:16:16 +0000
User-agent: Mutt/1.4.1i

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 <windows.h>
> @@ -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 :|




reply via email to

[Prev in Thread] Current Thread [Next in Thread]