From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGBLo-00057i-V9 for qemu-devel@nongnu.org; Thu, 14 Mar 2013 12:50:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGBLj-0004qA-02 for qemu-devel@nongnu.org; Thu, 14 Mar 2013 12:49:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGBLi-0004p9-Ob for qemu-devel@nongnu.org; Thu, 14 Mar 2013 12:49:50 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2EGnn7R014245 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Mar 2013 12:49:49 -0400 Message-ID: <5141FFAA.7090701@redhat.com> Date: Thu, 14 Mar 2013 10:49:46 -0600 From: Eric Blake MIME-Version: 1.0 References: <1363277099-26616-1-git-send-email-stefanha@redhat.com> In-Reply-To: <1363277099-26616-1-git-send-email-stefanha@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2RRPMFXXWVRSGRPFCKAUG" Subject: Re: [Qemu-devel] [PATCH] block: drop bs_snapshots global variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org, Markus Armbruster This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2RRPMFXXWVRSGRPFCKAUG Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/14/2013 10:04 AM, Stefan Hajnoczi wrote: > The bs_snapshots global variable points to the BlockDriverState which > will be used to save vmstate. This is really a savevm.c concept but wa= s > moved into block.c:bdrv_snapshots() when it became clear that hotplug > could result in a dangling pointer. >=20 > While auditing the block layer's global state I came upon bs_snapshots > and realized that a variable is not necessary here. Simply find the > first BlockDriverState capable of internal snapshots each time this is > needed. >=20 > The behavior of bdrv_snapshots() is preserved across hotplug because ne= w > drives are always appended to the bdrv_states list. This means that > calling the new find_vmstate_bs() function is idempotent - it returns > the same BlockDriverState unless it was hot-unplugged. >=20 > Signed-off-by: Stefan Hajnoczi > --- > block.c | 28 ---------------------------- > include/block/block.h | 1 - > savevm.c | 19 +++++++++++++++---- > 3 files changed, 15 insertions(+), 33 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2RRPMFXXWVRSGRPFCKAUG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRQf+rAAoJEKeha0olJ0Nq0D0H/RN585au5KTi5NuyHKQnC1vt vs8gEdye4ERbAvBQ0+jW+EhXch75pP5FXvZruiJPf8I6oIC8pnIZ4B115L8IS3DY dZhiYAZ609ZRvCJQFmNh9hqig1xPYrySb0Rwevowaa2z3BeVHWns70aaBM+OXg2Z Uqq4W2SNMzmCpMOXfycu1tOPWOqz4ula+dPeaexK/1L5EtUlIgTOBJBmhm1WEVn5 pL2B0zxX96oaTi2K5HnqU39GQHvmsa/N87P63OhIx522eN5at3omaFxJ1677LypL rIMRHXgphLxrKWVwJuUizbcLWnJ9qqh3JoFpMISLd5G/soJnsXLMCxEQeMk2yDs= =EhNB -----END PGP SIGNATURE----- ------enig2RRPMFXXWVRSGRPFCKAUG--