From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: libvir-list@redhat.com
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, aik@ozlabs.ru,
alex.williamson@redhat.com, abologna@redhat.com, laine@laine.org,
pkrempa@redhat.com, berrange@redhat.com, mprivozn@redhat.com,
sbhat@linux.vnet.ibm.com
Subject: [Qemu-devel] [RFC PATCH 2/5] qemu_hotplug: squash qemuDomainRemovePCIHostDevice into caller
Date: Wed, 28 Jun 2017 19:24:57 -0500 [thread overview]
Message-ID: <1498695900-1648-3-git-send-email-mdroth@linux.vnet.ibm.com> (raw)
In-Reply-To: <1498695900-1648-1-git-send-email-mdroth@linux.vnet.ibm.com>
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 <mdroth@linux.vnet.ibm.com>
---
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
next prev parent reply other threads:[~2017-06-29 0:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-29 0:24 [Qemu-devel] [RFC PATCH 0/5] hotplug: fix premature rebinding of VFIO devices to host Michael Roth
2017-06-29 0:24 ` [Qemu-devel] [RFC PATCH 1/5] virhostdev: factor release out from reattach and export it for use later Michael Roth
2017-06-29 0:24 ` Michael Roth [this message]
2017-06-29 0:24 ` [Qemu-devel] [RFC PATCH 3/5] virpci: introduce virPCIIOMMUGroupIterate() Michael Roth
2017-06-29 0:24 ` [Qemu-devel] [RFC PATCH 4/5] qemu: hotplug: unbind VFIO devices as a group Michael Roth
2017-06-29 0:25 ` [Qemu-devel] [RFC PATCH 5/5] qemu: hotplug: wait for VFIO group FD close before unbind Michael Roth
2017-06-29 8:33 ` [Qemu-devel] [RFC PATCH 0/5] hotplug: fix premature rebinding of VFIO devices to host Daniel P. Berrange
2017-06-29 18:22 ` Michael Roth
2017-06-29 19:31 ` Alex Williamson
2017-06-29 19:28 ` Alex Williamson
2017-06-29 20:21 ` Michael Roth
2017-06-29 18:50 ` Laine Stump
2017-06-29 19:44 ` Alex Williamson
2017-06-30 2:27 ` Laine Stump
2017-06-29 20:59 ` Michael Roth
2017-06-30 6:59 ` Andrea Bolognani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1498695900-1648-3-git-send-email-mdroth@linux.vnet.ibm.com \
--to=mdroth@linux.vnet.ibm.com \
--cc=abologna@redhat.com \
--cc=aik@ozlabs.ru \
--cc=alex.williamson@redhat.com \
--cc=berrange@redhat.com \
--cc=laine@laine.org \
--cc=libvir-list@redhat.com \
--cc=mprivozn@redhat.com \
--cc=pkrempa@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sbhat@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).