From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USayv-0008Au-5c for qemu-devel@nongnu.org; Wed, 17 Apr 2013 18:37:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USayu-0003fH-22 for qemu-devel@nongnu.org; Wed, 17 Apr 2013 18:37:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USayt-0003f1-MX for qemu-devel@nongnu.org; Wed, 17 Apr 2013 18:37:35 -0400 Message-ID: <516F1B00.8080402@redhat.com> Date: Wed, 17 Apr 2013 15:58:24 -0600 From: Eric Blake MIME-Version: 1.0 References: <1365843407-16504-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1365843407-16504-8-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1365843407-16504-8-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2GSXNTDAMVTDESSTMACPV" Subject: Re: [Qemu-devel] [PATCH V12 07/18] block: change VM snapshot checking logic List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, phrdina@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, stefanha@gmail.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2GSXNTDAMVTDESSTMACPV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/13/2013 02:56 AM, Wenchao Xia wrote: > Original logic is different with load_vmstate(), this patch change it= s/with/from/ s/change/changes/ > to be exactly the same with load_vmstate(), so any VM snapshot shown in= s/with/as/ > qmp/hmp should succeed in load_vmstate(). Looking through git logs, most people use blank lines and start at column 1, rather than your idiom of 2-space indent and no blank line, when starting a new paragraph. > Note that, runtime snapshot info maybe different with what is got s/that,/that consistent/ s/maybe different with/may be a subset of/ s/got/listed/ > in "qemu-img info" as static snapshot info, and this patch clearly > tips it. s/tips/identifies/ >=20 > Signed-off-by: Wenchao Xia > --- > block/qapi.c | 13 ++++++++++++- > 1 files changed, 12 insertions(+), 1 deletions(-) Reviewed-by: Eric Blake >=20 > diff --git a/block/qapi.c b/block/qapi.c > index 97c5cd4..49c0eb0 100644 > --- a/block/qapi.c > +++ b/block/qapi.c > @@ -46,7 +46,18 @@ static bool snapshot_valid_for_vm(const QEMUSnapshot= Info *sn, > take snapshot, for example, readonly ones, will be ignored in > load_vmstate(). */ > while ((bs1 =3D bdrv_next(bs1))) { > - if (bs1 !=3D bs && bdrv_can_snapshot(bs1)) { > + A blank line after a while(){ is not common, but as it is only whitespace, and checkpatch didn't complain, it doesn't hold up my review.= > + if (!bdrv_is_inserted(bs1) || bdrv_is_read_only(bs1)) { > + continue; > + } > + > + if (!bdrv_can_snapshot(bs1)) { > + /* Device is writable but does not support snapshots, will= be > + rejected by load_vmstate(). */ > + return false; > + } > + > + if (bs1 !=3D bs) { > ret =3D bdrv_snapshot_find(bs1, sn_info, sn->id_str, NULL)= ; > if (ret < 0) { > return false; >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2GSXNTDAMVTDESSTMACPV 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/ iQEcBAEBCAAGBQJRbxsAAAoJEKeha0olJ0NqNPwH/3zzneOq2btF/7d6LjtGuSQa 1+wOpX+JwLdog+R3NYOZ0GRIBs0WKv8izzvsHdVPUS43d6vNFBbIvNTKwE8ykGEg Isio3MxGc/24y3BCxb3C3c1R04zooePKYXMzbNiqFzgFQyuj9fS5+lacDSCVyjuZ O3VV4oJE18GmOjsMBNi/1obrf/iOy2eazMoMP0W4zWdtmcB+Rmo9gzPglQujG96m 0ATZLR4qRvZ2zCDpWL1vxZgEJF0OkNf8EqB2Kxztv1+na6asAryANOFFgImDwYZH gALQBMbJowd5111zNyWfmRMJJ1dF8SbF0/ZrRKzxgQH/sUFxAuR4GtLs1HHepJk= =QZZ2 -----END PGP SIGNATURE----- ------enig2GSXNTDAMVTDESSTMACPV--