WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxl: Accept disk name in libxl_devid_to

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: Accept disk name in libxl_devid_to_device_disk
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Tue, 28 Jun 2011 07:44:33 +0100
Delivery-date: Mon, 27 Jun 2011 23:51:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Marek Marczykowski <marmarek@xxxxxxxxxxxx>
# Date 1309192028 -3600
# Node ID 5d7998be22520ca9b1c0c3e6f881ca834deda299
# Parent  6656d80b4de4c8c5e04ef4c9569fbaf71bcb9e6e
libxl: Accept disk name in libxl_devid_to_device_disk

Accept disk name in xl block-detach.

Signed-off-by: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 6656d80b4de4 -r 5d7998be2252 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Mon Jun 27 17:24:50 2011 +0100
+++ b/tools/libxl/libxl_device.c        Mon Jun 27 17:27:08 2011 +0100
@@ -198,7 +198,8 @@
     return 1;
 }
 
-int libxl__device_disk_dev_number(char *virtpath, int *pdisk, int *ppartition)
+int libxl__device_disk_dev_number(const char *virtpath, int *pdisk,
+                                  int *ppartition)
 {
     int disk, partition;
     char *ep;
diff -r 6656d80b4de4 -r 5d7998be2252 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Mon Jun 27 17:24:50 2011 +0100
+++ b/tools/libxl/libxl_internal.h      Mon Jun 27 17:27:08 2011 +0100
@@ -207,7 +207,7 @@
 _hidden char *libxl__device_disk_string_of_format(libxl_disk_format format);
 
 _hidden int libxl__device_physdisk_major_minor(const char *physpath, int 
*major, int *minor);
-_hidden int libxl__device_disk_dev_number(char *virtpath,
+_hidden int libxl__device_disk_dev_number(const char *virtpath,
                                           int *pdisk, int *ppartition);
 
 _hidden int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
diff -r 6656d80b4de4 -r 5d7998be2252 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Mon Jun 27 17:24:50 2011 +0100
+++ b/tools/libxl/libxl_utils.c Mon Jun 27 17:27:08 2011 +0100
@@ -530,18 +530,18 @@
                                const char *devid, libxl_device_disk *disk)
 {
     libxl__gc gc = LIBXL_INIT_GC(ctx);
-    char *endptr, *val;
+    char *val;
     char *dompath, *diskpath, *be_path;
     unsigned int devid_n;
     int rc = ERROR_INVAL;
 
-    devid_n = strtoul(devid, &endptr, 10);
-    if (devid == endptr) {
+    devid_n = libxl__device_disk_dev_number(devid, NULL, NULL);
+    if (devid_n < 0) {
         goto out;
     }
     rc = ERROR_FAIL;
     dompath = libxl__xs_get_dompath(&gc, domid);
-    diskpath = libxl__sprintf(&gc, "%s/device/vbd/%s", dompath, devid);
+    diskpath = libxl__sprintf(&gc, "%s/device/vbd/%d", dompath, devid_n);
     if (!diskpath) {
         goto out;
     }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: Accept disk name in libxl_devid_to_device_disk, Xen patchbot-unstable <=