From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCxQH-0007OB-F6 for qemu-devel@nongnu.org; Mon, 10 Feb 2014 15:25:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCxQ9-0005bR-Uy for qemu-devel@nongnu.org; Mon, 10 Feb 2014 15:25:45 -0500 Received: from paradis.irqsave.net ([62.212.105.220]:49618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCxQ9-0005bD-HT for qemu-devel@nongnu.org; Mon, 10 Feb 2014 15:25:37 -0500 From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Mon, 10 Feb 2014 21:25:35 +0100 Message-Id: <1392063935-12263-1-git-send-email-benoit.canet@irqsave.net> Subject: [Qemu-devel] [PATCH] block: Fix device snapshots broken by the block filter snapshots patchset. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= , famz@redhat.com, Benoit Canet , jcody@redhat.com, armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com Take into account the fact that a block filter like quorum will be in bs->file while a regular block driver device is really on the top level. Signed-off-by: Benoit Canet --- block.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 07ac50a..6ace45c 100644 --- a/block.c +++ b/block.c @@ -5402,12 +5402,14 @@ bool bdrv_is_first_non_filter(BlockDriverState *candidate) QTAILQ_FOREACH(bs, &bdrv_states, device_list) { bool perm; - if (!bs->file) { - continue; + if (bs->file && + bs->file->drv && + bs->file->drv->authorizations[BS_IS_A_FILTER]) { + perm = bdrv_recurse_is_first_non_filter(bs->file, candidate); + } else { + perm = bdrv_recurse_is_first_non_filter(bs, candidate); } - perm = bdrv_recurse_is_first_non_filter(bs->file, candidate); - /* candidate is the first non filter */ if (perm) { return true; -- 1.8.3.2