Skip to content

Commit

Permalink
machine: query phandle-start machine property
Browse files Browse the repository at this point in the history
Commit e79d5a6 ("machine: remove qemu_machine_opts global list") removed
the global option descriptions and moved them to MachineState's QOM
properties.

Query phandle-start by accessing machine properties through designated
wrappers.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
marcel-apf authored and mstsirkin committed Mar 11, 2015
1 parent 4689b77 commit 6cabe7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions device_tree.c
Expand Up @@ -24,7 +24,7 @@
#include "sysemu/device_tree.h"
#include "sysemu/sysemu.h"
#include "hw/loader.h"
#include "qemu/option.h"
#include "hw/boards.h"
#include "qemu/config-file.h"

#include <libfdt.h>
Expand Down Expand Up @@ -245,8 +245,7 @@ uint32_t qemu_fdt_alloc_phandle(void *fdt)
* which phandle id to start allocting phandles.
*/
if (!phandle) {
phandle = qemu_opt_get_number(qemu_get_machine_opts(),
"phandle_start", 0);
phandle = machine_phandle_start(current_machine);
}

if (!phandle) {
Expand Down
5 changes: 5 additions & 0 deletions hw/core/machine.c
Expand Up @@ -420,6 +420,11 @@ int machine_kvm_shadow_mem(MachineState *machine)
return machine->kvm_shadow_mem;
}

int machine_phandle_start(MachineState *machine)
{
return machine->phandle_start;
}

static const TypeInfo machine_info = {
.name = TYPE_MACHINE,
.parent = TYPE_OBJECT,
Expand Down
1 change: 1 addition & 0 deletions include/hw/boards.h
Expand Up @@ -70,6 +70,7 @@ bool machine_iommu(MachineState *machine);
bool machine_kernel_irqchip_allowed(MachineState *machine);
bool machine_kernel_irqchip_required(MachineState *machine);
int machine_kvm_shadow_mem(MachineState *machine);
int machine_phandle_start(MachineState *machine);

/**
* MachineClass:
Expand Down

0 comments on commit 6cabe7f

Please sign in to comment.