Blame SOURCES/kvm-block-bs-drv-may-be-NULL-in-bdrv_debug_resume.patch

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