diff options
author | Pavel Hrdina <phrdina@redhat.com> | 2020-08-07 15:48:27 +0200 |
---|---|---|
committer | Pavel Hrdina <phrdina@redhat.com> | 2020-08-08 11:07:02 +0200 |
commit | bd53831e6736d7f317b3c5e2a00b19ce15ee6a91 (patch) | |
tree | a60a6d10c7feae6ddf292f35d33bd1ac29902b2e /src/test | |
parent | 4b696beee31fb927b8f3d10df8145486e089b06c (diff) | |
download | libvirt-bd53831e6736d7f317b3c5e2a00b19ce15ee6a91.tar.gz |
conf: fix detection of available host CPUs for vcpupin
Commit <2020c6af8a8e4bb04acb629d089142be984484c8> fixed an issue with
QEMU driver by reporting offline CPUs as well. However, doing so it
introduced a regression into libxl and test drivers by completely
ignoring the passed `hostcpus` variable.
Move the virHostCPUGetAvailableCPUsBitmap() out of the helper into QEMU
driver so it will not affect other drivers which gets the number of host
CPUs differently.
This was uncovered by running libvirt-dbus test suite which counts on
the fact that test driver has hard-coded host definition and must not
depend on the host at all.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test_driver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 01c4675c30..a75c992af1 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -3072,6 +3072,7 @@ testDomainGetVcpuPinInfo(virDomainPtr dom, testDriverPtr driver = dom->conn->privateData; virDomainObjPtr privdom; virDomainDefPtr def; + g_autoptr(virBitmap) hostcpus = NULL; int ret = -1; if (!(privdom = testDomObjFromDomain(dom))) @@ -3080,9 +3081,12 @@ testDomainGetVcpuPinInfo(virDomainPtr dom, if (!(def = virDomainObjGetOneDef(privdom, flags))) goto cleanup; + if (!(hostcpus = virBitmapNew(VIR_NODEINFO_MAXCPUS(driver->nodeInfo)))) + goto cleanup; + virBitmapSetAll(hostcpus); + ret = virDomainDefGetVcpuPinInfoHelper(def, maplen, ncpumaps, cpumaps, - VIR_NODEINFO_MAXCPUS(driver->nodeInfo), - NULL); + hostcpus, NULL); cleanup: virDomainObjEndAPI(&privdom); |