From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsWZJ-00051v-BW for qemu-devel@nongnu.org; Tue, 08 Jan 2013 05:38:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsWZI-0004VT-65 for qemu-devel@nongnu.org; Tue, 08 Jan 2013 05:38:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:27047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsWZH-0004VH-UW for qemu-devel@nongnu.org; Tue, 08 Jan 2013 05:38:04 -0500 Message-ID: <50EBF704.1010801@redhat.com> Date: Tue, 08 Jan 2013 11:37:56 +0100 From: Kevin Wolf 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> In-Reply-To: <50EB8392.5000207@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Wenchao Xia Cc: blauwirbel@gmail.com, pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, stefanha@gmail.com Am 08.01.2013 03:25, schrieb Wenchao Xia: > =E4=BA=8E 2013-1-8 0:43, Kevin Wolf =E5=86=99=E9=81=93: >> Am 17.12.2012 07:25, schrieb Wenchao Xia: >>> This patch moves bdrv_snapshotfind from savevm.c to block.c and ex= port >>> 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. >=20 >>> --- >>> 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, Blo= ckDriverState *bs_top) >>> bs_new->drv ? bs_new->drv->format_name : ""); >>> } >>> >>> +/* revert the action */ >>> +void bdrv_deappend(BlockDriverState *bs_new, BlockDriverState *bs_to= p) >>> +{ >>> + 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