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 > --- > @@ -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 -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org