|
|
9ae3a8 |
From b63a24d9875589b40cad66a381b22f8304d0fdcd Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Date: Sat, 2 Nov 2013 10:01:25 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 25/29] hw: Pass QEMUMachine to its init() method
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1383386488-29789-9-git-send-email-armbru@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 55246
|
|
|
9ae3a8 |
O-Subject: [PATCH 7.0 qemu-kvm 08/11] hw: Pass QEMUMachine to its init() method
|
|
|
9ae3a8 |
Bugzilla: 994490
|
|
|
9ae3a8 |
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Put it in QEMUMachineInitArgs, so I don't have to touch every board.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from pending upstream submission)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts:
|
|
|
9ae3a8 |
include/hw/boards.h
|
|
|
9ae3a8 |
vl.c
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts because we don't have commit c165473 "hw: Clean up bogus
|
|
|
9ae3a8 |
default boot order".
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
include/hw/boards.h | 7 +++++--
|
|
|
9ae3a8 |
vl.c | 3 ++-
|
|
|
9ae3a8 |
2 files changed, 7 insertions(+), 3 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
include/hw/boards.h | 7 +++++--
|
|
|
9ae3a8 |
vl.c | 3 ++-
|
|
|
9ae3a8 |
2 files changed, 7 insertions(+), 3 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/include/hw/boards.h b/include/hw/boards.h
|
|
|
9ae3a8 |
index fb7c6f1..dd65e30 100644
|
|
|
9ae3a8 |
--- a/include/hw/boards.h
|
|
|
9ae3a8 |
+++ b/include/hw/boards.h
|
|
|
9ae3a8 |
@@ -9,7 +9,10 @@
|
|
|
9ae3a8 |
#define DEFAULT_MACHINE_OPTIONS \
|
|
|
9ae3a8 |
.boot_order = "cad"
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+typedef struct QEMUMachine QEMUMachine;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
typedef struct QEMUMachineInitArgs {
|
|
|
9ae3a8 |
+ const QEMUMachine *machine;
|
|
|
9ae3a8 |
ram_addr_t ram_size;
|
|
|
9ae3a8 |
const char *boot_device;
|
|
|
9ae3a8 |
const char *kernel_filename;
|
|
|
9ae3a8 |
@@ -24,7 +27,7 @@ typedef void QEMUMachineResetFunc(void);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
-typedef struct QEMUMachine {
|
|
|
9ae3a8 |
+struct QEMUMachine {
|
|
|
9ae3a8 |
const char *name;
|
|
|
9ae3a8 |
const char *alias;
|
|
|
9ae3a8 |
const char *desc;
|
|
|
9ae3a8 |
@@ -46,7 +49,7 @@ typedef struct QEMUMachine {
|
|
|
9ae3a8 |
GlobalProperty *compat_props;
|
|
|
9ae3a8 |
struct QEMUMachine *next;
|
|
|
9ae3a8 |
const char *hw_version;
|
|
|
9ae3a8 |
-} QEMUMachine;
|
|
|
9ae3a8 |
+};
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
int qemu_register_machine(QEMUMachine *m);
|
|
|
9ae3a8 |
QEMUMachine *find_default_machine(void);
|
|
|
9ae3a8 |
diff --git a/vl.c b/vl.c
|
|
|
9ae3a8 |
index 19cc3b2..7c8ba63 100644
|
|
|
9ae3a8 |
--- a/vl.c
|
|
|
9ae3a8 |
+++ b/vl.c
|
|
|
9ae3a8 |
@@ -4218,7 +4218,8 @@ int main(int argc, char **argv, char **envp)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
qdev_machine_init();
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- QEMUMachineInitArgs args = { .ram_size = ram_size,
|
|
|
9ae3a8 |
+ QEMUMachineInitArgs args = { .machine = machine,
|
|
|
9ae3a8 |
+ .ram_size = ram_size,
|
|
|
9ae3a8 |
.boot_device = boot_order,
|
|
|
9ae3a8 |
.kernel_filename = kernel_filename,
|
|
|
9ae3a8 |
.kernel_cmdline = kernel_cmdline,
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|