debuggers.hg

changeset 22468:9ffd785319e0

tools/libxl: use qdisk if blktap2 is not available

Whenever blktap2 is not available use qdisk as block backend instead.

[ This feature will only work with the relevant changesets from
qemu-xen-unstable, recently applied. -iwj ]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
author Stefano Stabellini <stefano.stabellini@eu.citrix.com>
date Tue Nov 23 19:23:22 2010 +0000 (2010-11-23)
parents 91143941c492
children b609b1b983d6
files tools/libxl/libxl.c tools/libxl/libxl_device.c tools/libxl/libxl_internal.h
line diff
     1.1 --- a/tools/libxl/libxl.c	Tue Nov 23 19:21:22 2010 +0000
     1.2 +++ b/tools/libxl/libxl.c	Tue Nov 23 19:23:22 2010 +0000
     1.3 @@ -1856,7 +1856,10 @@ int libxl_device_disk_add(libxl_ctx *ctx
     1.4              flexarray_set(back, boffset++, libxl__sprintf(&gc, "%s:%s",
     1.5                            libxl__device_disk_string_of_phystype(disk->phystype), disk->physpath));
     1.6  
     1.7 -            device.backend_kind = DEVICE_TAP;
     1.8 +            if (libxl__blktap_enabled(&gc))
     1.9 +                device.backend_kind = DEVICE_TAP;
    1.10 +            else
    1.11 +                device.backend_kind = DEVICE_QDISK;
    1.12              break;
    1.13  
    1.14          default:
     2.1 --- a/tools/libxl/libxl_device.c	Tue Nov 23 19:21:22 2010 +0000
     2.2 +++ b/tools/libxl/libxl_device.c	Tue Nov 23 19:23:22 2010 +0000
     2.3 @@ -33,6 +33,7 @@ static const char *string_of_kinds[] = {
     2.4      [DEVICE_VIF2] = "vif2",
     2.5      [DEVICE_VBD] = "vbd",
     2.6      [DEVICE_TAP] = "tap",
     2.7 +    [DEVICE_QDISK] = "qdisk",
     2.8      [DEVICE_PCI] = "pci",
     2.9      [DEVICE_VFB] = "vfb",
    2.10      [DEVICE_VKBD] = "vkbd",
     3.1 --- a/tools/libxl/libxl_internal.h	Tue Nov 23 19:21:22 2010 +0000
     3.2 +++ b/tools/libxl/libxl_internal.h	Tue Nov 23 19:23:22 2010 +0000
     3.3 @@ -82,6 +82,7 @@ typedef enum {
     3.4      DEVICE_VIF2,
     3.5      DEVICE_VBD,
     3.6      DEVICE_TAP,
     3.7 +    DEVICE_QDISK,
     3.8      DEVICE_PCI,
     3.9      DEVICE_VFB,
    3.10      DEVICE_VKBD,