From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afiTx-0006m4-Ey for qemu-devel@nongnu.org; Tue, 15 Mar 2016 02:29:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afiTw-0006OM-AA for qemu-devel@nongnu.org; Tue, 15 Mar 2016 02:29:29 -0400 Date: Tue, 15 Mar 2016 17:15:10 +1100 From: David Gibson Message-ID: <20160315061510.GM15272@voom.fritz.box> References: <1457672078-17307-1-git-send-email-bharata@linux.vnet.ibm.com> <1457672078-17307-3-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="37cJpJlYZwAfNbm5" Content-Disposition: inline In-Reply-To: <1457672078-17307-3-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v2 2/9] exec: Do vmstate unregistration from cpu_exec_exit() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: mjrosato@linux.vnet.ibm.com, agraf@suse.de, thuth@redhat.com, pkrempa@redhat.com, ehabkost@redhat.com, aik@ozlabs.ru, qemu-devel@nongnu.org, armbru@redhat.com, borntraeger@de.ibm.com, qemu-ppc@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com, afaerber@suse.de, mdroth@linux.vnet.ibm.com --37cJpJlYZwAfNbm5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 11, 2016 at 10:24:31AM +0530, Bharata B Rao wrote: > cpu_exec_init() does vmstate_register for the CPU device. This needs to be > undone from cpu_exec_exit(). This change is needed to support CPU hot > removal. >=20 > Signed-off-by: Bharata B Rao Reviewed-by: David Gibson > --- > exec.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/exec.c b/exec.c > index 49ae593..8ddca6b 100644 > --- a/exec.c > +++ b/exec.c > @@ -634,6 +634,8 @@ static void cpu_release_index(CPUState *cpu) > =20 > void cpu_exec_exit(CPUState *cpu) > { > + CPUClass *cc =3D CPU_GET_CLASS(cpu); > + > #if defined(CONFIG_USER_ONLY) > cpu_list_lock(); > #endif > @@ -651,6 +653,13 @@ void cpu_exec_exit(CPUState *cpu) > #if defined(CONFIG_USER_ONLY) > cpu_list_unlock(); > #endif > + > + if (cc->vmsd !=3D NULL) { > + vmstate_unregister(NULL, cc->vmsd, cpu); > + } > + if (qdev_get_vmsd(DEVICE(cpu)) =3D=3D NULL) { > + vmstate_unregister(NULL, &vmstate_cpu_common, cpu); > + } > } > =20 > void cpu_exec_init(CPUState *cpu, Error **errp) --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --37cJpJlYZwAfNbm5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJW56huAAoJEGw4ysog2bOSFksP/Ay1gYYHUOaq8PWMOtuSLtdh d6Av+FFm4MOmpwU+ZNJ1xmnPSwtBrx0/il67kCShhs7er5uUfrvH75moqRd5LWdS UD6RBo7MspFSTGS6wrMWk8+alduTt4vP9f5Ilx43JpUlFcJTMlf5omX4w2hv35Oe xBjMM0YqEiA5mkvxXmgojd+puFpVKQzd20R7gslFRit4dtaTrZ9mblq7HVbdUUjh vXSNocvgTu5vDTuwlx2OayrYWS6gWgPea/UqUVb8bAJadfiIfgwuifOBb3TDRBh+ 8zwhdc55GhBbs10y0YrYNnMkrgS7RkGYSnpy3Qi0/XPY9qw4DLnv7gVy6yqZdIPO BBgL9uT2rAFzWq83S7rmI4g7Qhn2FKvEbonsIfPIfXhfDmDPPS7crBc/+saDG96K q2AeMFGUnJWmui0G6AwuPzEffHYSU62TOEMyjTkY6opLw8RSrlQaBpT7Ey+/Vv5J GvSbNFoZUSqVHGLiuRiBdStAadwXqEMG0HuNasf/fmiqjqJR1t4XNT1Cpcjti4O9 hpmX/ap1x+EKSCxLuBpCqA1JZUrfBwZcULDzUMf0R4IUC+PSqIZv0MQanJPXvVR8 zUcqvk+OeXtMZW1o1dRwjEO0uY1/yWXATwR2SRYFxwXWDRzuoLE+cklRwEPfVzyF 0qrY3xSytZYbWpCNHkUj =y2Dt -----END PGP SIGNATURE----- --37cJpJlYZwAfNbm5--