提交 7a232286 编写于 作者: J Jie Wang 提交者: Michal Privoznik

qemu: Try harder to remove pr-helper object and kill pr-helper process

If libvirt receives DISCONNECTED event and prDaemonRunning is set
to false, and qemuDomainRemoveDiskDevice() is performing in the
meantime, then qemuDomainRemoveDiskDevice() will fail to remove
pr-helper object because prDaemonRunning is false. But removing
that check from qemuHotplugRemoveManagedPR() is not enough,
because after removing the object through monitor the
qemuProcessKillManagedPRDaemon() is called which contains the
same check. Thus the pr-helper process might be left behind.
Signed-off-by: NJie Wang <wangjie88@huawei.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 d5c5d615
...@@ -397,8 +397,7 @@ qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver, ...@@ -397,8 +397,7 @@ qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver,
virErrorPtr orig_err; virErrorPtr orig_err;
int ret = -1; int ret = -1;
if (!priv->prDaemonRunning || if (virDomainDefHasManagedPR(vm->def))
virDomainDefHasManagedPR(vm->def))
return 0; return 0;
virErrorPreserveLast(&orig_err); virErrorPreserveLast(&orig_err);
......
...@@ -2749,9 +2749,6 @@ qemuProcessKillManagedPRDaemon(virDomainObjPtr vm) ...@@ -2749,9 +2749,6 @@ qemuProcessKillManagedPRDaemon(virDomainObjPtr vm)
virErrorPtr orig_err; virErrorPtr orig_err;
char *pidfile; char *pidfile;
if (!priv->prDaemonRunning)
return;
if (!(pidfile = qemuProcessBuildPRHelperPidfilePath(vm))) { if (!(pidfile = qemuProcessBuildPRHelperPidfilePath(vm))) {
VIR_WARN("Unable to construct pr-helper pidfile path"); VIR_WARN("Unable to construct pr-helper pidfile path");
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册