1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-11 09:17:52 +03:00

qemu: qemuDomainSetVcpusAgent: re-check agent before calling it the again

With a very unfortunate timing, the agent might vanish before we do the
second call while the locks were down. Re-check that the agent is
available before attempting it again.
This commit is contained in:
Peter Krempa 2015-10-27 07:29:53 +01:00
parent da6620ffac
commit 2642a36db5

View File

@ -4881,6 +4881,9 @@ qemuDomainSetVcpusAgent(virDomainObjPtr vm,
if (qemuAgentUpdateCPUInfo(nvcpus, cpuinfo, ncpuinfo) < 0)
goto cleanup;
if (!qemuDomainAgentAvailable(vm, true))
goto cleanup;
qemuDomainObjEnterAgent(vm);
ret = qemuAgentSetVCPUs(qemuDomainGetAgent(vm), cpuinfo, ncpuinfo);
qemuDomainObjExitAgent(vm);