[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 3/8] QEMUMachine: finalize_dt function
From: |
Alvise Rigo |
Subject: |
[Qemu-devel] [RFC PATCH 3/8] QEMUMachine: finalize_dt function |
Date: |
Fri, 11 Jul 2014 09:21:05 +0200 |
Add a new function to be called after that the init of the generic
devices is concluded. This will allow some platforms, like mach-virt, to
conclude its device tree generation disposing of all the information
about attached devices.
Note: This idea accomplishes what is also done by the recent
"[PATCH 0/7] machvirt dynamic sysbus device instantiation", as soon as
those patches will be accepted, this work will be adapted making use of
them.
Signed-off-by: Alvise Rigo <address@hidden>
---
include/hw/boards.h | 4 ++++
vl.c | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 2d2e2be..40dd003 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -19,12 +19,15 @@ typedef void QEMUMachineHotAddCPUFunc(const int64_t id,
Error **errp);
typedef int QEMUMachineGetKvmtypeFunc(const char *arg);
+typedef void QEMUMachineFinalizeDtFunc(MachineState *ms);
+
struct QEMUMachine {
const char *name;
const char *alias;
const char *desc;
QEMUMachineInitFunc *init;
QEMUMachineResetFunc *reset;
+ QEMUMachineFinalizeDtFunc *finalize_dt;
QEMUMachineHotAddCPUFunc *hot_add_cpu;
QEMUMachineGetKvmtypeFunc *kvm_type;
BlockInterfaceType block_default_type;
@@ -73,6 +76,7 @@ struct MachineClass {
void (*init)(MachineState *state);
void (*reset)(void);
+ void (*finalize_dt)(MachineState *state);
void (*hot_add_cpu)(const int64_t id, Error **errp);
int (*kvm_type)(const char *arg);
diff --git a/vl.c b/vl.c
index ac0e3d7..550a377 100644
--- a/vl.c
+++ b/vl.c
@@ -1596,6 +1596,7 @@ static void machine_class_init(ObjectClass *oc, void
*data)
mc->alias = qm->alias;
mc->desc = qm->desc;
mc->init = qm->init;
+ mc->finalize_dt = qm->finalize_dt;
mc->reset = qm->reset;
mc->hot_add_cpu = qm->hot_add_cpu;
mc->kvm_type = qm->kvm_type;
@@ -4456,6 +4457,10 @@ int main(int argc, char **argv, char **envp)
if (qemu_opts_foreach(qemu_find_opts("device"), device_init_func, NULL, 1)
!= 0)
exit(1);
+ if (machine_class->finalize_dt) {
+ machine_class->finalize_dt(current_machine);
+ }
+
net_check_clients();
ds = init_displaystate();
--
1.9.1
- [Qemu-devel] [RFC PATCH 0/8] Add Generic PCI host device update, Alvise Rigo, 2014/07/11
- [Qemu-devel] [RFC PATCH 1/8] mach-virt: move GIC inside mach-virt structure, Alvise Rigo, 2014/07/11
- [Qemu-devel] [RFC PATCH 2/8] mach-virt: improve PCI memory topology definition, Alvise Rigo, 2014/07/11
- [Qemu-devel] [RFC PATCH 3/8] QEMUMachine: finalize_dt function,
Alvise Rigo <=
- [Qemu-devel] [RFC PATCH 4/8] generic_pci: create header file, Alvise Rigo, 2014/07/11
- [Qemu-devel] [RFC PATCH 5/8] generic_pci: create own map irq function, Alvise Rigo, 2014/07/11
- [Qemu-devel] [RFC PATCH 6/8] generic_pci: generate dt node after devices init, Alvise Rigo, 2014/07/11
- [Qemu-devel] [RFC PATCH 7/8] generic_pci: realize device with machine data, Alvise Rigo, 2014/07/11
- [Qemu-devel] [RFC PATCH 8/8] generic_pci: add interrupt map structures, Alvise Rigo, 2014/07/11
- Re: [Qemu-devel] [RFC PATCH 0/8] Add Generic PCI host device update, Peter Maydell, 2014/07/11