qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 5/8] [PATCH RFC v2] s390-qemu: cpu hotplug - Introdu


From: Jason J. Herne
Subject: [Qemu-devel] [PATCH 5/8] [PATCH RFC v2] s390-qemu: cpu hotplug - Introduce post-cpu-init function
Date: Fri, 7 Jun 2013 13:28:04 -0400

From: "Jason J. Herne" <address@hidden>

In preparation for treating cpus as devices we need to separate machine
initialization into two stages:
1. Initialization that needs to be done before cpu devices can be created.
2. Initialization that requires cpu devices to already be created.

This is accomplished by creating an optional post-cpu initialization function
for QEMUMachine.

Signed-off-by: Jason J. Herne <address@hidden>
---
 include/hw/boards.h |    3 ++-
 vl.c                |    4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/hw/boards.h b/include/hw/boards.h
index fb7c6f1..ed427a1 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -19,7 +19,7 @@ typedef struct QEMUMachineInitArgs {
 } QEMUMachineInitArgs;
 
 typedef void QEMUMachineInitFunc(QEMUMachineInitArgs *args);
-
+typedef void QEMUMachineInitPostCpusFunc(void);
 typedef void QEMUMachineResetFunc(void);
 
 typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp);
@@ -29,6 +29,7 @@ typedef struct QEMUMachine {
     const char *alias;
     const char *desc;
     QEMUMachineInitFunc *init;
+    QEMUMachineInitPostCpusFunc *post_cpu_init;
     QEMUMachineResetFunc *reset;
     QEMUMachineHotAddCPUFunc *hot_add_cpu;
     BlockInterfaceType block_default_type;
diff --git a/vl.c b/vl.c
index 47ab45d..71e1e6d 100644
--- a/vl.c
+++ b/vl.c
@@ -4305,6 +4305,10 @@ int main(int argc, char **argv, char **envp)
                                  .cpu_model = cpu_model };
     machine->init(&args);
 
+    if (machine->post_cpu_init) {
+        machine->post_cpu_init();
+    }
+
     audio_init();
 
     cpu_synchronize_all_post_init();
-- 
1.7.10.4




reply via email to

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