[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 2/7] Introduce QError
From: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] Re: [PATCH 2/7] Introduce QError |
Date: |
Fri, 30 Oct 2009 02:25:33 +0000 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Paolo Bonzini wrote:
> On 10/29/2009 09:48 PM, Luiz Capitulino wrote:
> >> va_list doesn't need to be a pointer.
> >
> > Ok, but if this is going to be a public interface, I think it's
> >better to va_copy() before passing it to qobject_from_json_va() then.
>
> It is standard to pass a va_list by value without doing va_copy in the
> caller.
That's right, just like:
va_list ap;
va_start(ap, format);
vfprintf(stderr, format, ap); /* <- passed by value */
va_end(ap);
You only need va_copy() is you're going to use some more it after
passing it to the function.
There should be one va_end() for every va_start() plus every va_copy().
-- Jamie
[Qemu-devel] [PATCH 3/7] monitor: QError support, Luiz Capitulino, 2009/10/29
[Qemu-devel] [PATCH 4/7] QError: Add QERR_DEV_NFOUND, Luiz Capitulino, 2009/10/29
[Qemu-devel] [PATCH 5/7] qdev: Use QError for not found error, Luiz Capitulino, 2009/10/29
[Qemu-devel] [PATCH 6/7] QError: Add do_info_balloon() errors, Luiz Capitulino, 2009/10/29
[Qemu-devel] [PATCH 7/7] monitor: do_info_balloon(): use QError, Luiz Capitulino, 2009/10/29
[Qemu-devel] Re: [RFC 0/7] QError v1, Paolo Bonzini, 2009/10/29