0a122b
From cd67eba4f11bb3d188df01dd9c30b96c7665f8f3 Mon Sep 17 00:00:00 2001
0a122b
From: Max Reitz <mreitz@redhat.com>
0a122b
Date: Mon, 17 Mar 2014 22:45:30 +0100
0a122b
Subject: [PATCH 5/6] block: bs->drv may be NULL in bdrv_debug_resume()
0a122b
0a122b
RH-Author: Max Reitz <mreitz@redhat.com>
0a122b
Message-id: <1395096331-12610-3-git-send-email-mreitz@redhat.com>
0a122b
Patchwork-id: 58120
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH 2/3] block: bs->drv may be NULL in bdrv_debug_resume()
0a122b
Bugzilla: 1048575
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
0a122b
RH-Acked-by: Fam Zheng <famz@redhat.com>
0a122b
0a122b
BZ: 1048575
0a122b
0a122b
Currently, bdrv_debug_resume() requires every bs->drv in the BDS stack
0a122b
to be NULL until a bs->drv with an implementation of bdrv_debug_resume()
0a122b
is found. For a normal function, this would be fine, but this is a
0a122b
function for debugging purposes and should therefore allow intermediate
0a122b
BDS not to have a driver (i.e., be "ejected"). Otherwise, it is hard to
0a122b
debug such situations.
0a122b
0a122b
Signed-off-by: Max Reitz <mreitz@redhat.com>
0a122b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
(cherry picked from commit 938789ea92b3073ad1113b3e1bdf90d469ea4bf4)
0a122b
0a122b
Signed-off-by: Max Reitz <mreitz@redhat.com>
0a122b
---
0a122b
 block.c | 2 +-
0a122b
 1 file changed, 1 insertion(+), 1 deletion(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 block.c |    2 +-
0a122b
 1 files changed, 1 insertions(+), 1 deletions(-)
0a122b
0a122b
diff --git a/block.c b/block.c
0a122b
index ae55535..0321c74 100644
0a122b
--- a/block.c
0a122b
+++ b/block.c
0a122b
@@ -3831,7 +3831,7 @@ int bdrv_debug_breakpoint(BlockDriverState *bs, const char *event,
0a122b
 
0a122b
 int bdrv_debug_resume(BlockDriverState *bs, const char *tag)
0a122b
 {
0a122b
-    while (bs && bs->drv && !bs->drv->bdrv_debug_resume) {
0a122b
+    while (bs && (!bs->drv || !bs->drv->bdrv_debug_resume)) {
0a122b
         bs = bs->file;
0a122b
     }
0a122b
 
0a122b
-- 
0a122b
1.7.1
0a122b