cryptospore / rpms / qemu-kvm

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