mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
machine: Conversion of QEMUMachineInitArgs to MachineState
Total removal of QEMUMachineInitArgs struct. QEMUMachineInitArgs's fields are copied into MachineState. Removed duplicated fields from MachineState. All the other changes are only mechanical refactoring, no semantic changes. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> (s390) Reviewed-by: Michael S. Tsirkin <mst@redhat.com> (PC) [AF: Renamed ms -> machine, use MACHINE_GET_CLASS()] Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
0380aef323
commit
3ef9622182
65 changed files with 545 additions and 549 deletions
|
@ -811,7 +811,7 @@ static SPARCCPU *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef)
|
|||
}
|
||||
|
||||
static void sun4uv_init(MemoryRegion *address_space_mem,
|
||||
QEMUMachineInitArgs *args,
|
||||
MachineState *machine,
|
||||
const struct hwdef *hwdef)
|
||||
{
|
||||
SPARCCPU *cpu;
|
||||
|
@ -826,10 +826,10 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
|||
FWCfgState *fw_cfg;
|
||||
|
||||
/* init CPUs */
|
||||
cpu = cpu_devinit(args->cpu_model, hwdef);
|
||||
cpu = cpu_devinit(machine->cpu_model, hwdef);
|
||||
|
||||
/* set up devices */
|
||||
ram_init(0, args->ram_size);
|
||||
ram_init(0, machine->ram_size);
|
||||
|
||||
prom_init(hwdef->prom_addr, bios_name);
|
||||
|
||||
|
@ -875,15 +875,15 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
|||
|
||||
initrd_size = 0;
|
||||
initrd_addr = 0;
|
||||
kernel_size = sun4u_load_kernel(args->kernel_filename,
|
||||
args->initrd_filename,
|
||||
kernel_size = sun4u_load_kernel(machine->kernel_filename,
|
||||
machine->initrd_filename,
|
||||
ram_size, &initrd_size, &initrd_addr,
|
||||
&kernel_addr, &kernel_entry);
|
||||
|
||||
sun4u_NVRAM_set_params(nvram, NVRAM_SIZE, "Sun4u", args->ram_size,
|
||||
args->boot_order,
|
||||
sun4u_NVRAM_set_params(nvram, NVRAM_SIZE, "Sun4u", machine->ram_size,
|
||||
machine->boot_order,
|
||||
kernel_addr, kernel_size,
|
||||
args->kernel_cmdline,
|
||||
machine->kernel_cmdline,
|
||||
initrd_addr, initrd_size,
|
||||
/* XXX: need an option to load a NVRAM image */
|
||||
0,
|
||||
|
@ -897,16 +897,16 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
|
|||
fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, hwdef->machine_id);
|
||||
fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_ADDR, kernel_entry);
|
||||
fw_cfg_add_i64(fw_cfg, FW_CFG_KERNEL_SIZE, kernel_size);
|
||||
if (args->kernel_cmdline) {
|
||||
if (machine->kernel_cmdline) {
|
||||
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE,
|
||||
strlen(args->kernel_cmdline) + 1);
|
||||
fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, args->kernel_cmdline);
|
||||
strlen(machine->kernel_cmdline) + 1);
|
||||
fw_cfg_add_string(fw_cfg, FW_CFG_CMDLINE_DATA, machine->kernel_cmdline);
|
||||
} else {
|
||||
fw_cfg_add_i32(fw_cfg, FW_CFG_CMDLINE_SIZE, 0);
|
||||
}
|
||||
fw_cfg_add_i64(fw_cfg, FW_CFG_INITRD_ADDR, initrd_addr);
|
||||
fw_cfg_add_i64(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size);
|
||||
fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, args->boot_order[0]);
|
||||
fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, machine->boot_order[0]);
|
||||
|
||||
fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_WIDTH, graphic_width);
|
||||
fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_HEIGHT, graphic_height);
|
||||
|
@ -946,21 +946,21 @@ static const struct hwdef hwdefs[] = {
|
|||
};
|
||||
|
||||
/* Sun4u hardware initialisation */
|
||||
static void sun4u_init(QEMUMachineInitArgs *args)
|
||||
static void sun4u_init(MachineState *machine)
|
||||
{
|
||||
sun4uv_init(get_system_memory(), args, &hwdefs[0]);
|
||||
sun4uv_init(get_system_memory(), machine, &hwdefs[0]);
|
||||
}
|
||||
|
||||
/* Sun4v hardware initialisation */
|
||||
static void sun4v_init(QEMUMachineInitArgs *args)
|
||||
static void sun4v_init(MachineState *machine)
|
||||
{
|
||||
sun4uv_init(get_system_memory(), args, &hwdefs[1]);
|
||||
sun4uv_init(get_system_memory(), machine, &hwdefs[1]);
|
||||
}
|
||||
|
||||
/* Niagara hardware initialisation */
|
||||
static void niagara_init(QEMUMachineInitArgs *args)
|
||||
static void niagara_init(MachineState *machine)
|
||||
{
|
||||
sun4uv_init(get_system_memory(), args, &hwdefs[2]);
|
||||
sun4uv_init(get_system_memory(), machine, &hwdefs[2]);
|
||||
}
|
||||
|
||||
static QEMUMachine sun4u_machine = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue