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

Re: [Xen-devel] [PATCH RFC 6/9] libxl: introduce specific error code for libxl__wait_device_connection



Rob Hoes writes ("[PATCH RFC 6/9] libxl: introduce specific error code for 
libxl__wait_device_connection"):
...
> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
> index 93bb41e..56c6e2e 100644
> --- a/tools/libxl/libxl_device.c
> +++ b/tools/libxl/libxl_device.c
> @@ -768,6 +768,7 @@ void libxl__wait_device_connection(libxl__egc *egc, 
> libxl__ao_device *aodev)
>                                   LIBXL_INIT_TIMEOUT * 1000);
>      if (rc) {
>          LOG(ERROR, "unable to initialize device %s", be_path);
> +        rc = ERROR_DEVICE_WAIT_INIT;
>          goto out;

Smashing rc values like this is an antipattern.  For example, here,
you would turn ERROR_CANCELLED (from my ao cancellation series) into
ERROR_DEVICE_WAIT_INIT.

See my earlier comments about making timeouts each have their own rc
value depending what was waited for.

This particular wait is normally waiting for the backend/frontend
negotiation and state machine to complete, I think.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.