test: fix emulator pin info in test driver

Commit <6328da04285d9f65cb323d399f731c20caf63f5a> introduced
testDomainGetEmulatorPinInfo() into test driver but used
virHostCPUGetCount() function to get the number of host CPUs.

This would be correct for other drivers but in test driver we must not
depend on the host, we have to use hard-coded host representation that
we have in test driver.

Follows the logic of testDomainGetVcpuPinInfo().

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Pavel Hrdina 2020-08-07 15:57:28 +02:00
parent bd53831e67
commit 6a00352f67

View File

@ -2764,6 +2764,7 @@ testDomainGetEmulatorPinInfo(virDomainPtr dom,
int maplen,
unsigned int flags)
{
testDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm = NULL;
virDomainDefPtr def = NULL;
virBitmapPtr cpumask = NULL;
@ -2780,8 +2781,7 @@ testDomainGetEmulatorPinInfo(virDomainPtr dom,
if (!(def = virDomainObjGetOneDef(vm, flags)))
goto cleanup;
if ((hostcpus = virHostCPUGetCount()) < 0)
goto cleanup;
hostcpus = VIR_NODEINFO_MAXCPUS(driver->nodeInfo);
if (def->cputune.emulatorpin) {
cpumask = def->cputune.emulatorpin;