[PATCH 04/34] qemu: don't iterate vcpus using priv->nvcpupids in qemuProcessSetSchedParams

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This should be the last offender.
---
 src/qemu/qemu_process.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 845d5e1..dec4572 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2350,10 +2350,14 @@ qemuProcessSetSchedParams(int id,
 static int
 qemuProcessSetSchedulers(virDomainObjPtr vm)
 {
-    qemuDomainObjPrivatePtr priv = vm->privateData;
     size_t i = 0;

-    for (i = 0; i < priv->nvcpupids; i++) {
+    for (i = 0; i < virDomainDefGetVcpusMax(vm->def); i++) {
+        virDomainVcpuInfoPtr vcpu = virDomainDefGetVcpu(vm->def, i);
+
+        if (!vcpu->online)
+            continue;
+
         if (qemuProcessSetSchedParams(i, qemuDomainGetVcpuPid(vm, i),
                                       vm->def->cputune.nvcpusched,
                                       vm->def->cputune.vcpusched) < 0)
-- 
2.6.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]