Commit 2fddb144 authored by Guido Trotter's avatar Guido Trotter
Browse files

Allow -soundhw option to kvm



For all of us that love to listen to music on our kvm virtual machines,
the -soundhw option is paramount.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 7f83345f
......@@ -830,6 +830,7 @@ HV_CPU_WEIGHT = "cpu_weight"
HV_CPU_CORES = "cpu_cores"
HV_CPU_THREADS = "cpu_threads"
HV_CPU_SOCKETS = "cpu_sockets"
HV_SOUNDHW = "soundhw"
HVS_PARAMETER_TYPES = {
......@@ -893,6 +894,7 @@ HVS_PARAMETER_TYPES = {
HV_CPU_CORES: VTYPE_INT,
HV_CPU_THREADS: VTYPE_INT,
HV_CPU_SOCKETS: VTYPE_INT,
HV_SOUNDHW: VTYPE_STRING,
}
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
......@@ -1960,6 +1962,7 @@ HVC_DEFAULTS = {
HV_CPU_CORES: 0,
HV_CPU_THREADS: 0,
HV_CPU_SOCKETS: 0,
HV_SOUNDHW: "",
},
HT_FAKE: {},
HT_CHROOT: {
......
......@@ -535,6 +535,7 @@ class KVMHypervisor(hv_base.BaseHypervisor):
constants.HV_CPU_CORES: hv_base.OPT_NONNEGATIVE_INT_CHECK,
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,
}
_MIGRATION_STATUS_RE = re.compile("Migration\s+status:\s+(\w+)",
......@@ -1334,6 +1335,10 @@ class KVMHypervisor(hv_base.BaseHypervisor):
if hvp[constants.HV_CPU_TYPE]:
kvm_cmd.extend(["-cpu", hvp[constants.HV_CPU_TYPE]])
# As requested by music lovers
if hvp[constants.HV_SOUNDHW]:
kvm_cmd.extend(["-soundhw", hvp[constants.HV_SOUNDHW]])
# 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
......
......@@ -649,6 +649,12 @@ cpu\_sockets
Number of emulated CPU sockets.
soundhw
Valid for the KVM hypervisor.
Comma separated list of emulated sounds cards, or "all" to enable
all the available ones.
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