qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 05/19] Ensure that QEMU exits if drive_add parsi


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 05/19] Ensure that QEMU exits if drive_add parsing fails
Date: Sat, 26 Jun 2010 09:04:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

"Daniel P. Berrange" <address@hidden> writes:

> The drive_add() method returns NULL if it failed to parse the
> parameter values for any reason. All callers must check this
> and exit if failure occurred. Annotate the method so that the
> compiler validates this.

Good move.  Need more of that.

> Signed-off-by: Daniel P. Berrange <address@hidden>
> ---
>  vl.c |   38 ++++++++++++++++++++++++++------------
>  1 files changed, 26 insertions(+), 12 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 7121cd0..3d08a44 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -654,6 +654,7 @@ static int bt_parse(const char *opt)
>  #define MTD_ALIAS "if=mtd"
>  #define SD_ALIAS "index=0,if=sd"
>  
> +QEMU_WARN_UNUSED_RESULT
>  QemuOpts *drive_add(const char *file, const char *fmt, ...)

The *declaration* needs QEMU_WARN_UNUSED_RESULT.  Tacking it onto the
definition only protects this compilation unit.

[...]



reply via email to

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