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

[Xen-devel] [PATCH for 4.5] xl: Return proper error codes for block-attach and block-detach



Return proper error codes on failure so that scripts can tell whether
the command completed properly or not.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
CC: Ian Jackson <ian.jackson@xxxxxxxxxx>
CC: Wei Liu <wei.liu2@xxxxxxxxxx>
CC: Konrad Wilk <konrad.wilk@xxxxxxxxxx>

Release justification: This is a bug fix.  It's a fairly minor one,
but it's also a very simple one.
---
 tools/libxl/xl_cmdimpl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 3c9f146..b2abe4f 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -6383,6 +6383,7 @@ int main_blockattach(int argc, char **argv)
 
     if (libxl_device_disk_add(ctx, fe_domid, &disk, 0)) {
         fprintf(stderr, "libxl_device_disk_add failed.\n");
+        return 1;
     }
     return 0;
 }
@@ -6444,6 +6445,7 @@ int main_blockdetach(int argc, char **argv)
     rc = libxl_device_disk_remove(ctx, domid, &disk, 0);
     if (rc) {
         fprintf(stderr, "libxl_device_disk_remove failed.\n");
+        return 1;
     }
     libxl_device_disk_dispose(&disk);
     return rc;
-- 
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®.