qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/9] monitor: QError support


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 5/9] monitor: QError support
Date: Tue, 13 Oct 2009 23:59:56 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Luiz Capitulino <address@hidden> writes:

> This commit paves the way for QError support in the Monitor,
> it adds a QError member to the Monitor struct and functions
> to check and print it.
>
> Additionally, it introduces qemu_error_structed() which should
> be used by functions that are called by monitor handlers and
> print error information.
>
> This new function has to be used in place of qemu_error(), which
> will become private when all the conversion is done.
>
> Basically, the Monitor's error flow is something like this:
>
> 1. An error happens in the handler, it calls qemu_error_structed()
> 2. qemu_error_structed() builds the right QObjects with the error
>    information and stores them in the Monitor struct
> 3. The handler returns
> 4. Top level Monitor code checks the Monitor struct and calls
>    qerror_print() to print the error
[...]
> diff --git a/sysemu.h b/sysemu.h
> index 896916f..02247fe 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>
> @@ -70,6 +71,7 @@ int qemu_loadvm_state(QEMUFile *f);
>  void qemu_errors_to_file(FILE *fp);
>  void qemu_errors_to_mon(Monitor *mon);
>  void qemu_errors_to_previous(void);
> +void qemu_error_structed(QErrorCode code, const char *fmt, ...);

Needs __attribute__((format(printf, 2, 3))).

>  void qemu_error(const char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
>  
>  #ifdef _WIN32




reply via email to

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