Commit e6f24d89 authored by Guido Trotter's avatar Guido Trotter
Browse files

kvm: Add kvm_extra parameter



As requested in Issue 261 and many other times.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 156681c1
......@@ -832,6 +832,7 @@ HV_CPU_THREADS = "cpu_threads"
HV_CPU_SOCKETS = "cpu_sockets"
HV_SOUNDHW = "soundhw"
HV_USB_DEVICES = "usb_devices"
HV_KVM_EXTRA = "kvm_extra"
HVS_PARAMETER_TYPES = {
......@@ -897,6 +898,7 @@ HVS_PARAMETER_TYPES = {
HV_CPU_SOCKETS: VTYPE_INT,
HV_SOUNDHW: VTYPE_STRING,
HV_USB_DEVICES: VTYPE_STRING,
HV_KVM_EXTRA: VTYPE_STRING,
}
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
......@@ -1966,6 +1968,7 @@ HVC_DEFAULTS = {
HV_CPU_SOCKETS: 0,
HV_SOUNDHW: "",
HV_USB_DEVICES: "",
HV_KVM_EXTRA: "",
},
HT_FAKE: {},
HT_CHROOT: {
......
......@@ -537,6 +537,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
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,
constants.HV_KVM_EXTRA: hv_base.NO_CHECK,
}
_MIGRATION_STATUS_RE = re.compile("Migration\s+status:\s+(\w+)",
......@@ -1345,6 +1346,9 @@ class KVMHypervisor(hv_base.BaseHypervisor):
for dev in hvp[constants.HV_USB_DEVICES].split(","):
kvm_cmd.extend(["-usbdevice", dev])
if hvp[constants.HV_KVM_EXTRA]:
kvm_cmd.extend([hvp[constants.HV_KVM_EXTRA]])
# 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
......
......@@ -663,6 +663,12 @@ usb\_devices
``-usbdevice`` option. See the **qemu**\(1) manpage for the syntax
of the possible components.
kvm\_extra
Valid for the KVM hypervisor.
Any other option to the KVM hypervisor, useful tweaking anything
that Ganeti doesn't support.
The ``-O (--os-parameters)`` option allows customisation of the OS
parameters. The actual parameter names and values depends on the OS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment