From: Roger Pau Monne Date: Thu, 26 Jan 2012 17:38:05 +0000 (+0000) Subject: libxl: fix parse_backend_path and device_backend_path to be mutual X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6409d99bdfc542fa1fcc77475fc4d959252164bf;p=xen.git 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 Acked-by: Ian Jackson Committed-by: Ian Jackson --- 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//backend/// */ 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;