diff options
Diffstat (limited to 'tools/libxl')
-rw-r--r-- | tools/libxl/libxl.h | 8 | ||||
-rw-r--r-- | tools/libxl/libxl_dm.c | 9 | ||||
-rw-r--r-- | tools/libxl/libxl_types.idl | 5 | ||||
-rw-r--r-- | tools/libxl/xl_cmdimpl.c | 14 |
4 files changed, 36 insertions, 0 deletions
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 37e4d82d3b..be19bf5186 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -82,6 +82,14 @@ #define LIBXL_HAVE_DOMAIN_NODEAFFINITY 1 /* + * LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE indicates that the + * libxl_vendor_device field is present in the hvm sections of + * libxl_domain_build_info. This field tells libxl which + * flavour of xen-pvdevice to enable in QEMU. + */ +#define LIBXL_HAVE_BUILDINFO_HVM_VENDOR_DEVICE 1 + +/* * libxl ABI compatibility * * The only guarantee which libxl makes regarding ABI compatibility diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 7e54c02a21..615dcf3945 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -647,6 +647,15 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc, flexarray_append(dm_args, "-drive"); flexarray_append(dm_args, drive); } + + switch (b_info->u.hvm.vendor_device) { + case LIBXL_VENDOR_DEVICE_XENSERVER: + flexarray_append(dm_args, "-device"); + flexarray_append(dm_args, "xen-pvdevice,device-id=0xc000"); + break; + default: + break; + } } flexarray_append(dm_args, NULL); return (char **) flexarray_contents(dm_args); diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index d218a2d3d1..85341a0331 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -132,6 +132,10 @@ libxl_vga_interface_type = Enumeration("vga_interface_type", [ (2, "STD"), ], init_val = 0) +libxl_vendor_device = Enumeration("vendor_device", [ + (0, "NONE"), + (1, "XENSERVER"), + ]) # # Complex libxl types # @@ -332,6 +336,7 @@ libxl_domain_build_info = Struct("domain_build_info",[ ("soundhw", string), ("xen_platform_pci", libxl_defbool), ("usbdevice_list", libxl_string_list), + ("vendor_device", libxl_vendor_device), ])), ("pv", Struct(None, [("kernel", string), ("slack_memkb", MemKB), diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 5bef969e92..884f050644 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1532,6 +1532,20 @@ skip_vfb: exit (1); } + + if (!xlu_cfg_get_string (config, "vendor_device", &buf, 0)) { + libxl_vendor_device d; + + e = libxl_vendor_device_from_string(buf, &d); + if (e) { + fprintf(stderr, + "xl: unknown vendor_device '%s'\n", + buf); + exit(-ERROR_FAIL); + } + + b_info->u.hvm.vendor_device = d; + } } xlu_cfg_destroy(config); |