Blob Blame History Raw
From 56df0b93d70c961aab2216eaf587a57a87a3faf4 Mon Sep 17 00:00:00 2001
Message-Id: <56df0b93d70c961aab2216eaf587a57a87a3faf4@dist-git>
From: John Ferlan <jferlan@redhat.com>
Date: Mon, 6 Oct 2014 11:14:33 -0400
Subject: [PATCH] qemu: Remove need for virConnectPtr in hotunplug detach host,
 net

https://bugzilla.redhat.com/show_bug.cgi?id=1141732

Prior patch removed the need for the virConnectPtr in the unplug
detach host path which caused ripple effect to remove in multiple
callers.  The previous patch just left things as ATTRIBUTE_UNUSED -
this patch will remove the variable.

(cherry picked from commit 99186c4103cf1e035fed1de6baa575edac9ed53a)
Signed-off-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/qemu/qemu_driver.c  |  4 ++--
 src/qemu/qemu_hotplug.c | 20 ++++++++------------
 src/qemu/qemu_hotplug.h |  6 ++----
 3 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9586c43..4c57fcd 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6804,10 +6804,10 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
         ret = qemuDomainDetachLease(driver, vm, dev->data.lease);
         break;
     case VIR_DOMAIN_DEVICE_NET:
-        ret = qemuDomainDetachNetDevice(dom->conn, driver, vm, dev);
+        ret = qemuDomainDetachNetDevice(driver, vm, dev);
         break;
     case VIR_DOMAIN_DEVICE_HOSTDEV:
-        ret = qemuDomainDetachHostDevice(dom->conn, driver, vm, dev);
+        ret = qemuDomainDetachHostDevice(driver, vm, dev);
         break;
     case VIR_DOMAIN_DEVICE_CHR:
         ret = qemuDomainDetachChrDevice(driver, vm, dev->data.chr);
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index fe4994a..bbfd3de 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3325,8 +3325,7 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver,
 }
 
 static int
-qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED,
-                               virQEMUDriverPtr driver,
+qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                virDomainHostdevDefPtr detach)
 {
@@ -3360,8 +3359,7 @@ qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED,
 }
 
 static int
-qemuDomainDetachThisHostDevice(virConnectPtr conn,
-                               virQEMUDriverPtr driver,
+qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                virDomainHostdevDefPtr detach)
 {
@@ -3375,7 +3373,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn,
         ret = qemuDomainDetachHostUSBDevice(driver, vm, detach);
         break;
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
-        ret = qemuDomainDetachHostSCSIDevice(conn, driver, vm, detach);
+        ret = qemuDomainDetachHostSCSIDevice(driver, vm, detach);
         break;
     default:
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
@@ -3398,8 +3396,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn,
 }
 
 /* search for a hostdev matching dev and detach it */
-int qemuDomainDetachHostDevice(virConnectPtr conn,
-                               virQEMUDriverPtr driver,
+int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                virDomainDeviceDefPtr dev)
 {
@@ -3468,14 +3465,13 @@ int qemuDomainDetachHostDevice(virConnectPtr conn,
      * function so that mac address / virtualport are reset
      */
     if (detach->parent.type == VIR_DOMAIN_DEVICE_NET)
-        return qemuDomainDetachNetDevice(conn, driver, vm, &detach->parent);
+        return qemuDomainDetachNetDevice(driver, vm, &detach->parent);
     else
-        return qemuDomainDetachThisHostDevice(conn, driver, vm, detach);
+        return qemuDomainDetachThisHostDevice(driver, vm, detach);
 }
 
 int
-qemuDomainDetachNetDevice(virConnectPtr conn,
-                          virQEMUDriverPtr driver,
+qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
                           virDomainObjPtr vm,
                           virDomainDeviceDefPtr dev)
 {
@@ -3491,7 +3487,7 @@ qemuDomainDetachNetDevice(virConnectPtr conn,
 
     if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
         /* coverity[negative_returns] */
-        ret = qemuDomainDetachThisHostDevice(conn, driver, vm,
+        ret = qemuDomainDetachThisHostDevice(driver, vm,
                                              virDomainNetGetActualHostdev(detach));
         goto cleanup;
     }
diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
index 55c9333..1c9ca8f 100644
--- a/src/qemu/qemu_hotplug.h
+++ b/src/qemu/qemu_hotplug.h
@@ -78,12 +78,10 @@ int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
 int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
                                      virDomainObjPtr vm,
                                      virDomainDeviceDefPtr dev);
-int qemuDomainDetachNetDevice(virConnectPtr conn,
-                              virQEMUDriverPtr driver,
+int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
                               virDomainObjPtr vm,
                               virDomainDeviceDefPtr dev);
-int qemuDomainDetachHostDevice(virConnectPtr conn,
-                               virQEMUDriverPtr driver,
+int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
                                virDomainObjPtr vm,
                                virDomainDeviceDefPtr dev);
 int qemuDomainAttachLease(virQEMUDriverPtr driver,
-- 
2.1.2