From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsnLG-0004ly-Q7 for qemu-devel@nongnu.org; Tue, 08 Jan 2013 23:32:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsnLF-00050B-Me for qemu-devel@nongnu.org; Tue, 08 Jan 2013 23:32:42 -0500 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:36500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsnLF-0004zm-2t for qemu-devel@nongnu.org; Tue, 08 Jan 2013 23:32:41 -0500 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 9 Jan 2013 10:01:05 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 366A4E004B for ; Wed, 9 Jan 2013 10:02:49 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r094WYuN49873112 for ; Wed, 9 Jan 2013 10:02:35 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r094WZTN028483 for ; Wed, 9 Jan 2013 15:32:35 +1100 Message-ID: <50ECF2DF.5050703@linux.vnet.ibm.com> Date: Wed, 09 Jan 2013 12:32:31 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1355725509-5429-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1355725509-5429-2-git-send-email-xiawenc@linux.vnet.ibm.com> <50EAFB3C.5050305@redhat.com> <50EB8392.5000207@linux.vnet.ibm.com> <50EBF704.1010801@redhat.com> In-Reply-To: <50EBF704.1010801@redhat.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 1/6] snapshot: export function in block.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: blauwirbel@gmail.com, pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, stefanha@gmail.com ÓÚ 2013-1-8 18:37, Kevin Wolf дµÀ: > Am 08.01.2013 03:25, schrieb Wenchao Xia: >> ÓÚ 2013-1-8 0:43, Kevin Wolf дµÀ: >>> Am 17.12.2012 07:25, schrieb Wenchao Xia: >>>> This patch moves bdrv_snapshotfind from savevm.c to block.c and export >>>> it, also added bdrv_deappend in block.c. >>>> >>>> Signed-off-by: Wenchao Xia >>> >>> Should be two separate patches. >>> >> OK, it have been split into two patches in V2. >> >>>> --- >>>> block.c | 30 ++++++++++++++++++++++++++++++ >>>> block.h | 3 +++ >>>> savevm.c | 22 ---------------------- >>>> 3 files changed, 33 insertions(+), 22 deletions(-) >>>> >>>> diff --git a/block.c b/block.c >>>> index 0668c4b..61c7c6a 100644 >>>> --- a/block.c >>>> +++ b/block.c >>>> @@ -1376,6 +1376,13 @@ void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top) >>>> bs_new->drv ? bs_new->drv->format_name : ""); >>>> } >>>> >>>> +/* revert the action */ >>>> +void bdrv_deappend(BlockDriverState *bs_new, BlockDriverState *bs_top) >>>> +{ >>>> + bdrv_swap(bs_new, bs_top); >>>> + /* this is enough? */ >>>> +} >>> >>> What will this be used for? Maybe it's better to introduce a function >>> simple as this only when it's actually used. >>> >> If bdrv_append is called before, this function should revert it, so >> new file created at the top of the backing file chain is dropped. > > Yes, I understand that. I meant which functionality/feature will make > use of the function? > > Kevin > I have used it in group snapshot transaction canceling callback, but currently it will never be executed because updating step never fail, so it can be removed but leaves a comments that need add in if an updating function which may fail.... -- Best Regards Wenchao Xia