提交 8af68ea4 编写于 作者: P Peter Krempa

qemu: hotplug: Reset device removal waiting code after vCPU unplug

If the delivery of the DEVICE_DELETED event for the vCPU being deleted
would time out, the code would not call 'qemuDomainResetDeviceRemoval'.

Since the waiting thread did not unregister itself prior to stopping the
waiting the monitor code would try to wake it up instead of dispatching
it to the event worker. As a result the unplug process would not be
completed and the definition would not be updated.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1428893
          https://bugzilla.redhat.com/show_bug.cgi?id=1427801
上级 d59ca120
...@@ -5355,6 +5355,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, ...@@ -5355,6 +5355,7 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver,
int oldvcpus = virDomainDefGetVcpus(vm->def); int oldvcpus = virDomainDefGetVcpus(vm->def);
unsigned int nvcpus = vcpupriv->vcpus; unsigned int nvcpus = vcpupriv->vcpus;
int rc; int rc;
int ret = -1;
if (!vcpupriv->alias) { if (!vcpupriv->alias) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
...@@ -5369,11 +5370,11 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, ...@@ -5369,11 +5370,11 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver,
rc = qemuMonitorDelDevice(qemuDomainGetMonitor(vm), vcpupriv->alias); rc = qemuMonitorDelDevice(qemuDomainGetMonitor(vm), vcpupriv->alias);
if (qemuDomainObjExitMonitor(driver, vm) < 0) if (qemuDomainObjExitMonitor(driver, vm) < 0)
return -1; goto cleanup;
if (rc < 0) { if (rc < 0) {
virDomainAuditVcpu(vm, oldvcpus, oldvcpus - nvcpus, "update", false); virDomainAuditVcpu(vm, oldvcpus, oldvcpus - nvcpus, "update", false);
return -1; goto cleanup;
} }
if ((rc = qemuDomainWaitForDeviceRemoval(vm)) <= 0) { if ((rc = qemuDomainWaitForDeviceRemoval(vm)) <= 0) {
...@@ -5381,10 +5382,17 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, ...@@ -5381,10 +5382,17 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver,
virReportError(VIR_ERR_OPERATION_FAILED, "%s", virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("vcpu unplug request timed out")); _("vcpu unplug request timed out"));
return -1; goto cleanup;
} }
return qemuDomainRemoveVcpu(driver, vm, vcpu); if (qemuDomainRemoveVcpu(driver, vm, vcpu) < 0)
goto cleanup;
ret = 0;
cleanup:
qemuDomainResetDeviceRemoval(vm);
return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册