mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
hw/boards: Convert current_machine to MachineState
In order to allow attaching machine options to a machine instance, current_machine is converted into MachineState. As a first step of deprecating QEMUMachine, some of the functions were modified to return MachineClass. Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
261747f176
commit
0056ae24bc
4 changed files with 53 additions and 36 deletions
|
|
@ -33,12 +33,14 @@ DriveInfo *add_init_drive(const char *optstr)
|
|||
{
|
||||
DriveInfo *dinfo;
|
||||
QemuOpts *opts;
|
||||
MachineClass *mc;
|
||||
|
||||
opts = drive_def(optstr);
|
||||
if (!opts)
|
||||
return NULL;
|
||||
|
||||
dinfo = drive_init(opts, current_machine->block_default_type);
|
||||
mc = MACHINE_GET_CLASS(current_machine);
|
||||
dinfo = drive_init(opts, mc->qemu_machine->block_default_type);
|
||||
if (!dinfo) {
|
||||
qemu_opts_del(opts);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue