qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] block: Fix device snapshots broken by the block fil


From: Benoît Canet
Subject: [Qemu-devel] [PATCH] block: Fix device snapshots broken by the block filter snapshots patchset.
Date: Mon, 10 Feb 2014 21:25:35 +0100

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]