[libvirt PATCH 3/3] qemu: consider available CPUs in iothread info output

Pavel Hrdina posted 3 patches 5 years, 6 months ago
[libvirt PATCH 3/3] qemu: consider available CPUs in iothread info output
Posted by Pavel Hrdina 5 years, 6 months ago
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>
---
 src/qemu/qemu_driver.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9eaea8d613..07e9518a9b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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;
             }
         }
-- 
2.26.2

Re: [libvirt PATCH 3/3] qemu: consider available CPUs in iothread info output
Posted by Daniel P. Berrangé 5 years, 6 months ago
On Fri, Aug 07, 2020 at 04:59:14PM +0200, Pavel Hrdina wrote:
> 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>
> ---
>  src/qemu/qemu_driver.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|