From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoXQW-0008Jb-Ho for qemu-devel@nongnu.org; Tue, 10 Jul 2012 06:12:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoXQQ-00017g-9a for qemu-devel@nongnu.org; Tue, 10 Jul 2012 06:12:16 -0400 Received: from cantor2.suse.de ([195.135.220.15]:58457 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoXQQ-00017Y-01 for qemu-devel@nongnu.org; Tue, 10 Jul 2012 06:12:10 -0400 Message-ID: <4FFBFFF5.6010809@suse.de> Date: Tue, 10 Jul 2012 12:12:05 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1341900967-4344-1-git-send-email-qemulist@gmail.com> <1341900967-4344-5-git-send-email-qemulist@gmail.com> <4FFBEAD7.6060705@redhat.com> In-Reply-To: <4FFBEAD7.6060705@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/5] qom-cpu: during cpu reset, it will reset its child List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Blue Swirl , Jan Kiszka , Liu Ping Fan , Anthony Liguori , qemu-devel@nongnu.org Am 10.07.2012 10:41, schrieb Paolo Bonzini: > Il 10/07/2012 08:16, Liu Ping Fan ha scritto: >> This will give the embeded logic module, such as apic has the >> opportunity to reset. >> >> Signed-off-by: Liu Ping Fan >> --- >> qom/cpu.c | 16 ++++++++++++++++ >> 1 files changed, 16 insertions(+), 0 deletions(-) >> >> diff --git a/qom/cpu.c b/qom/cpu.c >> index 5b36046..6aea8e6 100644 >> --- a/qom/cpu.c >> +++ b/qom/cpu.c >> @@ -20,10 +20,26 @@ >> =20 >> #include "qemu/cpu.h" >> #include "qemu-common.h" >> +#include "hw/qdev.h" >> + >> +static int cpu_reset_kid(Object *child, void *opaque) >> +{ >> + if (object_is_type_str(child, TYPE_DEVICE)) { >> + device_reset(DEVICE(child)); >> + } else if (object_is_type_str(child, TYPE_BUS)) { >> + bus_reset(BUS(child)); >> + } else { >> + printf("cpu's child must be DEVICE or BUS"); >> + abort(); >> + } >> + return 0; >> +} >> =20 >> void cpu_reset(CPUState *cpu) >> { >> CPUClass *klass =3D CPU_GET_CLASS(cpu); >> + Object *obj =3D OBJECT(cpu); >> + object_child_foreach(obj, cpu_reset_kid, NULL); >=20 > Ok, now I see what you want to do. Next time, please add meaningful > commit messages to all patches in the series, even those that only add > infrastructure. >=20 > It really looks like time is ripe to make CPUs children of Device, so > you can just use qdev_reset_all to reset the CPU. While we agree on that goal, the way there has proven controversial, please review and comment on the two approaches around. One thing we definitely need to do is to split up qdev.h. Andreas --=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