[PATCHv2 7/7] test: Add support for thread and core information for the test driver

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

 



This patch adds demo processor topology information for the test driver.
---
 src/test/test_driver.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 038f627..ddc4110 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -558,10 +558,16 @@ static int testOpenDefault(virConnectPtr conn) {
         privconn->cells[u].mem = (u + 1) * 2048 * 1024;
     }
     for (u = 0 ; u < 16 ; u++) {
-        privconn->cells[u % 2].cpus[(u / 2)].id = u;
-        privconn->cells[u % 2].cpus[(u / 2)].socket_id = -1;
-        privconn->cells[u % 2].cpus[(u / 2)].core_id = -1;
-        privconn->cells[u % 2].cpus[(u / 2)].siblings = NULL;
+        virBitmapPtr siblings = virBitmapNew(16);
+        if (!siblings) {
+            virReportOOMError();
+            goto error;
+        }
+        ignore_value(virBitmapSetBit(siblings, u));
+        privconn->cells[u / 8].cpus[(u % 8)].id = u;
+        privconn->cells[u / 8].cpus[(u % 8)].socket_id = u / 8;
+        privconn->cells[u / 8].cpus[(u % 8)].core_id = u % 8;
+        privconn->cells[u / 8].cpus[(u % 8)].siblings = siblings;
     }

     if (!(privconn->caps = testBuildCapabilities(conn)))
-- 
1.8.1.1

--
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]