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

[Xen-changelog] [xen-unstable] xl block-detach: allow other than numeric-decimal specification of the disk



# HG changeset patch
# User Jan Beulich <JBeulich@xxxxxxxx>
# Date 1331658669 0
# Node ID 6459346c03f54e101f5f9002d9058a95cc8a90d5
# Parent  02f4bbd949caa4b1d71cb9469b4ef0d6cd119c6d
xl block-detach: allow other than numeric-decimal specification of the disk

... to be in sync with block-attach.  And rename the function.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 02f4bbd949ca -r 6459346c03f5 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Mar 13 17:06:36 2012 +0000
+++ b/tools/libxl/libxl.c       Tue Mar 13 17:11:09 2012 +0000
@@ -1476,13 +1476,17 @@
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
 }
 
-int libxl_devid_to_device_disk(libxl_ctx *ctx, uint32_t domid,
-                               int devid, libxl_device_disk *disk)
+int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
+                              const char *vdev, libxl_device_disk *disk)
 {
     GC_INIT(ctx);
     char *dompath, *path;
+    int devid = libxl__device_disk_dev_number(vdev, NULL, NULL);
     int rc = ERROR_FAIL;
 
+    if (devid < 0)
+        return ERROR_INVAL;
+
     libxl_device_disk_init(disk);
 
     dompath = libxl__xs_get_dompath(gc, domid);
diff -r 02f4bbd949ca -r 6459346c03f5 tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h Tue Mar 13 17:06:36 2012 +0000
+++ b/tools/libxl/libxl_utils.h Tue Mar 13 17:11:09 2012 +0000
@@ -61,7 +61,7 @@
 int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid, int devid,
                               libxl_device_nic *nic);
 
-int libxl_devid_to_device_disk(libxl_ctx *ctx, uint32_t domid, int devid,
+int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid, const char *vdev,
                                libxl_device_disk *disk);
 
 int libxl_cpumap_alloc(libxl_ctx *ctx, libxl_cpumap *cpumap);
diff -r 02f4bbd949ca -r 6459346c03f5 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Mar 13 17:06:36 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Tue Mar 13 17:11:09 2012 +0000
@@ -4804,7 +4804,7 @@
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
-    if (libxl_devid_to_device_disk(ctx, domid, atoi(argv[optind+1]), &disk)) {
+    if (libxl_vdev_to_device_disk(ctx, domid, argv[optind+1], &disk)) {
         fprintf(stderr, "Error: Device %s not connected.\n", argv[optind+1]);
         return 1;
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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