]> xenbits.xensource.com Git - libvirt.git/commitdiff
test: allocate numa cells separately from driver
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 19 May 2020 14:51:49 +0000 (15:51 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 3 Jun 2020 09:20:17 +0000 (10:20 +0100)
GObject has an arbitrary limit on the object struct size of 0xffff
bytes. It is expected that any large fields be separately allocated.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/test/test_driver.c

index 3a085003e2563a8a5415dc1eb9b3acfbc547a2b1..0dc91e157742befc26a3a6d6cabe53f429d8d2a3 100644 (file)
@@ -102,7 +102,7 @@ struct _testDriver {
     virStoragePoolObjListPtr pools;
     virNodeDeviceObjListPtr devs;
     int numCells;
-    testCell cells[MAX_CELLS];
+    testCell *cells;
     size_t numAuths;
     testAuthPtr auths;
 
@@ -171,6 +171,7 @@ testDriverDispose(void *obj)
         g_free(driver->auths[i].username);
         g_free(driver->auths[i].password);
     }
+    g_free(driver->cells);
     g_free(driver->auths);
 
     testDriverDisposed = true;
@@ -1353,6 +1354,7 @@ testOpenDefault(virConnectPtr conn)
 
     /* Numa setup */
     privconn->numCells = 2;
+    privconn->cells = g_new0(testCell, privconn->numCells);
     for (i = 0; i < privconn->numCells; i++) {
         privconn->cells[i].numCpus = 8;
         privconn->cells[i].mem = (i + 1) * 2048 * 1024;