[PATCH] test: snapshots: Fix some unused variables

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

 



Spotted by coverity as John mentioned here:
http://www.redhat.com/archives/libvir-list/2013-October/msg00078.html
---
 src/test/test_driver.c | 24 ++----------------------
 1 file changed, 2 insertions(+), 22 deletions(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 255cc2b..a09facb 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -6547,16 +6547,12 @@ testDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot,
 {
     virDomainObjPtr vm = NULL;
     int ret = -1;
-    virDomainSnapshotObjPtr snap = NULL;
 
     virCheckFlags(0, -1);
 
     if (!(vm = testDomObjFromSnapshot(snapshot)))
         goto cleanup;
 
-    if (!(snap = testSnapObjFromSnapshot(vm, snapshot)))
-        goto cleanup;
-
     ret = (vm->current_snapshot &&
            STREQ(snapshot->name, vm->current_snapshot->def->name));
 
@@ -6568,27 +6564,11 @@ cleanup:
 
 
 static int
-testDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
+testDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot ATTRIBUTE_UNUSED,
                               unsigned int flags)
 {
-    virDomainObjPtr vm = NULL;
-    int ret = -1;
-    virDomainSnapshotObjPtr snap = NULL;
-
     virCheckFlags(0, -1);
-
-    if (!(vm = testDomObjFromSnapshot(snapshot)))
-        goto cleanup;
-
-    if (!(snap = testSnapObjFromSnapshot(vm, snapshot)))
-        goto cleanup;
-
-    ret = 1;
-
-cleanup:
-    if (vm)
-        virObjectUnlock(vm);
-    return ret;
+    return 1;
 }
 
 static int
-- 
1.8.3.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]