From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USX1D-0000mY-RB for qemu-devel@nongnu.org; Wed, 17 Apr 2013 14:23:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USX1C-0002dW-NC for qemu-devel@nongnu.org; Wed, 17 Apr 2013 14:23:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USX1C-0002dN-FT for qemu-devel@nongnu.org; Wed, 17 Apr 2013 14:23:42 -0400 Message-ID: <516EE861.8090803@redhat.com> Date: Wed, 17 Apr 2013 12:22:25 -0600 From: Eric Blake MIME-Version: 1.0 References: <13b9d1e79947b89982ec51c421b9b1bd0a7b587d.1366127809.git.phrdina@redhat.com> <516E0E9A.9050607@linux.vnet.ibm.com> <516E54AF.8070206@redhat.com> <516E774D.8080809@linux.vnet.ibm.com> <516E7EB1.8060806@redhat.com> <516EE688.1030704@redhat.com> In-Reply-To: <516EE688.1030704@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2TXHNGGTAFDRARFSMTKFF" Subject: Re: [Qemu-devel] [PATCH 11/11] savevm: remove backward compatibility from bdrv_snapshot_find() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lcapitulino@redhat.com, Wenchao Xia , Pavel Hrdina , qemu-devel@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2TXHNGGTAFDRARFSMTKFF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/17/2013 12:14 PM, Eric Blake wrote: > Or, written another way, to implement the same results in only two code= d > loops: Missed a line: >=20 > if name is set: > if there is a snapshot with that name (loop 1): > if id is set: > if id matches: > end searching successfully > else: > fail > else: > end searching successfully > else if id is not set: > set id to name These two lines should instead be: else if id is set: fail set id to name > if there is a snapshot with id (loop 2): > end searching successfully and of course, all of the algorithms have an implied fail if you make it through all of the loops without a successful search end. The tweak above is needed so that a find(id, tag) that fails a tag lookup does not then succeed on an id lookup. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2TXHNGGTAFDRARFSMTKFF 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/ iQEcBAEBCAAGBQJRbuhhAAoJEKeha0olJ0NqQicH/R9gHXteyp0T+yGLnQGB9eWk vVBbgtUAEpo9fG06ETSPIQx4NTm6mdqMLoXl7Gw1Rjf/TpmvZY9Cq2EKIZ3DDArM V6qoKaXRB0RYGXPLHkQBpfRigv0u8HWT50oMf7Ny4Ur+5O7jmN5PCWxywoT+X098 DDRVBx6ojbUddmFMFJUkd8szEvndWkKoA7VwfhZ1ZhbiZDP3NwJxTpmdxnMxhlwe xeunIwk9wOx5b5z1NcXyfNym1VjZTI/pTPYegurIJ4QP8ZDwjntFRgT69EpESgYP XGAS9rqjI+JikviEi1ekvZFVI1d67CiL3/Lyi7s+wRZ+I/IPxGJM9g+x9kIpVcE= =atQJ -----END PGP SIGNATURE----- ------enig2TXHNGGTAFDRARFSMTKFF--