qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 02/15] net: Permit incremental conversion of ini


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 02/15] net: Permit incremental conversion of init functions to Error
Date: Thu, 14 May 2015 09:45:05 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 05/12/2015 06:02 AM, Markus Armbruster wrote:
> Error reporting for netdev_add is broken: the net_client_init_fun[]
> report the actual errors with (at best) error_report(), and their
> caller net_client_init1() makes up a generic error on top.
> 
> For command line and HMP, this produces an mildly ugly error cascande.

s/cascande/cascade/

> 
> In QMP, the actual errors go to stderr, and the generic error becomes
> the command's error reply.
> 
> To fix this, we need to convert the net_client_init_fun[] to Error.
> 
> To permit fixing them one by one, add an Error ** parameter to the
> net_client_init_fun[].  If the call fails without returning an Error,
> make up the same generic Error as before.  But if it returns one, use
> that instead.  Since none of them does so far, no functional change.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---

> @@ -802,7 +803,7 @@ static int net_init_nic(const NetClientOptions *opts, 
> const char *name,
>  static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])(
>      const NetClientOptions *opts,
>      const char *name,
> -    NetClientState *peer) = {
> +    NetClientState *peer, Error **errp) = {
>          [NET_CLIENT_OPTIONS_KIND_NIC]       = net_init_nic,

Not this patch, but would this be easier to read with the use of a
typedef for the function pointer?

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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