From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsOsx-0002Hj-5l for qemu-devel@nongnu.org; Mon, 07 Jan 2013 21:25:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsOsw-00089y-2V for qemu-devel@nongnu.org; Mon, 07 Jan 2013 21:25:51 -0500 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:37086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsOsv-00089k-HE for qemu-devel@nongnu.org; Mon, 07 Jan 2013 21:25:49 -0500 Received: from /spool/local by e23smtp06.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Jan 2013 12:22:04 +1000 Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [9.190.235.152]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 8660F357804F for ; Tue, 8 Jan 2013 13:25:41 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r082E3ME60358850 for ; Tue, 8 Jan 2013 13:14:04 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r082Pehp024889 for ; Tue, 8 Jan 2013 13:25:40 +1100 Message-ID: <50EB8392.5000207@linux.vnet.ibm.com> Date: Tue, 08 Jan 2013 10:25:22 +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> In-Reply-To: <50EAFB3C.5050305@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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 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. > Kevin > -- Best Regards Wenchao Xia