[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/18] remote/machine: add HotplugHandler for remote machine
From: |
Stefan Hajnoczi |
Subject: |
[PULL 04/18] remote/machine: add HotplugHandler for remote machine |
Date: |
Wed, 15 Jun 2022 16:51:15 +0100 |
From: Jagannathan Raman <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>
Message-id:
d1e6cfa0afb528ad343758f9b1d918be0175c5e5.1655151679.git.jag.raman@oracle.com
Signed-off-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.36.1
- [PULL 00/18] Block patches, Stefan Hajnoczi, 2022/06/15
- [PULL 02/18] Use io_uring_register_ring_fd() to skip fd operations, Stefan Hajnoczi, 2022/06/15
- [PULL 03/18] qdev: unplug blocker for devices, Stefan Hajnoczi, 2022/06/15
- [PULL 01/18] MAINTAINERS: update Vladimir's address and repositories, Stefan Hajnoczi, 2022/06/15
- [PULL 04/18] remote/machine: add HotplugHandler for remote machine,
Stefan Hajnoczi <=
- [PULL 05/18] remote/machine: add vfio-user property, Stefan Hajnoczi, 2022/06/15
- [PULL 07/18] vfio-user: define vfio-user-server object, Stefan Hajnoczi, 2022/06/15
- [PULL 06/18] vfio-user: build library, Stefan Hajnoczi, 2022/06/15
- [PULL 08/18] vfio-user: instantiate vfio-user context, Stefan Hajnoczi, 2022/06/15
- [PULL 10/18] vfio-user: run vfio-user context, Stefan Hajnoczi, 2022/06/15
- [PULL 09/18] vfio-user: find and init PCI device, Stefan Hajnoczi, 2022/06/15
- [PULL 12/18] vfio-user: IOMMU support for remote device, Stefan Hajnoczi, 2022/06/15
- [PULL 13/18] vfio-user: handle DMA mappings, Stefan Hajnoczi, 2022/06/15
- [PULL 11/18] vfio-user: handle PCI config space accesses, Stefan Hajnoczi, 2022/06/15
- [PULL 14/18] vfio-user: handle PCI BAR accesses, Stefan Hajnoczi, 2022/06/15