- 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>
56 lines
1.9 KiB
Diff
56 lines
1.9 KiB
Diff
From e69e8b9da6483cb4646869e47d6b808a30f49be4 Mon Sep 17 00:00:00 2001
|
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
|
Date: Thu, 16 Mar 2023 02:54:16 +0000
|
|
Subject: [PATCH] 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.
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
|
|
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
|
|
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
|
|
|
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
|
|
(cherry-pick from 860a999802d3c82538373bb3f314f92a2e258754)
|
|
---
|
|
src/qemu/qemu_domain.c | 18 ++++++++++++++----
|
|
1 file changed, 14 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
|
index 70835e4efd..746adff3f1 100644
|
|
--- a/src/qemu/qemu_domain.c
|
|
+++ b/src/qemu/qemu_domain.c
|
|
@@ -2192,11 +2192,21 @@ void
|
|
qemuDomainObjStopWorker(virDomainObjPtr dom)
|
|
{
|
|
qemuDomainObjPrivatePtr priv = dom->privateData;
|
|
+ virEventThread *eventThread;
|
|
|
|
- if (priv->eventThread) {
|
|
- g_object_unref(priv->eventThread);
|
|
- priv->eventThread = NULL;
|
|
- }
|
|
+ if (!priv->eventThread)
|
|
+ return;
|
|
+
|
|
+ /*
|
|
+ * 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.
|
|
+ */
|
|
+ eventThread = g_steal_pointer(&priv->eventThread);
|
|
+ virObjectUnlock(dom);
|
|
+ g_object_unref(eventThread);
|
|
+ virObjectLock(dom);
|
|
}
|
|
|
|
|
|
--
|
|
2.27.0
|
|
|