mirror of
https://github.com/xemu-project/xemu.git
synced 2025-01-21 03:16:59 +00:00
hw: Pass QEMUMachine to its init() method
Put it in QEMUMachineInitArgs, so I don't have to touch every board. Reviewed-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
8f84271da8
commit
e689f7c668
@ -6,7 +6,10 @@
|
||||
#include "sysemu/blockdev.h"
|
||||
#include "hw/qdev.h"
|
||||
|
||||
typedef struct QEMUMachine QEMUMachine;
|
||||
|
||||
typedef struct QEMUMachineInitArgs {
|
||||
const QEMUMachine *machine;
|
||||
ram_addr_t ram_size;
|
||||
const char *boot_order;
|
||||
const char *kernel_filename;
|
||||
@ -21,7 +24,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;
|
||||
@ -43,7 +46,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);
|
||||
|
3
vl.c
3
vl.c
@ -4239,7 +4239,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_order = boot_order,
|
||||
.kernel_filename = kernel_filename,
|
||||
.kernel_cmdline = kernel_cmdline,
|
||||
|
Loading…
x
Reference in New Issue
Block a user