Ian Campbell
2011-Sep-21 13:56 UTC
[Xen-devel] [PATCH] libxl: fail to parse disk vpath if a disk+part number is required but unavailable
# HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1316609964 -3600 # Node ID 1b2f4f3c9f696270ba7e3c079b29536a39153956 # Parent 4a6d34dffcf9d568a7830ee6de07a581c57e7342 libxl: fail to parse disk vpath if a disk+part number is required but unavailable libxl__device_disk_dev_number() can parse a virtpath which is an encoded unsigned long but does not set *pdisk or *ppartition in that case. Ideally we would parse the number but for now simply fail to prevent cascading failures. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> diff -r 4a6d34dffcf9 -r 1b2f4f3c9f69 tools/libxl/libxl_device.c --- a/tools/libxl/libxl_device.c Wed Sep 21 13:59:24 2011 +0100 +++ b/tools/libxl/libxl_device.c Wed Sep 21 13:59:24 2011 +0100 @@ -341,8 +341,12 @@ int libxl__device_disk_dev_number(const errno = 0; ul = strtoul(virtpath, &ep, 0); - if (!errno && !*ep && ul <= INT_MAX) + if (!errno && !*ep && ul <= INT_MAX) { + /* FIXME: should parse ul to determine these. */ + if (pdisk || ppartition) + return -1; return ul; + } if (device_virtdisk_matches(virtpath, "hd", &disk, 3, _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Sep-28 15:31 UTC
Re: [Xen-devel] [PATCH] libxl: fail to parse disk vpath if a disk+part number is required but unavailable
Ian Campbell writes ("[Xen-devel] [PATCH] libxl: fail to parse disk vpath if a disk+part number is required but unavailable"):> libxl: fail to parse disk vpath if a disk+part number is required but unavailableAcked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel