From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Blake Subject: Re: [Qemu-devel] [PATCH 1/2] hostmem: fix QEMU crash by 'info memdev' Date: Fri, 15 Jul 2016 11:16:15 -0600 Message-ID: <57891A5F.8000908@redhat.com> References: <1468383486-108169-1-git-send-email-guangrong.xiao@linux.intel.com> <945b233e-286f-fc22-8837-761e1ac2e522@redhat.com> <87r3ax6ajl.fsf@dusky.pond.sub.org> <0c7f2d23-92c0-8478-7262-6cdd2b800d5d@redhat.com> <57888925.9040500@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xr5P1ATxJq7X5riKCr065CtU2A0LgxaWI" Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, rth@twiddle.net To: Xiao Guangrong , Paolo Bonzini , Markus Armbruster Return-path: Received: from mx1.redhat.com ([209.132.183.28]:55102 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751490AbcGORQR (ORCPT ); Fri, 15 Jul 2016 13:16:17 -0400 In-Reply-To: <57888925.9040500@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xr5P1ATxJq7X5riKCr065CtU2A0LgxaWI Content-Type: multipart/mixed; boundary="3fbFjwQmMqiVppqG2C6AthXPAqwHFk06B" From: Eric Blake To: Xiao Guangrong , Paolo Bonzini , Markus Armbruster Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, rth@twiddle.net Message-ID: <57891A5F.8000908@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] hostmem: fix QEMU crash by 'info memdev' References: <1468383486-108169-1-git-send-email-guangrong.xiao@linux.intel.com> <945b233e-286f-fc22-8837-761e1ac2e522@redhat.com> <87r3ax6ajl.fsf@dusky.pond.sub.org> <0c7f2d23-92c0-8478-7262-6cdd2b800d5d@redhat.com> <57888925.9040500@linux.intel.com> In-Reply-To: <57888925.9040500@linux.intel.com> --3fbFjwQmMqiVppqG2C6AthXPAqwHFk06B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/15/2016 12:56 AM, Xiao Guangrong wrote: >>> Note that you don't have to call visit_next_list() in a virtual visit= =2E >>> For an example, see prop_get_fdt(). Good enough already? >> >> Yes, definitely! I'm queueing Guangrong's patch because it fixes a >> crash and the leak existed before, but without next_list we can indeed= >> visit a "virtual" list and fix the leak. It can be done during the -r= c >> period. >=20 > So you want to build uint16List list and save it as a "virtual" list in= > host_memory_backend_get_host_nodes(), then its caller can directly fetc= h > this 'virtual' list from the visit? With a virtual list visit, you don't even need a uint16List object. Merely call visit_start_list(NULL) to start the list with no matching uint16List, then visit_type_int16() for each list element (note no visit_next_list() calls), then visit_end_list(). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --3fbFjwQmMqiVppqG2C6AthXPAqwHFk06B-- --xr5P1ATxJq7X5riKCr065CtU2A0LgxaWI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXiRpfAAoJEKeha0olJ0NqcAoIAJWfIBfA3i6brgsfoPogFkdw qdabGUhGAolysebn1ccMjybt7WxhJ3o/x1VpQ0U6xUCUhTZ6igwcEn4+4aNE3zeU gwiULf+x8+B/LhuDTex+gGp88vLAtPRXsoWe4Cek+dnMNXQBEaW0ogNu033OwMHV tHw8YfRqXsIUVaLKtrYXuezl/Q6L3rPQszxFF3hVMTFNt4R8ZDmLC5L3bfhQObfC eFjuAf8q453IzyGV0RLBZ3s12atsVY/2e13EZfIrsVX1sf1MsX6h61uuZY9M5iCK pgYfhcBKxja3gFpsY+kN1FaXNFxthHT0BZO3xeWaOlr4waHlEe7CItgKZnsMY3c= =tE7n -----END PGP SIGNATURE----- --xr5P1ATxJq7X5riKCr065CtU2A0LgxaWI-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40109) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO6ir-0005cH-Dy for qemu-devel@nongnu.org; Fri, 15 Jul 2016 13:16:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO6io-0006LW-8U for qemu-devel@nongnu.org; Fri, 15 Jul 2016 13:16:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO6io-0006LA-04 for qemu-devel@nongnu.org; Fri, 15 Jul 2016 13:16:18 -0400 References: <1468383486-108169-1-git-send-email-guangrong.xiao@linux.intel.com> <945b233e-286f-fc22-8837-761e1ac2e522@redhat.com> <87r3ax6ajl.fsf@dusky.pond.sub.org> <0c7f2d23-92c0-8478-7262-6cdd2b800d5d@redhat.com> <57888925.9040500@linux.intel.com> From: Eric Blake Message-ID: <57891A5F.8000908@redhat.com> Date: Fri, 15 Jul 2016 11:16:15 -0600 MIME-Version: 1.0 In-Reply-To: <57888925.9040500@linux.intel.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xr5P1ATxJq7X5riKCr065CtU2A0LgxaWI" Subject: Re: [Qemu-devel] [PATCH 1/2] hostmem: fix QEMU crash by 'info memdev' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xiao Guangrong , Paolo Bonzini , Markus Armbruster Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, rth@twiddle.net This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xr5P1ATxJq7X5riKCr065CtU2A0LgxaWI From: Eric Blake To: Xiao Guangrong , Paolo Bonzini , Markus Armbruster Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, rth@twiddle.net Message-ID: <57891A5F.8000908@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] hostmem: fix QEMU crash by 'info memdev' References: <1468383486-108169-1-git-send-email-guangrong.xiao@linux.intel.com> <945b233e-286f-fc22-8837-761e1ac2e522@redhat.com> <87r3ax6ajl.fsf@dusky.pond.sub.org> <0c7f2d23-92c0-8478-7262-6cdd2b800d5d@redhat.com> <57888925.9040500@linux.intel.com> In-Reply-To: <57888925.9040500@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/15/2016 12:56 AM, Xiao Guangrong wrote: >>> Note that you don't have to call visit_next_list() in a virtual visit= =2E >>> For an example, see prop_get_fdt(). Good enough already? >> >> Yes, definitely! I'm queueing Guangrong's patch because it fixes a >> crash and the leak existed before, but without next_list we can indeed= >> visit a "virtual" list and fix the leak. It can be done during the -r= c >> period. >=20 > So you want to build uint16List list and save it as a "virtual" list in= > host_memory_backend_get_host_nodes(), then its caller can directly fetc= h > this 'virtual' list from the visit? With a virtual list visit, you don't even need a uint16List object. Merely call visit_start_list(NULL) to start the list with no matching uint16List, then visit_type_int16() for each list element (note no visit_next_list() calls), then visit_end_list(). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --xr5P1ATxJq7X5riKCr065CtU2A0LgxaWI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXiRpfAAoJEKeha0olJ0NqcAoIAJWfIBfA3i6brgsfoPogFkdw qdabGUhGAolysebn1ccMjybt7WxhJ3o/x1VpQ0U6xUCUhTZ6igwcEn4+4aNE3zeU gwiULf+x8+B/LhuDTex+gGp88vLAtPRXsoWe4Cek+dnMNXQBEaW0ogNu033OwMHV tHw8YfRqXsIUVaLKtrYXuezl/Q6L3rPQszxFF3hVMTFNt4R8ZDmLC5L3bfhQObfC eFjuAf8q453IzyGV0RLBZ3s12atsVY/2e13EZfIrsVX1sf1MsX6h61uuZY9M5iCK pgYfhcBKxja3gFpsY+kN1FaXNFxthHT0BZO3xeWaOlr4waHlEe7CItgKZnsMY3c= =tE7n -----END PGP SIGNATURE----- --xr5P1ATxJq7X5riKCr065CtU2A0LgxaWI--