Blob Blame Raw
From b9d7b6bbaa64404eb9b4a65d0af841bfae5c9089 Mon Sep 17 00:00:00 2001
From: Fam Zheng <famz@redhat.com>
Date: Mon, 11 Jul 2016 05:33:36 +0200
Subject: [PATCH 3/7] block-backend: expose bs->bl.max_transfer_length

RH-Author: Fam Zheng <famz@redhat.com>
Message-id: <1468215219-30793-4-git-send-email-famz@redhat.com>
Patchwork-id: 71107
O-Subject: [RHEL-7.3 qemu-kvm PATCH 3/6] block-backend: expose bs->bl.max_transfer_length
Bugzilla: 1318199
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
RH-Acked-by: John Snow <jsnow@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>

From: Peter Lieven <pl@kamp.de>

Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 454057b7d9b9ad141bd5df8c4075745e56b4870f)
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>

Conflicts:
	block/block-backend.c
	include/sysemu/block-backend.h

Downstream doesn't have BlockBackend yet, so "blk_" -> "bdrv_" and put
the function in block.c.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block.c               | 5 +++++
 include/block/block.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/block.c b/block.c
index ae756aa..bdcd741 100644
--- a/block.c
+++ b/block.c
@@ -3656,6 +3656,11 @@ int bdrv_get_flags(BlockDriverState *bs)
     return bs->open_flags;
 }
 
+int bdrv_get_max_transfer_length(BlockDriverState *bs)
+{
+    return bs->bl.max_transfer_length;
+}
+
 int bdrv_flush_all(void)
 {
     BlockDriverState *bs;
diff --git a/include/block/block.h b/include/block/block.h
index 75147b2..d29733a 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -379,6 +379,7 @@ void bdrv_iterate_format(void (*it)(void *opaque, const char *name),
                          void *opaque);
 const char *bdrv_get_device_name(BlockDriverState *bs);
 int bdrv_get_flags(BlockDriverState *bs);
+int bdrv_get_max_transfer_length(BlockDriverState *bs);
 int bdrv_write_compressed(BlockDriverState *bs, int64_t sector_num,
                           const uint8_t *buf, int nb_sectors);
 int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
-- 
1.8.3.1