aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_device.c
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@entel.upc.edu>2012-01-26 17:38:05 +0000
committerRoger Pau Monne <roger.pau@entel.upc.edu>2012-01-26 17:38:05 +0000
commit6409d99bdfc542fa1fcc77475fc4d959252164bf (patch)
treed31e0529b5dc748989dbf728861c22079c09f311 /tools/libxl/libxl_device.c
parent647f63ae76eb020d53c0c328aeaae989e8b682ad (diff)
downloadxen-6409d99bdfc542fa1fcc77475fc4d959252164bf.tar.gz
xen-6409d99bdfc542fa1fcc77475fc4d959252164bf.tar.bz2
xen-6409d99bdfc542fa1fcc77475fc4d959252164bf.zip
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@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_device.c')
-rw-r--r--tools/libxl/libxl_device.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 5d05e90cb4..834375c7ea 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -46,12 +46,11 @@ int libxl__parse_backend_path(libxl__gc *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;