]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Forbid pinning vCPUs for TCG domain
authorChen Hanxiao <chenhanxiao@gmail.com>
Sat, 22 Oct 2016 09:49:38 +0000 (17:49 +0800)
committerMartin Kletzander <mkletzan@redhat.com>
Thu, 27 Oct 2016 13:21:03 +0000 (15:21 +0200)
We don't support cpu pinning for TCG domains because QEMU runs them in
one thread only.  But vcpupin command was able to set them, which
resulted in a failed startup, so make sure that doesn't happen.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
src/qemu/qemu_driver.c

index 3f57a9fee0b9d38cb653fec55013844831882f12..817c567836d83924f2621e085a4b7f046c361651 100644 (file)
@@ -5189,6 +5189,13 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
     if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0)
         goto endjob;
 
+    if ((def && def->virtType == VIR_DOMAIN_VIRT_QEMU) ||
+        (persistentDef && persistentDef->virtType == VIR_DOMAIN_VIRT_QEMU)) {
+        virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+                       _("Virt type 'qemu' does not support vCPU pinning"));
+        goto endjob;
+    }
+
     if (persistentDef &&
         !(vcpuinfo = virDomainDefGetVcpu(persistentDef, vcpu))) {
         virReportError(VIR_ERR_INVALID_ARG,