From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USGs4-0002zW-Hq for qemu-devel@nongnu.org; Tue, 16 Apr 2013 21:09:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USGs3-0007NZ-Ed for qemu-devel@nongnu.org; Tue, 16 Apr 2013 21:09:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USGs3-0007NJ-5e for qemu-devel@nongnu.org; Tue, 16 Apr 2013 21:09:11 -0400 Message-ID: <516DF632.5080803@redhat.com> Date: Tue, 16 Apr 2013 19:09:06 -0600 From: Eric Blake MIME-Version: 1.0 References: <1365843407-16504-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1365843407-16504-3-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1365843407-16504-3-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2ECAIRHRXKGOQWOCSXONB" Subject: Re: [Qemu-devel] [PATCH V12 02/18] block: distinguish id and name in bdrv_find_snapshot() 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) ------enig2ECAIRHRXKGOQWOCSXONB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/13/2013 02:56 AM, Wenchao Xia wrote: > To make it clear about id and name in searching, the API is changed > a bit to distinguish them, and caller can choose to search by id or nam= e. > Searching will be done with higher priority of id. This function also > returns negative value from bdrv_snapshot_list() instead of -ENOENT on > error now. > Note that the logic is changed a bit: now it traverse twice, first se= arch > for id, second for name, but original code traverse only once to search= > them at the same time, so matching sequence may be different. As a resu= lt, > do_savevm(), del_existing_snapshots(), load_vmsate() may behaviors diff= erently > if there are unwisely chosen name mixed with id. In do_info_snapshots()= , > the caller is changed to search id only, which should be the correct be= havior. I just realized that you are trying to do the same thing as Pavel, but that your two implementations differ. https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg03289.html Rather than spending my time reviewing two competing versions, it would be really nice if one of you could rebase patches on top of the other, and present a unified series containing both of your improvements as a single series, so that we are only changing bdrv_snapshot_list semantics once. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2ECAIRHRXKGOQWOCSXONB 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/ iQEcBAEBCAAGBQJRbfYyAAoJEKeha0olJ0NqzBEH/1Hn+jrn1hNqVkTsnqIgwUVh GlFd4rU3aESHzAbvEgj3nB14mwkhjU3JAM4FKBA1VVLwJxZCyArcClP9WldjUdUY 7CUUhOTB76Zuf4ecJZkrKQuNncjUa4TwnsBgauF3YBg+VtOlR4wPWoq4XLNQRd7k epnPjpyHbvmEoYr1xoUEJUE3t1A3JTfuwjN3p3snt8tNZF1Uhn5A5acAsAQOiSTk aVh4786w87paJJJJ6zx4ImnoQ19vBCdklF8e4/FdJQq93TEKmDY5N0DTWwgdqiZx N5mYuN6AEFvNN0k+uHWqn2DvU/Y1+MWm336dypIt8bAxqAMecagr3PWdroEojBE= =crs/ -----END PGP SIGNATURE----- ------enig2ECAIRHRXKGOQWOCSXONB--