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

[Xen-devel] [PATCH] libxl: fix parse_backend_path and device_backend_path to be mutual



# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
# Date 1326454799 -3600
# Node ID 58c924a72ab7af658a888ff39411229a9e6a12f6
# Parent  887a3229fd7a50c04981e29709bc7210dafef38f
libxl: fix parse_backend_path and device_backend_path to be mutual

Currently if libxl__parse_backend_path is used and then you try to get
the original path again with libxl__device_backend_path the
result is wrong. This patch fixes the issue, so transformation from
path to libxl__device and back is reciprocal.

Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>

diff -r 887a3229fd7a -r 58c924a72ab7 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Fri Jan 13 12:39:45 2012 +0100
+++ b/tools/libxl/libxl_device.c        Fri Jan 13 12:39:59 2012 +0100
@@ -54,12 +54,11 @@ int libxl__parse_backend_path(libxl__gc 
 {
     /* /local/domain/<domid>/backend/<kind>/<domid>/<devid> */
     char strkind[16]; /* Longest is actually "console" */
-    uint32_t domain;
-    int rc = sscanf(path, "/local/domain/%d/backend/%15[^/]/%d/%d",
+    int rc = sscanf(path, "/local/domain/%d/backend/%15[^/]/%u/%d",
                     &dev->backend_domid,
                     strkind,
-                    &domain,
-                    &dev->backend_devid);
+                    &dev->domid,
+                    &dev->devid);
 
     if (rc != 4)
         return ERROR_FAIL;

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


 


Rackspace

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