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: libxl_devid_to_* should take an in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: libxl_devid_to_* should take an integer device id
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Tue, 01 Nov 2011 23:55:14 +0000
Delivery-date: Tue, 01 Nov 2011 16:56:34 -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 Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1318941402 -3600
# Node ID 90b21171c8c0e25ff7d1648dcd55c7e806b88e11
# Parent  a0af8f2ccb7e8c9e36ca6352c3b7f8e3f4bc557b
libxl: libxl_devid_to_* should take an integer device id

Currently takes a string.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---


diff -r a0af8f2ccb7e -r 90b21171c8c0 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Oct 18 13:36:42 2011 +0100
+++ b/tools/libxl/libxl.c       Tue Oct 18 13:36:42 2011 +0100
@@ -1333,7 +1333,7 @@
 }
 
 int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
-                              const char *devid, libxl_device_nic *nic)
+                              int devid, libxl_device_nic *nic)
 {
     libxl__gc gc = LIBXL_INIT_GC(ctx);
     char *dompath, *path;
@@ -1345,7 +1345,7 @@
         goto out;
 
     path = libxl__xs_read(&gc, XBT_NULL,
-                          libxl__sprintf(&gc, "%s/device/vif/%s/backend",
+                          libxl__sprintf(&gc, "%s/device/vif/%d/backend",
                                          dompath, devid));
     if (!path)
         goto out;
@@ -1657,7 +1657,7 @@
 }
 
 int libxl_devid_to_device_disk(libxl_ctx *ctx, uint32_t domid,
-                               const char *devid, libxl_device_disk *disk)
+                               int devid, libxl_device_disk *disk)
 {
     libxl__gc gc = LIBXL_INIT_GC(ctx);
     char *dompath, *path;
@@ -1669,7 +1669,7 @@
         goto out;
     }
     path = libxl__xs_read(&gc, XBT_NULL,
-                          libxl__sprintf(&gc, "%s/device/vbd/%s/backend",
+                          libxl__sprintf(&gc, "%s/device/vbd/%d/backend",
                                          dompath, devid));
     if (!path)
         goto out;
diff -r a0af8f2ccb7e -r 90b21171c8c0 tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h Tue Oct 18 13:36:42 2011 +0100
+++ b/tools/libxl/libxl_utils.h Tue Oct 18 13:36:42 2011 +0100
@@ -60,11 +60,11 @@
 
 int libxl_mac_to_device_nic(libxl_ctx *ctx, uint32_t domid,
                             const char *mac, libxl_device_nic *nic);
-int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid,
-                              const char *devid, libxl_device_nic *nic);
+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,
-                               const char *devid, libxl_device_disk *disk);
+int libxl_devid_to_device_disk(libxl_ctx *ctx, uint32_t domid, int devid,
+                               libxl_device_disk *disk);
 
 int libxl_cpumap_alloc(libxl_ctx *ctx, libxl_cpumap *cpumap);
 int libxl_cpumap_test(libxl_cpumap *cpumap, int cpu);
diff -r a0af8f2ccb7e -r 90b21171c8c0 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Oct 18 13:36:42 2011 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Tue Oct 18 13:36:42 2011 +0100
@@ -4077,7 +4077,7 @@
     }
 
     if (!strchr(argv[optind+1], ':')) {
-        if (libxl_devid_to_device_nic(ctx, domid, argv[optind+1], &nic)) {
+        if (libxl_devid_to_device_nic(ctx, domid, atoi(argv[optind+1]), &nic)) 
{
             fprintf(stderr, "Unknown device %s.\n", argv[optind+1]);
             return 1;
         }
@@ -4178,7 +4178,7 @@
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
-    if (libxl_devid_to_device_disk(ctx, domid, argv[optind+1], &disk)) {
+    if (libxl_devid_to_device_disk(ctx, domid, atoi(argv[optind+1]), &disk)) {
         fprintf(stderr, "Error: Device %s not connected.\n", argv[optind+1]);
         return 1;
     }

_______________________________________________
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: libxl_devid_to_* should take an integer device id, Xen patchbot-unstable <=