All in one go, comma separated usb devices of all types.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
HV_CPU_THREADS = "cpu_threads"
HV_CPU_SOCKETS = "cpu_sockets"
HV_SOUNDHW = "soundhw"
+HV_USB_DEVICES = "usb_devices"
HVS_PARAMETER_TYPES = {
HV_CPU_THREADS: VTYPE_INT,
HV_CPU_SOCKETS: VTYPE_INT,
HV_SOUNDHW: VTYPE_STRING,
+ HV_USB_DEVICES: VTYPE_STRING,
}
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
HV_CPU_THREADS: 0,
HV_CPU_SOCKETS: 0,
HV_SOUNDHW: "",
+ HV_USB_DEVICES: "",
},
HT_FAKE: {},
HT_CHROOT: {
constants.HV_CPU_THREADS: hv_base.OPT_NONNEGATIVE_INT_CHECK,
constants.HV_CPU_SOCKETS: hv_base.OPT_NONNEGATIVE_INT_CHECK,
constants.HV_SOUNDHW: hv_base.NO_CHECK,
+ constants.HV_USB_DEVICES: hv_base.NO_CHECK,
}
_MIGRATION_STATUS_RE = re.compile("Migration\s+status:\s+(\w+)",
if hvp[constants.HV_SOUNDHW]:
kvm_cmd.extend(["-soundhw", hvp[constants.HV_SOUNDHW]])
+ # Various types of usb devices, comma separated
+ if hvp[constants.HV_USB_DEVICES]:
+ for dev in hvp[constants.HV_USB_DEVICES].split(","):
+ kvm_cmd.extend(["-usbdevice", dev])
+
# Save the current instance nics, but defer their expansion as parameters,
# as we'll need to generate executable temp files for them.
kvm_nics = instance.nics
Comma separated list of emulated sounds cards, or "all" to enable
all the available ones.
+usb\_devices
+ Valid for the KVM hypervisor.
+
+ Comma separated list of usb devices. These can be emulated devices
+ or passthrough ones, and each one gets passed to kvm with its own
+ ``-usbdevice`` option. See the **qemu**\(1) manpage for the syntax
+ of the possible components.
+
The ``-O (--os-parameters)`` option allows customisation of the OS
parameters. The actual parameter names and values depends on the OS