提交 99186c41 编写于 作者: J John Ferlan

qemu: Remove need for virConnectPtr in hotunplug detach host, net

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.
上级 d2774e54
...@@ -6803,10 +6803,10 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm, ...@@ -6803,10 +6803,10 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm,
ret = qemuDomainDetachLease(driver, vm, dev->data.lease); ret = qemuDomainDetachLease(driver, vm, dev->data.lease);
break; break;
case VIR_DOMAIN_DEVICE_NET: case VIR_DOMAIN_DEVICE_NET:
ret = qemuDomainDetachNetDevice(dom->conn, driver, vm, dev); ret = qemuDomainDetachNetDevice(driver, vm, dev);
break; break;
case VIR_DOMAIN_DEVICE_HOSTDEV: case VIR_DOMAIN_DEVICE_HOSTDEV:
ret = qemuDomainDetachHostDevice(dom->conn, driver, vm, dev); ret = qemuDomainDetachHostDevice(driver, vm, dev);
break; break;
case VIR_DOMAIN_DEVICE_CHR: case VIR_DOMAIN_DEVICE_CHR:
ret = qemuDomainDetachChrDevice(driver, vm, dev->data.chr); ret = qemuDomainDetachChrDevice(driver, vm, dev->data.chr);
......
...@@ -3326,8 +3326,7 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver, ...@@ -3326,8 +3326,7 @@ qemuDomainDetachHostUSBDevice(virQEMUDriverPtr driver,
} }
static int static int
qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED, qemuDomainDetachHostSCSIDevice(virQEMUDriverPtr driver,
virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainHostdevDefPtr detach) virDomainHostdevDefPtr detach)
{ {
...@@ -3361,8 +3360,7 @@ qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED, ...@@ -3361,8 +3360,7 @@ qemuDomainDetachHostSCSIDevice(virConnectPtr conn ATTRIBUTE_UNUSED,
} }
static int static int
qemuDomainDetachThisHostDevice(virConnectPtr conn, qemuDomainDetachThisHostDevice(virQEMUDriverPtr driver,
virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainHostdevDefPtr detach) virDomainHostdevDefPtr detach)
{ {
...@@ -3376,7 +3374,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn, ...@@ -3376,7 +3374,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn,
ret = qemuDomainDetachHostUSBDevice(driver, vm, detach); ret = qemuDomainDetachHostUSBDevice(driver, vm, detach);
break; break;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI:
ret = qemuDomainDetachHostSCSIDevice(conn, driver, vm, detach); ret = qemuDomainDetachHostSCSIDevice(driver, vm, detach);
break; break;
default: default:
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
...@@ -3399,8 +3397,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn, ...@@ -3399,8 +3397,7 @@ qemuDomainDetachThisHostDevice(virConnectPtr conn,
} }
/* search for a hostdev matching dev and detach it */ /* search for a hostdev matching dev and detach it */
int qemuDomainDetachHostDevice(virConnectPtr conn, int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev) virDomainDeviceDefPtr dev)
{ {
...@@ -3469,14 +3466,13 @@ int qemuDomainDetachHostDevice(virConnectPtr conn, ...@@ -3469,14 +3466,13 @@ int qemuDomainDetachHostDevice(virConnectPtr conn,
* function so that mac address / virtualport are reset * function so that mac address / virtualport are reset
*/ */
if (detach->parent.type == VIR_DOMAIN_DEVICE_NET) if (detach->parent.type == VIR_DOMAIN_DEVICE_NET)
return qemuDomainDetachNetDevice(conn, driver, vm, &detach->parent); return qemuDomainDetachNetDevice(driver, vm, &detach->parent);
else else
return qemuDomainDetachThisHostDevice(conn, driver, vm, detach); return qemuDomainDetachThisHostDevice(driver, vm, detach);
} }
int int
qemuDomainDetachNetDevice(virConnectPtr conn, qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev) virDomainDeviceDefPtr dev)
{ {
...@@ -3492,7 +3488,7 @@ qemuDomainDetachNetDevice(virConnectPtr conn, ...@@ -3492,7 +3488,7 @@ qemuDomainDetachNetDevice(virConnectPtr conn,
if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV) { if (virDomainNetGetActualType(detach) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
/* coverity[negative_returns] */ /* coverity[negative_returns] */
ret = qemuDomainDetachThisHostDevice(conn, driver, vm, ret = qemuDomainDetachThisHostDevice(driver, vm,
virDomainNetGetActualHostdev(detach)); virDomainNetGetActualHostdev(detach));
goto cleanup; goto cleanup;
} }
......
...@@ -78,12 +78,10 @@ int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver, ...@@ -78,12 +78,10 @@ int qemuDomainDetachDeviceDiskLive(virQEMUDriverPtr driver,
int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver, int qemuDomainDetachControllerDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev); virDomainDeviceDefPtr dev);
int qemuDomainDetachNetDevice(virConnectPtr conn, int qemuDomainDetachNetDevice(virQEMUDriverPtr driver,
virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev); virDomainDeviceDefPtr dev);
int qemuDomainDetachHostDevice(virConnectPtr conn, int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainDeviceDefPtr dev); virDomainDeviceDefPtr dev);
int qemuDomainAttachLease(virQEMUDriverPtr driver, int qemuDomainAttachLease(virQEMUDriverPtr driver,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册