libxl: fix parse_backend_path and device_backend_path to be mutual
PATCH 1/1 libxl: fix parse_backend_path and device_backend_path to be mutual
# HG changeset patch
# User Roger Pau Monne <[email protected]>
# 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.
tools/libxl/libxl_device.c +3 -4
@@ -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 ;
Roger Pau Monne writes ("[Xen-devel] [PATCH] libxl: fix parse_backend_path and device_backend_path to be mutual"):
Quoted 1 line
libxl: fix
parse_backend_pathanddevice_backend_pathto be mutual