From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl4OX-0005Xd-CN for qemu-devel@nongnu.org; Tue, 18 Dec 2012 16:08:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tl4OW-0001f4-17 for qemu-devel@nongnu.org; Tue, 18 Dec 2012 16:08:09 -0500 Received: from cantor2.suse.de ([195.135.220.15]:59858 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl4OV-0001eq-NJ for qemu-devel@nongnu.org; Tue, 18 Dec 2012 16:08:07 -0500 Message-ID: <50D0DB2B.1030304@suse.de> Date: Tue, 18 Dec 2012 22:07:55 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1354740282-20679-1-git-send-email-pbonzini@redhat.com> <1354740282-20679-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1354740282-20679-11-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 10/11] cpu: do not use object_delete List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Igor Mammedov , aliguori@us.ibm.com, qemu-devel@nongnu.org, Eduardo Habkost Am 05.12.2012 21:44, schrieb Paolo Bonzini: > CPUs are never added to the composition tree, so delete is achieved > simply by removing the last references to them. >=20 > Signed-off-by: Paolo Bonzini Reviewed-by: Andreas F=E4rber Note however that x86 is undergoing major changes and other targets are growing needs to ... "deconstruct" :) CPUs, too. So this is very likely to conflict. As I understand it, I can't just unparent a CPU today as it would not get freed? Andreas > --- > linux-user/syscall.c | 2 +- > target-i386/helper.c | 4 ++-- > target-sparc/cpu.c | 2 +- > 3 files changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index e4291ed..64b2610 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -5188,7 +5188,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_l= ong arg1, > NULL, NULL, 0); > } > thread_env =3D NULL; > - object_delete(OBJECT(ENV_GET_CPU(cpu_env))); > + object_unref(OBJECT(ENV_GET_CPU(cpu_env))); > g_free(ts); > pthread_exit(NULL); > } > diff --git a/target-i386/helper.c b/target-i386/helper.c > index bf206cf..d628352 100644 > --- a/target-i386/helper.c > +++ b/target-i386/helper.c > @@ -1251,14 +1251,14 @@ X86CPU *cpu_x86_init(const char *cpu_model) > env->cpu_model_str =3D cpu_model; > =20 > if (cpu_x86_register(cpu, cpu_model) < 0) { > - object_delete(OBJECT(cpu)); > + object_unref(OBJECT(cpu)); > return NULL; > } > =20 > x86_cpu_realize(OBJECT(cpu), &error); > if (error) { > error_free(error); > - object_delete(OBJECT(cpu)); > + object_unref(OBJECT(cpu)); > return NULL; > } > return cpu; > diff --git a/target-sparc/cpu.c b/target-sparc/cpu.c > index 882d306..b38641b 100644 > --- a/target-sparc/cpu.c > +++ b/target-sparc/cpu.c > @@ -119,7 +119,7 @@ SPARCCPU *cpu_sparc_init(const char *cpu_model) > } > =20 > if (cpu_sparc_register(env, cpu_model) < 0) { > - object_delete(OBJECT(cpu)); > + object_unref(OBJECT(cpu)); > return NULL; > } > qemu_init_vcpu(env); --=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