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

Re: [Xen-devel] [PATCH 01/10] libxl_pci: improve return codes for more xl commands



On Fri, 1 Apr 2016, Paulina Szubarczyk wrote:
> Retrun error code instead of allways 0. Remove assigned-only
     ^ ur                       ^ extra "l"
> ret variable.
> 
> Signed-off-by: Paulina Szubarczyk <paulinaszubarczyk@xxxxxxxxx>

You have missed to Cc one of the maintainers of the code, Ian Jackson. 
Please either check the top-level MAINTAINERS file manually, or run 
scripts/get_maintainer.pl against the patches.

In general the patch LGTM, just a couple of comments.

> ---
>  tools/libxl/libxl_pci.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
> index dc10cb7..3435ce2 100644
> --- a/tools/libxl/libxl_pci.c
> +++ b/tools/libxl/libxl_pci.c
> @@ -84,13 +84,11 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t 
> domid,
>      flexarray_t *front = NULL;
>      flexarray_t *back = NULL;
>      libxl__device device;
> -    int ret = ERROR_NOMEM, i;
> +    int i;
>  
>      front = flexarray_make(gc, 16, 1);
>      back = flexarray_make(gc, 16, 1);
>  
> -    ret = 0;
> -
>      LOG(DEBUG, "Creating pci backend");
>
>      /* add pci device */

There's a call to libxl__device_from_pcidev here that returns a value 
(although it's always 0 right now). Either make that function return void, 
or check the return value for errors.

> @@ -108,12 +106,10 @@ int libxl__create_pci_backend(libxl__gc *gc, uint32_t 
> domid,
>      flexarray_append_pair(front, "backend-id", GCSPRINTF("%d", 0));
>      flexarray_append_pair(front, "state", GCSPRINTF("%d", 
> XenbusStateInitialising));
>  
> -    libxl__device_generic_add(gc, XBT_NULL, &device,
> +    return libxl__device_generic_add(gc, XBT_NULL, &device,
>                                libxl__xs_kvs_of_flexarray(gc, back, 
> back->count),
>                                libxl__xs_kvs_of_flexarray(gc, front, 
> front->count),
>                                NULL);

You should indent those line to match the start of the parentheses.

Roger.

_______________________________________________
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®.