debuggers.hg

changeset 20947:503b47f53b53

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>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Feb 05 10:35:57 2010 +0000 (2010-02-05)
parents 7b751b0e6f1b
children bdce1894c6a7
files tools/libxl/libxl.c
line diff
     1.1 --- a/tools/libxl/libxl.c	Thu Feb 04 19:40:19 2010 +0000
     1.2 +++ b/tools/libxl/libxl.c	Fri Feb 05 10:35:57 2010 +0000
     1.3 @@ -1112,6 +1112,11 @@ int libxl_device_disk_add(struct libxl_c
     1.4  
     1.5      backend_type = device_disk_backend_type_of_phystype(disk->phystype);
     1.6      devid = device_disk_dev_number(disk->virtpath);
     1.7 +    if (devid==-1) {
     1.8 +        XL_LOG(ctx, XL_LOG_ERROR, "Invalid or unuspported"
     1.9 +               " virtual disk identifier %s", disk->virtpath);
    1.10 +        return ERROR_INVAL;
    1.11 +    }
    1.12  
    1.13      device.backend_devid = devid;
    1.14      device.backend_domid = disk->backend_domid;