From 6a00352f67cacf12951a78666038179e1683f0df Mon Sep 17 00:00:00 2001 From: Pavel Hrdina Date: Fri, 7 Aug 2020 15:57:28 +0200 Subject: [PATCH] test: fix emulator pin info in test driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Daniel P. Berrangé --- src/test/test_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a75c992af1..d582c207f4 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -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; -- 2.47.2