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

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



Return error code instead of always 0. Remove assigned-only
ret variable in libxl__create_pci_backend.

Signed-off-by: Paulina Szubarczyk <paulinaszubarczyk@xxxxxxxxx>

CC:     Wei Liu <wei.liu2@xxxxxxxxxx>
CC:     Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
CC: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 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 */
@@ -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);
-
-    return 0;
 }

 static int libxl__device_pci_add_xenstore(libxl__gc *gc, uint32_t domid, 
libxl_device_pci *pcidev, int starting)
--
1.9.1

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