From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVhgl-0000hv-3h for qemu-devel@nongnu.org; Wed, 11 Mar 2015 10:32:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVhgh-0000lN-SG for qemu-devel@nongnu.org; Wed, 11 Mar 2015 10:32:46 -0400 Received: from mail-wg0-x230.google.com ([2a00:1450:400c:c00::230]:38664) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVhgh-0000lE-Lb for qemu-devel@nongnu.org; Wed, 11 Mar 2015 10:32:43 -0400 Received: by wghl18 with SMTP id l18so9671845wgh.5 for ; Wed, 11 Mar 2015 07:32:43 -0700 (PDT) Message-ID: <55005207.4040907@gmail.com> Date: Wed, 11 Mar 2015 16:32:39 +0200 From: Marcel Apfelbaum MIME-Version: 1.0 References: <1423064635-19045-1-git-send-email-marcel@redhat.com> <1423064635-19045-7-git-send-email-marcel@redhat.com> In-Reply-To: <1423064635-19045-7-git-send-email-marcel@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/8] machine: query phandle-start machine property rather than qemu opts Reply-To: marcel@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com, james.hogan@imgtec.com, mst@redhat.com, jan.kiszka@siemens.com, agraf@suse.de, scottwood@freescale.com, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com, leon.alrae@imgtec.com, aurelien@aurel32.net On 02/04/2015 05:43 PM, Marcel Apfelbaum wrote: > Fixes a QEMU crash when passing phandle_start parameter in command line. > > Signed-off-by: Marcel Apfelbaum Please amend commit message: 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 accephandle-startssing machine properties through designated wrappers. Signed-off-by: Marcel Apfelbaum > --- > device_tree.c | 5 ++--- > hw/core/machine.c | 5 +++++ > include/hw/boards.h | 1 + > 3 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/device_tree.c b/device_tree.c > index 4cb1cd5..3d119ef 100644 > --- a/device_tree.c > +++ b/device_tree.c > @@ -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 > @@ -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) { > diff --git a/hw/core/machine.c b/hw/core/machine.c > index 0ad5b12..5ad2409 100644 > --- a/hw/core/machine.c > +++ b/hw/core/machine.c > @@ -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, > diff --git a/include/hw/boards.h b/include/hw/boards.h > index 4be3cd1..1f21bdf 100644 > --- a/include/hw/boards.h > +++ b/include/hw/boards.h > @@ -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: >