qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Benoît Canet" <benoit.canet@irqsave.net>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, "Benoît Canet" <benoit.canet@irqsave.net>,
	famz@redhat.com, "Benoit Canet" <benoit@irqsave.net>,
	jcody@redhat.com, armbru@redhat.com, mreitz@redhat.com,
	stefanha@redhat.com
Subject: [Qemu-devel] [PATCH] block: Fix device snapshots broken by the block filter snapshots patchset.
Date: Mon, 10 Feb 2014 21:25:35 +0100	[thread overview]
Message-ID: <1392063935-12263-1-git-send-email-benoit.canet@irqsave.net> (raw)

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 <benoit@irqsave.net>
---
 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	other threads:[~2014-02-10 20:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392063935-12263-1-git-send-email-benoit.canet@irqsave.net \
    --to=benoit.canet@irqsave.net \
    --cc=armbru@redhat.com \
    --cc=benoit@irqsave.net \
    --cc=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).