vl: make qemu_get_machine_opts static

Machine options can be retrieved as properties of the machine object.
Encourage that by removing the "easy" accessor to machine options.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Paolo Bonzini 2020-11-02 09:44:36 -05:00
parent 55810e90cc
commit f2ce39b4f0
12 changed files with 26 additions and 39 deletions

View file

@ -343,9 +343,8 @@ static int ppce500_load_device_tree(PPCE500MachineState *pms,
pmc->pci_pio_base >> 32, pmc->pci_pio_base,
0x0, 0x10000,
};
QemuOpts *machine_opts = qemu_get_machine_opts();
const char *dtb_file = qemu_opt_get(machine_opts, "dtb");
const char *toplevel_compat = qemu_opt_get(machine_opts, "dt_compatible");
const char *dtb_file = machine->dtb;
const char *toplevel_compat = machine->dt_compatible;
if (dtb_file) {
char *filename;

View file

@ -152,7 +152,7 @@ static int xilinx_load_device_tree(hwaddr addr,
int r;
const char *dtb_filename;
dtb_filename = qemu_opt_get(qemu_get_machine_opts(), "dtb");
dtb_filename = current_machine->dtb;
if (dtb_filename) {
fdt = load_device_tree(dtb_filename, &fdt_size);
if (!fdt) {