From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXXBG-0004tH-Nz for qemu-devel@nongnu.org; Fri, 26 Sep 2014 11:11:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXXB6-0004R7-Ra for qemu-devel@nongnu.org; Fri, 26 Sep 2014 11:11:34 -0400 Received: from mail-we0-x22f.google.com ([2a00:1450:400c:c03::22f]:55394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXXB6-0004PZ-L1 for qemu-devel@nongnu.org; Fri, 26 Sep 2014 11:11:24 -0400 Received: by mail-we0-f175.google.com with SMTP id u57so8975010wes.34 for ; Fri, 26 Sep 2014 08:11:18 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <54258213.4060705@redhat.com> Date: Fri, 26 Sep 2014 17:11:15 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1409344310-5441-1-git-send-email-ehabkost@redhat.com> <1409344310-5441-17-git-send-email-ehabkost@redhat.com> In-Reply-To: <1409344310-5441-17-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 16/17] accel: Save AccelState on MachineState when initializing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Michael Mueller , "Michael S. Tsirkin" , Marcel Apfelbaum , Alexander Graf , Christian Borntraeger , "Jason J. Herne" , =?windows-1252?Q?Andreas_?= =?windows-1252?Q?F=E4rber?= Il 29/08/2014 22:31, Eduardo Habkost ha scritto: > This will allow machine initialization code to get the accelerator > object if necessary. > > Signed-off-by: Eduardo Habkost > --- > hw/core/accel.c | 3 +++ > include/hw/boards.h | 1 + > include/qemu/typedefs.h | 2 ++ > 3 files changed, 6 insertions(+) > > diff --git a/hw/core/accel.c b/hw/core/accel.c > index 66ee1fa..2e1ea76 100644 > --- a/hw/core/accel.c > +++ b/hw/core/accel.c > @@ -32,6 +32,7 @@ > #include "sysemu/qtest.h" > #include "hw/xen/xen.h" > #include "qom/object.h" > +#include "hw/boards.h" > > int tcg_tb_size; > static bool tcg_allowed = true; > @@ -64,9 +65,11 @@ static int accel_init_machine(AccelClass *acc, MachineState *ms) > const char *cname = object_class_get_name(oc); > AccelState *accel = ACCEL(object_new(cname)); > int ret; > + ms->accelerator = accel; > *(acc->allowed) = true; > ret = acc->init_machine(ms); > if (ret < 0) { > + ms->accelerator = NULL; > *(acc->allowed) = false; > object_unref(OBJECT(accel)); > } > diff --git a/include/hw/boards.h b/include/hw/boards.h > index 605a970..1cff2b4 100644 > --- a/include/hw/boards.h > +++ b/include/hw/boards.h > @@ -132,6 +132,7 @@ struct MachineState { > char *kernel_cmdline; > char *initrd_filename; > const char *cpu_model; > + AccelState *accelerator; > }; > > #endif > diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h > index 04df51b..446af93 100644 > --- a/include/qemu/typedefs.h > +++ b/include/qemu/typedefs.h > @@ -30,6 +30,8 @@ typedef struct MemoryListener MemoryListener; > > typedef struct MemoryMappingList MemoryMappingList; > > +typedef struct AccelState AccelState; > + > typedef struct QEMUMachine QEMUMachine; > typedef struct MachineClass MachineClass; > typedef struct MachineState MachineState; > I would just squash this with the previous patch. Apart from this, Reviewed-by: Paolo Bonzini Paolo