]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: consider available CPUs in iothread info output
authorPavel Hrdina <phrdina@redhat.com>
Fri, 7 Aug 2020 14:04:41 +0000 (16:04 +0200)
committerPavel Hrdina <phrdina@redhat.com>
Sat, 8 Aug 2020 09:07:17 +0000 (11:07 +0200)
Following the rationale from commit
<2020c6af8a8e4bb04acb629d089142be984484c8> we should do the same thing
for iothread info as well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_driver.c

index 9eaea8d61340da04943c1122bf13ff5144a15880..07e9518a9b44cbd287950be3a1ee37fb61ebb369 100644 (file)
@@ -5693,16 +5693,12 @@ qemuDomainGetIOThreadsConfig(virDomainDefPtr targetDef,
     virDomainIOThreadInfoPtr *info_ret = NULL;
     virBitmapPtr bitmap = NULL;
     virBitmapPtr cpumask = NULL;
-    int hostcpus;
     size_t i;
     int ret = -1;
 
     if (targetDef->niothreadids == 0)
         return 0;
 
-    if ((hostcpus = virHostCPUGetCount()) < 0)
-        goto cleanup;
-
     if (VIR_ALLOC_N(info_ret, targetDef->niothreadids) < 0)
         goto cleanup;
 
@@ -5718,9 +5714,8 @@ qemuDomainGetIOThreadsConfig(virDomainDefPtr targetDef,
             if (targetDef->cpumask) {
                 cpumask = targetDef->cpumask;
             } else {
-                if (!(bitmap = virBitmapNew(hostcpus)))
+                if (!(bitmap = virHostCPUGetAvailableCPUsBitmap()))
                     goto cleanup;
-                virBitmapSetAll(bitmap);
                 cpumask = bitmap;
             }
         }