Roger Pau Monne
2012-Jan-13 11:57 UTC
[PATCH] libxl: fix parse_backend_path and device_backend_path to be mutual
# HG changeset patch # User Roger Pau Monne <roger.pau@entel.upc.edu> # 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@entel.upc.edu> 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;
Ian Jackson
2012-Jan-26 17:38 UTC
Re: [PATCH] libxl: fix parse_backend_path and device_backend_path to be mutual
Roger Pau Monne writes ("[Xen-devel] [PATCH] libxl: fix parse_backend_path and device_backend_path to be mutual"):> libxl: fix parse_backend_path and device_backend_path to be mutualAcked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>