[01/11] libxl_pci: improve return codes for more xl commands
diff mbox

Message ID 1459350170-9573-2-git-send-email-paulinaszubarczyk@gmail.com
State New, archived
Headers show

Commit Message

Paulina Szubarczyk March 30, 2016, 3:02 p.m. UTC
Return error code instead of always 0. Remove assigned-only
ret variable in libxl__create_pci_backend.

Signed-off-by: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>

CC:	Wei Liu <wei.liu2@citrix.com>
CC:	Ian Jackson <ian.jackson@eu.citrix.com>
CC: Dario Faggioli <dario.faggioli@citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_pci.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--
1.9.1

Patch
diff mbox

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)