- remote: fix double free of migration params on error - qemu: avoid deadlock in qemuDomainObjStopWorker We are dropping the only reference here so that the event loop thread is going to be exited synchronously. In order to avoid deadlocks we need to unlock the VM so that any handler being called can finish execution and thus even loop thread be finished too. - virsh: add tmm main command word Add tmm command word into virsh tool to call get tmm memory info API. It makes virsh can use tmm main commmand to show tmm memory info on console. This command requires specific kernel and a kernel driver to make sure its regular function. If runnning environment missing the above reliance, this command will show error result on console. - libvirt: add get tmm memory info API and libvirtd RPC Add the get tmm memory info API into libvirt-host. Also should add the RPC calls into libvirtd for API calling. - libvirt: support the virtCCA feature Add cvm parameter into the type of LaunchSecurity which is a optional filed for libvirt xml. Its purpose is to pass the cvm parameter through to qemu. Also this patch support virsh edit to save cvm parameter into libvirt temporary xml. - qemu_driver: Add calc_mode for dirtyrate statistics - virsh: Add mode option to domdirtyrate-calc virsh api - qemu: Generate command line for dirty-ring-size - qemu: support dirty ring feature - conf: Turn virDomainDef.kvm_features into a struct - qemu_validate: Allow kvm hint-dedicated on non-passthrough VMs - virDomainFeaturesKVMDefParse: Remove tautological "if" - virDomainFeaturesKVMDefParse: Remove tautological "switch" - virxml: Add virXMLPropUInt - virxml: Add virXMLPropInt - virxml: Add virXMLPropTristateSwitch - virxml: Add virXMLPropTristateBool - virDomainFeaturesKVMDefParse: Remove ctxt - virDomainFeaturesDefParse: Factor out KVM parsing into separate function - internal.h: Introduce and use VIR_IS_POW2() - hotpatch: if hotpatch_path not in qemu.conf,the hotpatch doesn't antoload Signed-off-by: Jiabo Feng <fengjiabo1@huawei.com>
70 lines
2.6 KiB
Diff
70 lines
2.6 KiB
Diff
From 956a277c82699de93d53444a4c8bf451108b501b Mon Sep 17 00:00:00 2001
|
|
From: Tim Wiederhake <twiederh@redhat.com>
|
|
Date: Tue, 22 Jun 2021 14:22:48 +0200
|
|
Subject: [PATCH] virDomainFeaturesKVMDefParse: Remove tautological "switch"
|
|
|
|
`feature` is always one of the values listed in the switch,
|
|
ensured by `virDomainKVMTypeFromString` above.
|
|
|
|
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
|
|
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
|
Reviewed-by: Shaokun Wei <weishaokun@kylinos.cn>
|
|
---
|
|
src/conf/domain_conf.c | 32 ++++----------------------------
|
|
1 file changed, 4 insertions(+), 28 deletions(-)
|
|
|
|
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
index 9073db8541..dca49b6a55 100644
|
|
--- a/src/conf/domain_conf.c
|
|
+++ b/src/conf/domain_conf.c
|
|
@@ -20596,8 +20596,6 @@ static int
|
|
virDomainFeaturesKVMDefParse(virDomainDef *def,
|
|
xmlNodePtr node)
|
|
{
|
|
- g_autofree char *tmp = NULL;
|
|
-
|
|
def->features[VIR_DOMAIN_FEATURE_KVM] = VIR_TRISTATE_SWITCH_ON;
|
|
|
|
if (def->features[VIR_DOMAIN_FEATURE_KVM] == VIR_TRISTATE_SWITCH_ON) {
|
|
@@ -20614,33 +20612,11 @@ virDomainFeaturesKVMDefParse(virDomainDef *def,
|
|
return -1;
|
|
}
|
|
|
|
- switch ((virDomainKVM) feature) {
|
|
- case VIR_DOMAIN_KVM_HIDDEN:
|
|
- case VIR_DOMAIN_KVM_DEDICATED:
|
|
- if (!(tmp = virXMLPropString(node, "state"))) {
|
|
- virReportError(VIR_ERR_XML_ERROR,
|
|
- _("missing 'state' attribute for "
|
|
- "KVM feature '%s'"),
|
|
- node->name);
|
|
- return -1;
|
|
- }
|
|
-
|
|
- if ((value = virTristateSwitchTypeFromString(tmp)) < 0) {
|
|
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
- _("invalid value of state argument "
|
|
- "for KVM feature '%s'"),
|
|
- node->name);
|
|
- return -1;
|
|
- }
|
|
-
|
|
- VIR_FREE(tmp);
|
|
- def->kvm_features[feature] = value;
|
|
- break;
|
|
+ if (virXMLPropTristateSwitch(node, "state", VIR_XML_PROP_REQUIRED,
|
|
+ &value) < 0)
|
|
+ return -1;
|
|
|
|
- /* coverity[dead_error_begin] */
|
|
- case VIR_DOMAIN_KVM_LAST:
|
|
- break;
|
|
- }
|
|
+ def->kvm_features[feature] = value;
|
|
|
|
node = xmlNextElementSibling(node);
|
|
}
|
|
--
|
|
2.27.0
|
|
|