]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
qemu: qemuDomainSetVcpusAgent: re-check agent before calling it the again
authorPeter Krempa <pkrempa@redhat.com>
Tue, 27 Oct 2015 06:29:53 +0000 (07:29 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 9 Dec 2015 13:57:12 +0000 (14:57 +0100)
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.

src/qemu/qemu_driver.c

index 62f10543933f21a16d9e934d34d258400eafc72d..7a99ed244fa3fecc7d2ed0f243f889dfaa9fb58f 100644 (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);