]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_hotplug: Resolve DEADCODE coverity error
authorJohn Ferlan <jferlan@redhat.com>
Sat, 31 Aug 2013 11:06:38 +0000 (07:06 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Sun, 1 Sep 2013 23:30:59 +0000 (19:30 -0400)
Remove unused 'cgroup' variable in qemuDomainAttachDeviceDiskLive() to
resolve coverity DEADCODE complaint

src/qemu/qemu_hotplug.c

index 9c655fff1cad9c66539a732d8ce7bcfc8765ca60..6cdee4403fe1a09ffb8faefa16f357b1ac46e361 100644 (file)
@@ -683,7 +683,6 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
     virDomainDiskDefPtr orig_disk = NULL;
     virDomainDeviceDefPtr dev_copy = NULL;
     virDomainDiskDefPtr tmp = NULL;
-    virCgroupPtr cgroup = NULL;
     virCapsPtr caps = NULL;
     int ret = -1;
 
@@ -773,10 +772,10 @@ qemuDomainAttachDeviceDiskLive(virConnectPtr conn,
         break;
     }
 
-    if (ret != 0 && cgroup) {
-        if (qemuTeardownDiskCgroup(vm, disk) < 0)
-            VIR_WARN("Failed to teardown cgroup for disk path %s",
-                     NULLSTR(disk->src));
+    if (ret != 0 &&
+        qemuTeardownDiskCgroup(vm, disk) < 0) {
+        VIR_WARN("Failed to teardown cgroup for disk path %s",
+                 NULLSTR(disk->src));
     }
 
 end: