[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/18] remote/machine: add vfio-user property
From: |
Stefan Hajnoczi |
Subject: |
[PULL 05/18] remote/machine: add vfio-user property |
Date: |
Wed, 15 Jun 2022 16:51:16 +0100 |
From: Jagannathan Raman <jag.raman@oracle.com>
Add vfio-user to x-remote machine. It is a boolean, which indicates if
the machine supports vfio-user protocol. The machine configures the bus
differently vfio-user and multiprocess protocols, so this property
informs it on how to configure the bus.
This property should be short lived. Once vfio-user fully replaces
multiprocess, this property could be removed.
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:
5d51a152a419cbda35d070b8e49b772b60a7230a.1655151679.git.jag.raman@oracle.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
include/hw/remote/machine.h | 2 ++
hw/remote/machine.c | 23 +++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/include/hw/remote/machine.h b/include/hw/remote/machine.h
index 2a2a33c4b2..8d0fa98d33 100644
--- a/include/hw/remote/machine.h
+++ b/include/hw/remote/machine.h
@@ -22,6 +22,8 @@ struct RemoteMachineState {
RemotePCIHost *host;
RemoteIOHubState iohub;
+
+ bool vfio_user;
};
/* Used to pass to co-routine device and ioc. */
diff --git a/hw/remote/machine.c b/hw/remote/machine.c
index a97e53e250..9f3cdc55c3 100644
--- a/hw/remote/machine.c
+++ b/hw/remote/machine.c
@@ -58,6 +58,25 @@ static void remote_machine_init(MachineState *machine)
qbus_set_hotplug_handler(BUS(pci_host->bus), OBJECT(s));
}
+static bool remote_machine_get_vfio_user(Object *obj, Error **errp)
+{
+ RemoteMachineState *s = REMOTE_MACHINE(obj);
+
+ return s->vfio_user;
+}
+
+static void remote_machine_set_vfio_user(Object *obj, bool value, Error **errp)
+{
+ RemoteMachineState *s = REMOTE_MACHINE(obj);
+
+ if (phase_check(PHASE_MACHINE_CREATED)) {
+ error_setg(errp, "Error enabling vfio-user - machine already created");
+ return;
+ }
+
+ s->vfio_user = value;
+}
+
static void remote_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -67,6 +86,10 @@ static void remote_machine_class_init(ObjectClass *oc, void
*data)
mc->desc = "Experimental remote machine";
hc->unplug = qdev_simple_device_unplug_cb;
+
+ object_class_property_add_bool(oc, "vfio-user",
+ remote_machine_get_vfio_user,
+ remote_machine_set_vfio_user);
}
static const TypeInfo remote_machine = {
--
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, 2022/06/15
- [PULL 05/18] remote/machine: add vfio-user property,
Stefan Hajnoczi <=
- [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
- [PULL 17/18] linux-aio: fix unbalanced plugged counter in laio_io_unplug(), Stefan Hajnoczi, 2022/06/15