From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR12z-0001C3-LK for qemu-devel@nongnu.org; Tue, 01 Oct 2013 10:35:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VR12l-00086R-4I for qemu-devel@nongnu.org; Tue, 01 Oct 2013 10:35:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR12k-000851-S4 for qemu-devel@nongnu.org; Tue, 01 Oct 2013 10:35:19 -0400 Message-ID: <524ADDA2.9020806@redhat.com> Date: Tue, 01 Oct 2013 08:35:14 -0600 From: Eric Blake MIME-Version: 1.0 References: <1380154568-5339-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1380154568-5339-2-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1380154568-5339-2-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="d2EIjG3b7eI2Vv0Hb3X6UOMJ670FW3aGD" Subject: Re: [Qemu-devel] [PATCH V3 1/7] snapshot: distinguish id and name in load_tmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@gmail.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --d2EIjG3b7eI2Vv0Hb3X6UOMJ670FW3aGD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/25/2013 06:16 PM, Wenchao Xia wrote: > Since later this function will be used so improve it. The only caller o= f it > now is qemu-img, and it is not impacted by introduce function > bdrv_snapshot_load_tmp_by_id_or_name() that call bdrv_snapshot_load_tmp= () > twice to keep old search logic. bdrv_snapshot_load_tmp_by_id_or_name() = return > int to let caller know the errno, and errno will be used later. >=20 > Signed-off-by: Wenchao Xia > --- > block/qcow2-snapshot.c | 16 +++++++++++- > block/qcow2.h | 5 +++- > block/snapshot.c | 58 +++++++++++++++++++++++++++++++++++++= ++++++- > include/block/block_int.h | 4 ++- > include/block/snapshot.h | 7 ++++- > qemu-img.c | 8 ++++- > 6 files changed, 89 insertions(+), 9 deletions(-) >=20 > + * > + * If both @snapshot_id and @name are specified, load the first one wi= th > + * id @snapshot_id and name @name. > + * If only @snapshot_id is specified, load the first one with id > + * @snapshot_id. > + * If only @name is specified, load the first one with name @name. > + * if none is specified, return -ENINVAL. s/ENINVAL/EINVAL/ > + * > + * Returns: 0 on success, -errno on fail. If @bs is not inserted, retu= rn > + * -ENOMEDIUM. If @bs is not readonly, return -EINVAL. If @bs did not = support > + * internal snapshot, return -ENOTSUP. If qemu can't find one matching= @id and > + * @name, return -ENOENT. If @bs do not support parameter @snapshot_id= or s/do/does/ --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --d2EIjG3b7eI2Vv0Hb3X6UOMJ670FW3aGD 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.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSSt2iAAoJEKeha0olJ0NqZ/MH/ibvlsSsDeKuJ/plnYiHUQxm syEamY7V6SMHjC16c86JGOv2EwFsWPkbJilqfGlU9Kxlsnn5fuT0FRczqMyDJZ/n S1fQs8Da29gsq3Nl4VfVCtIKBnlcX5YiseI9JkvciLGPiDgZo2qMH6GLdyNSLAnP CXSe7i7U5ntIX4PpKBCbGH2KdatOxz6+p+B7RpCF/tT11AMkARF5g7KpelkB1J6p 6OD349vyFvSWGhpejc7gMWEJHXz3FmVwwBPUBbgNhpQIQDPyxEl/7xmKei8jP6ka h6pDKre7Ql5rZ7m+zzz89jFDHdrQvJGM1+lswedWsYWISFvSEODyfUqX7EIEKcw= =nb1u -----END PGP SIGNATURE----- --d2EIjG3b7eI2Vv0Hb3X6UOMJ670FW3aGD--