[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 5/7] hw/xen: initialize legacy backends from xen_bus_init()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 5/7] hw/xen: initialize legacy backends from xen_bus_init() |
Date: |
Fri, 10 May 2024 12:49:06 +0200 |
From: Paolo Bonzini <pbonzini@redhat.com>
Prepare for moving the calls to xen_be_register() under the
control of xen_bus_init(), using the normal xen_backend_init()
method that is used by the "modern" backends.
This requires the xenstore global variable to be initialized,
which is done by xen_be_init(). To ensure that everything is
ready at the time the xen_backend_init() functions are called,
remove the xen_be_init() function from all the boards and
place it directly in xen_bus_init().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240509170044.190795-7-pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/i386/pc.c | 1 -
hw/xen/xen-bus.c | 4 ++++
hw/xen/xen-hvm-common.c | 2 --
hw/xenpv/xen_machine_pv.c | 5 +----
4 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 505ea750f4..19f21953b4 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1250,7 +1250,6 @@ void pc_basic_device_init(struct PCMachineState *pcms,
pci_create_simple(pcms->pcibus, -1, "xen-platform");
}
xen_bus_init();
- xen_be_init();
}
#endif
diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c
index fb82cc33e4..95b207ac8b 100644
--- a/hw/xen/xen-bus.c
+++ b/hw/xen/xen-bus.c
@@ -13,6 +13,7 @@
#include "hw/sysbus.h"
#include "hw/xen/xen.h"
#include "hw/xen/xen-backend.h"
+#include "hw/xen/xen-legacy-backend.h" /* xen_be_init() */
#include "hw/xen/xen-bus.h"
#include "hw/xen/xen-bus-helper.h"
#include "monitor/monitor.h"
@@ -329,6 +330,9 @@ static void xen_bus_realize(BusState *bus, Error **errp)
goto fail;
}
+ /* Initialize legacy backend core & drivers */
+ xen_be_init();
+
if (xs_node_scanf(xenbus->xsh, XBT_NULL, "", /* domain root node */
"domid", NULL, "%u", &domid) == 1) {
xenbus->backend_id = domid;
diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c
index 1627da7398..2d1b032121 100644
--- a/hw/xen/xen-hvm-common.c
+++ b/hw/xen/xen-hvm-common.c
@@ -872,8 +872,6 @@ void xen_register_ioreq(XenIOState *state, unsigned int
max_cpus,
xen_bus_init();
- xen_be_init();
-
return;
err:
diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c
index 1130d1a147..b500ce0989 100644
--- a/hw/xenpv/xen_machine_pv.c
+++ b/hw/xenpv/xen_machine_pv.c
@@ -34,8 +34,7 @@ static void xen_init_pv(MachineState *machine)
{
setup_xen_backend_ops();
- /* Initialize backend core & drivers */
- xen_be_init();
+ xen_bus_init();
switch (xen_mode) {
case XEN_ATTACH:
@@ -60,8 +59,6 @@ static void xen_init_pv(MachineState *machine)
vga_interface_created = true;
}
- xen_bus_init();
-
/* config cleanup hook */
atexit(xen_config_cleanup);
}
--
2.41.0
- [PATCH v2 0/7] hw/xen: Simplify legacy backends handling, Philippe Mathieu-Daudé, 2024/05/10
- [PATCH v2 1/7] hw/xen: Remove declarations left over in 'xen-legacy-backend.h', Philippe Mathieu-Daudé, 2024/05/10
- [PATCH v2 2/7] hw/xen: Constify XenLegacyDevice::XenDevOps, Philippe Mathieu-Daudé, 2024/05/10
- [PATCH v2 3/7] hw/xen: Constify xenstore_be::XenDevOps, Philippe Mathieu-Daudé, 2024/05/10
- [PATCH v2 4/7] hw/xen: Make XenDevOps structures const, Philippe Mathieu-Daudé, 2024/05/10
- [PATCH v2 5/7] hw/xen: initialize legacy backends from xen_bus_init(),
Philippe Mathieu-Daudé <=
- [PATCH v2 6/7] hw/xen: register legacy backends via xen_backend_init, Philippe Mathieu-Daudé, 2024/05/10
- [PATCH v2 7/7] hw/xen: Register framebuffer backend via xen_backend_init(), Philippe Mathieu-Daudé, 2024/05/10
- Re: [PATCH v2 0/7] hw/xen: Simplify legacy backends handling, Philippe Mathieu-Daudé, 2024/05/29