]> xenbits.xensource.com Git - libvirt.git/commitdiff
test: Add support for thread and core information for the test driver
authorPeter Krempa <pkrempa@redhat.com>
Tue, 22 Jan 2013 21:18:19 +0000 (22:18 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 24 Jan 2013 10:11:02 +0000 (11:11 +0100)
This patch adds demo processor topology information for the test driver.

src/test/test_driver.c

index 6909fa46fac2cea136249aa6a060b92141bf50aa..ddc4110e28654427ff8009ce37579fcc2cd307e0 100644 (file)
@@ -558,7 +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;
+        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)))