[libvirt] FYI: Fixed multiple test driver crashes/flaws

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

 



The virt-install test suite exposed a number of bugs in the test
driver storage APIs, partly due to my threading changes. There
was one deadlock (calling unneccessary PoolRefresh op), one
crash (deferencing a variable we just set to NULL), and integer
long long overflow on 32-bit, and missing return value

I've committed the following patch which fixes these and makes
virt=install test suite work again

Daniel

diff -u -p -r1.103 -r1.106
--- src/test.c	4 Dec 2008 21:00:50 -0000	1.103
+++ src/test.c	7 Dec 2008 20:45:28 -0000	1.106
@@ -191,7 +191,7 @@ static const char *defaultPoolXML =
 "  </target>"
 "</pool>";
 
-static const unsigned long long defaultPoolCap = (100 * 1024 * 1024 * 1024ul);
+static const unsigned long long defaultPoolCap = (100 * 1024 * 1024 * 1024ull);
 static const unsigned long long defaultPoolAlloc = 0;
 
 static int testStoragePoolObjSetDefaults(virStoragePoolObjPtr pool);
@@ -2323,9 +2323,6 @@ no_memory:
     return -1;
 }
 
-static int
-testStoragePoolRefresh(virStoragePoolPtr obj,
-                       unsigned int flags ATTRIBUTE_UNUSED);
 
 static int
 testStoragePoolStart(virStoragePoolPtr pool,
@@ -2350,8 +2347,6 @@ testStoragePoolStart(virStoragePoolPtr p
         goto cleanup;
     }
 
-    if (testStoragePoolRefresh(pool, 0) == 0)
-        goto cleanup;
     privpool->active = 1;
     ret = 0;
 
@@ -2506,6 +2501,7 @@ testStoragePoolBuild(virStoragePoolPtr p
                   _("storage pool '%s' is already active"), pool->name);
         goto cleanup;
     }
+    ret = 0;
 
 cleanup:
     if (privpool)
@@ -3001,10 +2997,10 @@ testStorageVolumeCreateXML(virStoragePoo
                                 privpool->def->allocation);
 
     privpool->volumes.objs[privpool->volumes.count++] = privvol;
-    privvol = NULL;
 
     ret = virGetStorageVol(pool->conn, privpool->def->name,
                            privvol->name, privvol->key);
+    privvol = NULL;
 
 cleanup:
     virStorageVolDefFree(privvol);


-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

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