yeahuh / 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

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