render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9119d9
From 56df0b93d70c961aab2216eaf587a57a87a3faf4 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <56df0b93d70c961aab2216eaf587a57a87a3faf4@dist-git>
9119d9
From: John Ferlan <jferlan@redhat.com>
9119d9
Date: Mon, 6 Oct 2014 11:14:33 -0400
9119d9
Subject: [PATCH] qemu: Remove need for virConnectPtr in hotunplug detach host,
9119d9
 net
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=1141732
9119d9
9119d9
Prior patch removed the need for the virConnectPtr in the unplug
9119d9
detach host path which caused ripple effect to remove in multiple
9119d9
callers.  The previous patch just left things as ATTRIBUTE_UNUSED -
9119d9
this patch will remove the variable.
9119d9
9119d9
(cherry picked from commit 99186c4103cf1e035fed1de6baa575edac9ed53a)
9119d9
Signed-off-by: John Ferlan <jferlan@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/qemu/qemu_driver.c  |  4 ++--
9119d9
 src/qemu/qemu_hotplug.c | 20 ++++++++------------
9119d9
 src/qemu/qemu_hotplug.h |  6 ++----
9119d9
 3 files changed, 12 insertions(+), 18 deletions(-)
9119d9
9119d9
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
9119d9
index 9586c43..4c57fcd 100644
9119d9
--- a/src/qemu/qemu_driver.c
9119d9
+++ b/src/qemu/qemu_driver.c
9119d9
@@ -6804,10 +6804,10 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
9119d9
         ret = qemuDomainDetachLease(driver, vm, dev->data.lease);
9119d9
         break;
9119d9
     case VIR_DOMAIN_DEVICE_NET:
9119d9
-        ret = qemuDomainDetachNetDevice(dom->conn, driver, vm, dev);
9119d9
+        ret = qemuDomainDetachNetDevice(driver, vm, dev);
9119d9
         break;
9119d9
     case VIR_DOMAIN_DEVICE_HOSTDEV:
9119d9
-        ret = qemuDomainDetachHostDevice(dom->conn, driver, vm, dev);
9119d9
+        ret = qemuDomainDetachHostDevice(driver, vm, dev);
9119d9
         break;
9119d9
     case VIR_DOMAIN_DEVICE_CHR:
9119d9
         ret = qemuDomainDetachChrDevice(driver, vm, dev->data.chr);
9119d9
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
9119d9
index fe4994a..bbfd3de 100644
9119d9
--- a/src/qemu/qemu_hotplug.c
9119d9
+++ b/src/qemu/qemu_hotplug.c
9119d9
@@ -3325,8 +3325,7 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver,
9119d9
 }
9119d9
 
9119d9
 static int
9119d9
-qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED,
9119d9
-                               virQEMUDriverPtr driver,
9119d9
+qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver,
9119d9
                                virDomainObjPtr vm,
9119d9
                                virDomainHostdevDefPtr detach)
9119d9
 {
9119d9
@@ -3360,8 +3359,7 @@ qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED,
9119d9
 }
9119d9
 
9119d9
 static int
9119d9
-qemuDomainDetachThisHostDevice(virConnectPtr conn,
9119d9
-                               virQEMUDriverPtr driver,
9119d9
+qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
9119d9
                                virDomainObjPtr vm,
9119d9
                                virDomainHostdevDefPtr detach)
9119d9
 {
9119d9
@@ -3375,7 +3373,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn,
9119d9
         ret = qemuDomainDetachHostUSBDevice(driver, vm, detach);
9119d9
         break;
9119d9
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
9119d9
-        ret = qemuDomainDetachHostSCSIDevice(conn, driver, vm, detach);
9119d9
+        ret = qemuDomainDetachHostSCSIDevice(driver, vm, detach);
9119d9
         break;
9119d9
     default:
9119d9
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
9119d9
@@ -3398,8 +3396,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn,
9119d9
 }
9119d9
 
9119d9
 /* search for a hostdev matching dev and detach it */
9119d9
-int qemuDomainDetachHostDevice(virConnectPtr conn,
9119d9
-                               virQEMUDriverPtr driver,
9119d9
+int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
9119d9
                                virDomainObjPtr vm,
9119d9
                                virDomainDeviceDefPtr dev)
9119d9
 {
9119d9
@@ -3468,14 +3465,13 @@ int qemuDomainDetachHostDevice(virConnectPtr conn,
9119d9
      * function so that mac address / virtualport are reset
9119d9
      */
9119d9
     if (detach->parent.type == VIR_DOMAIN_DEVICE_NET)
9119d9
-        return qemuDomainDetachNetDevice(conn, driver, vm, &detach->parent);
9119d9
+        return qemuDomainDetachNetDevice(driver, vm, &detach->parent);
9119d9
     else
9119d9
-        return qemuDomainDetachThisHostDevice(conn, driver, vm, detach);
9119d9
+        return qemuDomainDetachThisHostDevice(driver, vm, detach);
9119d9
 }
9119d9
 
9119d9
 int
9119d9
-qemuDomainDetachNetDevice(virConnectPtr conn,
9119d9
-                          virQEMUDriverPtr driver,
9119d9
+qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
9119d9
                           virDomainObjPtr vm,
9119d9
                           virDomainDeviceDefPtr dev)
9119d9
 {
9119d9
@@ -3491,7 +3487,7 @@ qemuDomainDetachNetDevice(virConnectPtr conn,
9119d9
 
9119d9
     if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
9119d9
         /* coverity[negative_returns] */
9119d9
-        ret = qemuDomainDetachThisHostDevice(conn, driver, vm,
9119d9
+        ret = qemuDomainDetachThisHostDevice(driver, vm,
9119d9
                                              virDomainNetGetActualHostdev(detach));
9119d9
         goto cleanup;
9119d9
     }
9119d9
diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h
9119d9
index 55c9333..1c9ca8f 100644
9119d9
--- a/src/qemu/qemu_hotplug.h
9119d9
+++ b/src/qemu/qemu_hotplug.h
9119d9
@@ -78,12 +78,10 @@ int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
9119d9
 int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
9119d9
                                      virDomainObjPtr vm,
9119d9
                                      virDomainDeviceDefPtr dev);
9119d9
-int qemuDomainDetachNetDevice(virConnectPtr conn,
9119d9
-                              virQEMUDriverPtr driver,
9119d9
+int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
9119d9
                               virDomainObjPtr vm,
9119d9
                               virDomainDeviceDefPtr dev);
9119d9
-int qemuDomainDetachHostDevice(virConnectPtr conn,
9119d9
-                               virQEMUDriverPtr driver,
9119d9
+int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
9119d9
                                virDomainObjPtr vm,
9119d9
                                virDomainDeviceDefPtr dev);
9119d9
 int qemuDomainAttachLease(virQEMUDriverPtr driver,
9119d9
-- 
9119d9
2.1.2
9119d9