qemu: Forbid pinning vCPUs for TCG domain

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>
This commit is contained in:
Chen Hanxiao 2016-10-22 17:49:38 +08:00 committed by Martin Kletzander
parent dc67d00cd2
commit 8b035c84d8

View File

@ -5189,6 +5189,13 @@ qemuDomainPinVcpuFlags(virDomainPtr dom,
if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0) if (virDomainObjGetDefs(vm, flags, &def, &persistentDef) < 0)
goto endjob; 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 && if (persistentDef &&
!(vcpuinfo = virDomainDefGetVcpu(persistentDef, vcpu))) { !(vcpuinfo = virDomainDefGetVcpu(persistentDef, vcpu))) {
virReportError(VIR_ERR_INVALID_ARG, virReportError(VIR_ERR_INVALID_ARG,