From: Jagannathan Raman <jag.raman@oracle.com>
To: qemu-devel@nongnu.org
Cc: stefanha@redhat.com, mst@redhat.com, alex.williamson@redhat.com,
f4bug@amsat.org, pbonzini@redhat.com,
marcandre.lureau@redhat.com, thuth@redhat.com, bleal@redhat.com,
berrange@redhat.com, peter.maydell@linaro.org,
eduardo@habkost.net, marcel.apfelbaum@gmail.com,
eblake@redhat.com, armbru@redhat.com, quintela@redhat.com,
dgilbert@redhat.com, imammedo@redhat.com, peterx@redhat.com,
john.levon@nutanix.com, thanos.makatos@nutanix.com,
elena.ufimtseva@oracle.com, john.g.johnson@oracle.com,
kanth.ghatraju@oracle.com, jag.raman@oracle.com
Subject: [PATCH v11 02/14] remote/machine: add HotplugHandler for remote machine
Date: Fri, 10 Jun 2022 15:50:29 -0400 [thread overview]
Message-ID: <be6bb36c85b2994fefd8b14454d80d0f12849980.1654889541.git.jag.raman@oracle.com> (raw)
In-Reply-To: <cover.1654889541.git.jag.raman@oracle.com>
Allow hotplugging of PCI(e) devices to remote machine
Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Signed-off-by: John G Johnson <john.g.johnson@oracle.com>
Signed-off-by: Jagannathan Raman <jag.raman@oracle.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
hw/remote/machine.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/remote/machine.c b/hw/remote/machine.c
index 92d71d47bb..a97e53e250 100644
--- a/hw/remote/machine.c
+++ b/hw/remote/machine.c
@@ -20,6 +20,7 @@
#include "qapi/error.h"
#include "hw/pci/pci_host.h"
#include "hw/remote/iohub.h"
+#include "hw/qdev-core.h"
static void remote_machine_init(MachineState *machine)
{
@@ -53,14 +54,19 @@ static void remote_machine_init(MachineState *machine)
pci_bus_irqs(pci_host->bus, remote_iohub_set_irq, remote_iohub_map_irq,
&s->iohub, REMOTE_IOHUB_NB_PIRQS);
+
+ qbus_set_hotplug_handler(BUS(pci_host->bus), OBJECT(s));
}
static void remote_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
+ HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
mc->init = remote_machine_init;
mc->desc = "Experimental remote machine";
+
+ hc->unplug = qdev_simple_device_unplug_cb;
}
static const TypeInfo remote_machine = {
@@ -68,6 +74,10 @@ static const TypeInfo remote_machine = {
.parent = TYPE_MACHINE,
.instance_size = sizeof(RemoteMachineState),
.class_init = remote_machine_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_HOTPLUG_HANDLER },
+ { }
+ }
};
static void remote_machine_register_types(void)
--
2.20.1
next prev parent reply other threads:[~2022-06-10 20:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-10 19:50 [PATCH v11 00/14] vfio-user server in QEMU Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 01/14] qdev: unplug blocker for devices Jagannathan Raman
2022-06-10 19:50 ` Jagannathan Raman [this message]
2022-06-10 19:50 ` [PATCH v11 03/14] remote/machine: add vfio-user property Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 04/14] vfio-user: build library Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 05/14] vfio-user: define vfio-user-server object Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 06/14] vfio-user: instantiate vfio-user context Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 07/14] vfio-user: find and init PCI device Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 08/14] vfio-user: run vfio-user context Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 09/14] vfio-user: handle PCI config space accesses Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 10/14] vfio-user: IOMMU support for remote device Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 11/14] vfio-user: handle DMA mappings Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 12/14] vfio-user: handle PCI BAR accesses Jagannathan Raman
2022-06-10 19:50 ` [PATCH v11 13/14] vfio-user: handle device interrupts Jagannathan Raman
2022-06-13 15:30 ` Stefan Hajnoczi
2022-06-10 19:50 ` [PATCH v11 14/14] vfio-user: handle reset of remote device Jagannathan Raman
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=be6bb36c85b2994fefd8b14454d80d0f12849980.1654889541.git.jag.raman@oracle.com \
--to=jag.raman@oracle.com \
--cc=alex.williamson@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=bleal@redhat.com \
--cc=dgilbert@redhat.com \
--cc=eblake@redhat.com \
--cc=eduardo@habkost.net \
--cc=elena.ufimtseva@oracle.com \
--cc=f4bug@amsat.org \
--cc=imammedo@redhat.com \
--cc=john.g.johnson@oracle.com \
--cc=john.levon@nutanix.com \
--cc=kanth.ghatraju@oracle.com \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.com \
--cc=thanos.makatos@nutanix.com \
--cc=thuth@redhat.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).