Commit 7ba594c0 authored by Guido Trotter's avatar Guido Trotter
Browse files

kvm_flag hypervisor parameter


Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent cef34868
......@@ -429,6 +429,7 @@ HV_USE_LOCALTIME = "use_localtime"
HV_DISK_CACHE = "disk_cache"
HV_SECURITY_MODEL = "security_model"
HV_SECURITY_DOMAIN = "security_domain"
HV_KVM_FLAG = "kvm_flag"
HVS_PARAMETER_TYPES = {
HV_BOOT_ORDER: VTYPE_STRING,
......@@ -458,6 +459,7 @@ HVS_PARAMETER_TYPES = {
HV_DISK_CACHE: VTYPE_STRING,
HV_SECURITY_MODEL: VTYPE_STRING,
HV_SECURITY_DOMAIN: VTYPE_STRING,
HV_KVM_FLAG: VTYPE_STRING,
}
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
......@@ -566,6 +568,12 @@ HT_SM_POOL = "pool"
HT_KVM_VALID_SM_TYPES = frozenset([HT_SM_NONE, HT_SM_USER, HT_SM_POOL])
# Kvm flag values
HT_KVM_ENABLED = "enabled"
HT_KVM_DISABLED = "disabled"
HT_KVM_FLAG_VALUES = frozenset([HT_KVM_ENABLED, HT_KVM_DISABLED])
# Cluster Verify steps
VERIFY_NPLUSONE_MEM = 'nplusone_mem'
VERIFY_OPTIONAL_CHECKS = frozenset([VERIFY_NPLUSONE_MEM])
......@@ -712,6 +720,7 @@ HVC_DEFAULTS = {
HV_DISK_CACHE: HT_CACHE_DEFAULT,
HV_SECURITY_MODEL: HT_SM_NONE,
HV_SECURITY_DOMAIN: '',
HV_KVM_FLAG: "",
},
HT_FAKE: {
},
......
......@@ -80,6 +80,8 @@ class KVMHypervisor(hv_base.BaseHypervisor):
constants.HV_SECURITY_MODEL:
hv_base.ParamInSet(True, constants.HT_KVM_VALID_SM_TYPES),
constants.HV_SECURITY_DOMAIN: hv_base.NO_CHECK,
constants.HV_KVM_FLAG:
hv_base.ParamInSet(False, constants.HT_KVM_FLAG_VALUES),
}
_MIGRATION_STATUS_RE = re.compile('Migration\s+status:\s+(\w+)',
......@@ -366,6 +368,11 @@ class KVMHypervisor(hv_base.BaseHypervisor):
boot_cdrom = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_CDROM
boot_network = hvp[constants.HV_BOOT_ORDER] == constants.HT_BO_NETWORK
if hvp[constants.HV_KVM_FLAG] == constants.HT_KVM_ENABLED:
kvm_cmd.extend(["-enable-kvm"])
elif hvp[constants.HV_KVM_FLAG] == constants.HT_KVM_DISABLED:
kvm_cmd.extend(["-disable-kvm"])
if boot_network:
kvm_cmd.extend(['-boot', 'n'])
......
......@@ -644,6 +644,20 @@
</listitem>
</varlistentry>
<varlistentry>
<term>kvm_flag</term>
<listitem>
<simpara>Valid for the KVM hypervisor.</simpara>
<simpara>If <quote>enabled</quote> the -enable-kvm flag is
passed to kvm. If <quote>disabled</quote> -disable-kvm is
passed. If unset no flag is passed, and the default running
mode for your kvm binary will be used.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
......
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