qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-arm] [PATCH RFC 04/16] hw/core/machine: Introduce pre_init


From: Andrew Jones
Subject: [Qemu-arm] [PATCH RFC 04/16] hw/core/machine: Introduce pre_init
Date: Fri, 10 Jun 2016 19:40:15 +0200

From: Igor Mammedov <address@hidden>

Signed-off-by: Igor Mammedov <address@hidden>
Signed-off-by: Andrew Jones <address@hidden>
---
 hw/core/machine.c   | 6 ++++++
 include/hw/boards.h | 1 +
 vl.c                | 1 +
 3 files changed, 8 insertions(+)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index ccdd5fa3e7728..3dce9020e510a 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -368,10 +368,16 @@ static void machine_init_notify(Notifier *notifier, void 
*data)
     foreach_dynamic_sysbus_device(error_on_sysbus_device, NULL);
 }
 
+static void machine_pre_init(MachineState *ms)
+{
+}
+
 static void machine_class_init(ObjectClass *oc, void *data)
 {
     MachineClass *mc = MACHINE_CLASS(oc);
 
+    mc->pre_init = machine_pre_init;
+
     /* Default 128 MB as guest ram size */
     mc->default_ram_size = 128 * M_BYTE;
     mc->rom_file_has_mr = true;
diff --git a/include/hw/boards.h b/include/hw/boards.h
index d268bd00a9f7d..4e8dc68b07a24 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -92,6 +92,7 @@ struct MachineClass {
     const char *alias;
     const char *desc;
 
+    void (*pre_init)(MachineState *state);
     void (*init)(MachineState *state);
     void (*reset)(void);
     void (*hot_add_cpu)(const int64_t id, Error **errp);
diff --git a/vl.c b/vl.c
index 8d482cb1bf020..4849dd465d667 100644
--- a/vl.c
+++ b/vl.c
@@ -4500,6 +4500,7 @@ int main(int argc, char **argv, char **envp)
     current_machine->boot_order = boot_order;
     current_machine->cpu_model = cpu_model;
 
+    machine_class->pre_init(current_machine);
     machine_class->init(current_machine);
 
     realtime_init();
-- 
2.4.11




reply via email to

[Prev in Thread] Current Thread [Next in Thread]