[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [RFC PATCH 2/5] qemu_hotplug: squash qemuDomainRemovePCIHostD
From: |
Michael Roth |
Subject: |
[Qemu-ppc] [RFC PATCH 2/5] qemu_hotplug: squash qemuDomainRemovePCIHostDevice into caller |
Date: |
Wed, 28 Jun 2017 19:24:57 -0500 |
It's only called from one place, and only takes the extra step of
freeing the device alias after reattach. Since another path through
qemuDomainRemoveHostDevice introduced in a subsequent patch will also
need to free the device alias, it'll be more readable to just start
calling it directly.
Signed-off-by: Michael Roth <address@hidden>
---
src/qemu/qemu_hotplug.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index a486fb4..b557e82 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3805,15 +3805,6 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver,
static void
-qemuDomainRemovePCIHostDevice(virQEMUDriverPtr driver,
- virDomainObjPtr vm,
- virDomainHostdevDefPtr hostdev)
-{
- qemuHostdevReAttachPCIDevices(driver, vm->def->name, &hostdev, 1);
- qemuDomainReleaseDeviceAddress(vm, hostdev->info, NULL);
-}
-
-static void
qemuDomainRemoveUSBHostDevice(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainHostdevDefPtr hostdev)
@@ -3905,7 +3896,8 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
switch ((virDomainHostdevSubsysType) hostdev->source.subsys.type) {
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
- qemuDomainRemovePCIHostDevice(driver, vm, hostdev);
+ qemuHostdevReAttachPCIDevices(driver, vm->def->name, &hostdev, 1);
+ qemuDomainReleaseDeviceAddress(vm, hostdev->info, NULL);
/* QEMU might no longer need to lock as much memory, eg. we just
* detached the last VFIO device, so adjust the limit here */
if (qemuDomainAdjustMaxMemLock(vm) < 0)
--
2.7.4
- [Qemu-ppc] [RFC PATCH 0/5] hotplug: fix premature rebinding of VFIO devices to host, Michael Roth, 2017/06/28
- [Qemu-ppc] [RFC PATCH 2/5] qemu_hotplug: squash qemuDomainRemovePCIHostDevice into caller,
Michael Roth <=
- [Qemu-ppc] [RFC PATCH 3/5] virpci: introduce virPCIIOMMUGroupIterate(), Michael Roth, 2017/06/28
- [Qemu-ppc] [RFC PATCH 1/5] virhostdev: factor release out from reattach and export it for use later, Michael Roth, 2017/06/28
- [Qemu-ppc] [RFC PATCH 5/5] qemu: hotplug: wait for VFIO group FD close before unbind, Michael Roth, 2017/06/28
- [Qemu-ppc] [RFC PATCH 4/5] qemu: hotplug: unbind VFIO devices as a group, Michael Roth, 2017/06/28
- Re: [Qemu-ppc] [RFC PATCH 0/5] hotplug: fix premature rebinding of VFIO devices to host, Daniel P. Berrange, 2017/06/29
- Re: [Qemu-ppc] [RFC PATCH 0/5] hotplug: fix premature rebinding of VFIO devices to host, Laine Stump, 2017/06/29