[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 19/21] add hot_add_cpu hook to QEMUMachine and expor
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 19/21] add hot_add_cpu hook to QEMUMachine and export machine_args |
Date: |
Tue, 23 Apr 2013 10:29:53 +0200 |
hot_add_cpu hook should be overriden by target that implements
cpu hot-add via cpu-add QMP command.
Make machine_args available to machine init code, it allows
to centralize cpu_model starage instead of adding target
specific globals to keep it.
Signed-off-by: Igor Mammedov <address@hidden>
---
include/hw/boards.h | 3 +++
vl.c | 6 +++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 425bdc7..de8f92a 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -18,6 +18,8 @@ typedef struct QEMUMachineInitArgs {
const char *cpu_model;
} QEMUMachineInitArgs;
+extern QEMUMachineInitArgs *machine_args;
+
typedef void QEMUMachineInitFunc(QEMUMachineInitArgs *args);
typedef void QEMUMachineResetFunc(void);
@@ -43,6 +45,7 @@ typedef struct QEMUMachine {
GlobalProperty *compat_props;
struct QEMUMachine *next;
const char *hw_version;
+ void (*hot_add_cpu)(const int64_t id, Error **errp);
} QEMUMachine;
int qemu_register_machine(QEMUMachine *m);
diff --git a/vl.c b/vl.c
index 5612c33..6a612e6 100644
--- a/vl.c
+++ b/vl.c
@@ -179,6 +179,8 @@ int main(int argc, char **argv)
#define MAX_VIRTIO_CONSOLES 1
#define MAX_SCLP_CONSOLES 1
+QEMUMachineInitArgs *machine_args;
+
static const char *data_dir[16];
static int data_dir_idx;
const char *bios_name = NULL;
@@ -4295,13 +4297,15 @@ int main(int argc, char **argv, char **envp)
.kernel_cmdline = kernel_cmdline,
.initrd_filename = initrd_filename,
.cpu_model = cpu_model };
+ machine_args = &args;
+ current_machine = machine;
+
machine->init(&args);
cpu_synchronize_all_post_init();
set_numa_modes();
- current_machine = machine;
/* init USB devices */
if (usb_enabled(false)) {
--
1.7.1
- Re: [Qemu-devel] [PATCH 10/21 DISGISED v6] acpi_piix4: add infrastructure to send CPU hot-plug GPE to guest, (continued)
- [Qemu-devel] [PATCH 15/21] target-i386: kvmvapic: make expilict dependency on sysbus.h, Igor Mammedov, 2013/04/23
- [Qemu-devel] [PATCH 18/21] target-i386: move IOAPIC to ICC bus, Igor Mammedov, 2013/04/23
- [Qemu-devel] [PATCH 16/21] target-i386: move APIC to ICC bus, Igor Mammedov, 2013/04/23
- [Qemu-devel] [PATCH 19/21] add hot_add_cpu hook to QEMUMachine and export machine_args,
Igor Mammedov <=
- [Qemu-devel] [PATCH 14/21] target-i386: replace MSI_SPACE_SIZE with APIC_SPACE_SIZE, Igor Mammedov, 2013/04/23
- [Qemu-devel] [PATCH 20/21] target-i386: implement machine->hot_add_cpu hook, Igor Mammedov, 2013/04/23
- [Qemu-devel] [PATCH 21/21] QMP: add cpu-add command, Igor Mammedov, 2013/04/23