From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU8xv-0000vF-14 for qemu-devel@nongnu.org; Thu, 10 Oct 2013 01:39:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VU8xm-0005mD-44 for qemu-devel@nongnu.org; Thu, 10 Oct 2013 01:39:14 -0400 Received: from e28smtp06.in.ibm.com ([122.248.162.6]:58602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VU8xl-0005lU-Dv for qemu-devel@nongnu.org; Thu, 10 Oct 2013 01:39:06 -0400 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 Oct 2013 11:08:57 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 400A6125803F for ; Thu, 10 Oct 2013 11:09:18 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r9A5fXZR41549954 for ; Thu, 10 Oct 2013 11:11:33 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r9A5crxu025179 for ; Thu, 10 Oct 2013 11:08:53 +0530 Message-ID: <52563D73.3040208@linux.vnet.ibm.com> Date: Thu, 10 Oct 2013 13:38:59 +0800 From: Wenchao Xia 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> <524ADDA2.9020806@redhat.com> In-Reply-To: <524ADDA2.9020806@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: Eric Blake Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, stefanha@gmail.com 于 2013/10/1 22:35, Eric Blake 写道: > On 09/25/2013 06:16 PM, Wenchao Xia wrote: >> Since later this function will be used so improve it. The only caller of 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. >> >> 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(-) >> >> + * >> + * If both @snapshot_id and @name are specified, load the first one with >> + * 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, return >> + * -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/ > will fix the grammar, thanks.