From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlRLe-0005pd-LM for qemu-devel@nongnu.org; Sat, 08 Jun 2013 18:10:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlRLd-0005cQ-Ky for qemu-devel@nongnu.org; Sat, 08 Jun 2013 18:10:58 -0400 Received: from cantor2.suse.de ([195.135.220.15]:45065 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlRLd-0005cM-Bw for qemu-devel@nongnu.org; Sat, 08 Jun 2013 18:10:57 -0400 Message-ID: <51B3ABEA.6000503@suse.de> Date: Sun, 09 Jun 2013 00:10:50 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1370626087-840-1-git-send-email-jjherne@us.ibm.com> <1370626087-840-6-git-send-email-jjherne@us.ibm.com> In-Reply-To: <1370626087-840-6-git-send-email-jjherne@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 5/8] [PATCH RFC v2] s390-qemu: cpu hotplug - Introduce post-cpu-init function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Jason J. Herne" Cc: ehabkost@redhat.com, qemu-devel@nongnu.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, imammedo@redhat.com Am 07.06.2013 19:28, schrieb Jason J. Herne: > From: "Jason J. Herne" >=20 > In preparation for treating cpus as devices CPUs *are* devices since multiple releases now, so this is badly put. > we need to separate machine > initialization into two stages: > 1. Initialization that needs to be done before cpu devices can be creat= ed. > 2. Initialization that requires cpu devices to already be created. >=20 > This is accomplished by creating an optional post-cpu initialization fu= nction > for QEMUMachine. Whatever you are using it for, this sounds wrong to me. Machine init is supposed to use less code and more QOM infrastructure, with a future goal of replacing most code with a config file instantiating and wiring up devices. And please don't forget to CC me on the next CPU series. Regards, Andreas >=20 > Signed-off-by: Jason J. Herne > --- > include/hw/boards.h | 3 ++- > vl.c | 4 ++++ > 2 files changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/include/hw/boards.h b/include/hw/boards.h > index fb7c6f1..ed427a1 100644 > --- a/include/hw/boards.h > +++ b/include/hw/boards.h > @@ -19,7 +19,7 @@ typedef struct QEMUMachineInitArgs { > } QEMUMachineInitArgs; > =20 > typedef void QEMUMachineInitFunc(QEMUMachineInitArgs *args); > - > +typedef void QEMUMachineInitPostCpusFunc(void); > typedef void QEMUMachineResetFunc(void); > =20 > typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp); > @@ -29,6 +29,7 @@ typedef struct QEMUMachine { > const char *alias; > const char *desc; > QEMUMachineInitFunc *init; > + QEMUMachineInitPostCpusFunc *post_cpu_init; > QEMUMachineResetFunc *reset; > QEMUMachineHotAddCPUFunc *hot_add_cpu; > BlockInterfaceType block_default_type; > diff --git a/vl.c b/vl.c > index 47ab45d..71e1e6d 100644 > --- a/vl.c > +++ b/vl.c > @@ -4305,6 +4305,10 @@ int main(int argc, char **argv, char **envp) > .cpu_model =3D cpu_model }; > machine->init(&args); > =20 > + if (machine->post_cpu_init) { > + machine->post_cpu_init(); > + } > + > audio_init(); > =20 > cpu_synchronize_all_post_init(); --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg