Blob Blame Raw
From b63a24d9875589b40cad66a381b22f8304d0fdcd Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Sat, 2 Nov 2013 10:01:25 +0100
Subject: [PATCH 25/29] hw: Pass QEMUMachine to its init() method

RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <1383386488-29789-9-git-send-email-armbru@redhat.com>
Patchwork-id: 55246
O-Subject: [PATCH 7.0 qemu-kvm 08/11] hw: Pass QEMUMachine to its init() method
Bugzilla: 994490
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>

From: Markus Armbruster <armbru@redhat.com>

Put it in QEMUMachineInitArgs, so I don't have to touch every board.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from pending upstream submission)

Conflicts:
	include/hw/boards.h
	vl.c

Conflicts because we don't have commit c165473 "hw: Clean up bogus
default boot order".
---
 include/hw/boards.h | 7 +++++--
 vl.c                | 3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
---
 include/hw/boards.h |    7 +++++--
 vl.c                |    3 ++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/hw/boards.h b/include/hw/boards.h
index fb7c6f1..dd65e30 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -9,7 +9,10 @@
 #define DEFAULT_MACHINE_OPTIONS \
     .boot_order = "cad"
 
+typedef struct QEMUMachine QEMUMachine;
+
 typedef struct QEMUMachineInitArgs {
+    const QEMUMachine *machine;
     ram_addr_t ram_size;
     const char *boot_device;
     const char *kernel_filename;
@@ -24,7 +27,7 @@ typedef void QEMUMachineResetFunc(void);
 
 typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp);
 
-typedef struct QEMUMachine {
+struct QEMUMachine {
     const char *name;
     const char *alias;
     const char *desc;
@@ -46,7 +49,7 @@ typedef struct QEMUMachine {
     GlobalProperty *compat_props;
     struct QEMUMachine *next;
     const char *hw_version;
-} QEMUMachine;
+};
 
 int qemu_register_machine(QEMUMachine *m);
 QEMUMachine *find_default_machine(void);
diff --git a/vl.c b/vl.c
index 19cc3b2..7c8ba63 100644
--- a/vl.c
+++ b/vl.c
@@ -4218,7 +4218,8 @@ int main(int argc, char **argv, char **envp)
 
     qdev_machine_init();
 
-    QEMUMachineInitArgs args = { .ram_size = ram_size,
+    QEMUMachineInitArgs args = { .machine = machine,
+                                 .ram_size = ram_size,
                                  .boot_device = boot_order,
                                  .kernel_filename = kernel_filename,
                                  .kernel_cmdline = kernel_cmdline,
-- 
1.7.1