aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGeorge Dunlap <george.dunlap@eu.citrix.com>2013-04-02 14:10:13 +0000
committerIan Jackson <Ian.Jackson@eu.citrix.com>2013-04-08 18:03:05 +0100
commitc3a2148192705592d38407ba9919eb1eb151a153 (patch)
treef85139af9c4e6c3d5fd8b90d98eeab087846d25c /tools
parentac16730d0339d41fd7d129a5cb2d40ed67a303d9 (diff)
downloadxen-c3a2148192705592d38407ba9919eb1eb151a153.tar.gz
xen-c3a2148192705592d38407ba9919eb1eb151a153.tar.bz2
xen-c3a2148192705592d38407ba9919eb1eb151a153.zip
xl: Accept a list for usbdevice in config file
Allow the "usbdevice" key to accept a list of USB devices, and pass them in using the new usbdevice_list domain build element. For backwards compatibility, still accept singleton values. Also update the xl.cfg manpage, adding information about how to pass through host devices. as applied: - Fix trailing whitespace and wrap some lines in xl_cmdimpl.c -iwj v2: - Add some verbiage to make it clear that "usb" is for emulated devices - Reference qemu manual for more usbdevice options Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/libxl/xl_cmdimpl.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 2d40f8f79c..61f7b96824 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1533,8 +1533,24 @@ skip_vfb:
xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
- xlu_cfg_replace_string (config, "usbdevice",
- &b_info->u.hvm.usbdevice, 0);
+ switch (xlu_cfg_get_list_as_string_list(config, "usbdevice",
+ &b_info->u.hvm.usbdevice_list,
+ 1))
+ {
+
+ case 0: break; /* Success */
+ case ESRCH: break; /* Option not present */
+ case EINVAL:
+ /* If it's not a valid list, try reading it as an atom,
+ * falling through to an error if it fails */
+ if (!xlu_cfg_replace_string(config, "usbdevice",
+ &b_info->u.hvm.usbdevice, 0))
+ break;
+ /* FALLTHRU */
+ default:
+ fprintf(stderr,"xl: Unable to parse usbdevice.\n");
+ exit(-ERROR_FAIL);
+ }
xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
xlu_cfg_get_defbool(config, "xen_platform_pci",
&b_info->u.hvm.xen_platform_pci, 0);