cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-block-Fix-bs-request_alignment-assertion-for-bs-sg-1.patch

0a122b
From bac8088573d7f0a60e8e785aeaa442a1d90de0e4 Mon Sep 17 00:00:00 2001
0a122b
From: Kevin Wolf <kwolf@redhat.com>
0a122b
Date: Mon, 10 Mar 2014 11:07:22 +0100
0a122b
Subject: [PATCH 14/16] block: Fix bs->request_alignment assertion for bs->sg=1
0a122b
0a122b
RH-Author: Kevin Wolf <kwolf@redhat.com>
0a122b
Message-id: <1394449642-13562-3-git-send-email-kwolf@redhat.com>
0a122b
Patchwork-id: 58064
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH 2/2] block: Fix bs->request_alignment assertion for bs->sg=1
0a122b
Bugzilla: 1067784
0a122b
RH-Acked-by: Juan Quintela <quintela@redhat.com>
0a122b
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
0a122b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
0a122b
For sg backends, bs->request_alignment is meaningless and may be 0.
0a122b
0a122b
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
0a122b
Reviewed-by: Benoit Canet <benoit@irqsave.net>
0a122b
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
(cherry picked from commit 47ea2de2d68b6c5319308b7de1980f463b7c125c)
0a122b
0a122b
Signed-off-by: Kevin Wolf <kwolf@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 642e8d6..ec8dc90 100644
0a122b
--- a/block.c
0a122b
+++ b/block.c
0a122b
@@ -847,7 +847,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockDriverState *file,
0a122b
 
0a122b
     bdrv_refresh_limits(bs);
0a122b
     assert(bdrv_opt_mem_align(bs) != 0);
0a122b
-    assert(bs->request_alignment != 0);
0a122b
+    assert((bs->request_alignment != 0) || bs->sg);
0a122b
 
0a122b
 #ifndef _WIN32
0a122b
     if (bs->is_temporary) {
0a122b
-- 
0a122b
1.7.1
0a122b