aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-02-05 10:35:57 +0000
committerKeir Fraser <keir.fraser@citrix.com>2010-02-05 10:35:57 +0000
commit10d13f8ac61c6ae61559837300f1382eb3bd088d (patch)
tree69fa817c272ceef21490f642abe6decdb4ab21da
parentaf43e76ed68566dbceedefaac89924070842edec (diff)
downloadxen-10d13f8ac61c6ae61559837300f1382eb3bd088d.tar.gz
xen-10d13f8ac61c6ae61559837300f1382eb3bd088d.tar.bz2
xen-10d13f8ac61c6ae61559837300f1382eb3bd088d.zip
libxl: notice if vbd virt device specifier ("path") unrecognised
Previously, specifying a virtual device string the vbd that couldn't be parsed would result in attempting to actually create the device with vbd number -1 ! Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--tools/libxl/libxl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 1689705547..0b1b6dba31 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1112,6 +1112,11 @@ int libxl_device_disk_add(struct libxl_ctx *ctx, uint32_t domid, libxl_device_di
backend_type = device_disk_backend_type_of_phystype(disk->phystype);
devid = device_disk_dev_number(disk->virtpath);
+ if (devid==-1) {
+ XL_LOG(ctx, XL_LOG_ERROR, "Invalid or unuspported"
+ " virtual disk identifier %s", disk->virtpath);
+ return ERROR_INVAL;
+ }
device.backend_devid = devid;
device.backend_domid = disk->backend_domid;