|
|
f375e62 |
From b360ba5cd93cbc30940538ce038b856ed8f72dd3 Mon Sep 17 00:00:00 2001
|
|
|
f375e62 |
From: Peter Lieven <pl@dlhnet.de>
|
|
|
f375e62 |
Date: Sat, 17 Nov 2012 16:20:28 +0100
|
|
|
f375e62 |
Subject: [PATCH] iscsi: do not assume device is zero initialized
|
|
|
f375e62 |
|
|
|
f375e62 |
Without any complex checks we can't assume that an
|
|
|
f375e62 |
iscsi target is initialized to zero.
|
|
|
f375e62 |
|
|
|
f375e62 |
Signed-off-by: Peter Lieven <pl@kamp.de>
|
|
|
f375e62 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
f375e62 |
(cherry picked from commit f807ecd5741325fe0d281199ff22cdda0acb6a7a)
|
|
|
f375e62 |
|
|
|
f375e62 |
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
|
|
|
f375e62 |
---
|
|
|
f375e62 |
block/iscsi.c | 6 ++++++
|
|
|
f375e62 |
1 file changed, 6 insertions(+)
|
|
|
f375e62 |
|
|
|
f375e62 |
diff --git a/block/iscsi.c b/block/iscsi.c
|
|
|
f375e62 |
index 1836c71..11fd37e 100644
|
|
|
f375e62 |
--- a/block/iscsi.c
|
|
|
f375e62 |
+++ b/block/iscsi.c
|
|
|
f375e62 |
@@ -955,6 +955,11 @@ static void iscsi_close(BlockDriverState *bs)
|
|
|
f375e62 |
memset(iscsilun, 0, sizeof(IscsiLun));
|
|
|
f375e62 |
}
|
|
|
f375e62 |
|
|
|
f375e62 |
+static int iscsi_has_zero_init(BlockDriverState *bs)
|
|
|
f375e62 |
+{
|
|
|
f375e62 |
+ return 0;
|
|
|
f375e62 |
+}
|
|
|
f375e62 |
+
|
|
|
f375e62 |
static BlockDriver bdrv_iscsi = {
|
|
|
f375e62 |
.format_name = "iscsi",
|
|
|
f375e62 |
.protocol_name = "iscsi",
|
|
|
f375e62 |
@@ -970,6 +975,7 @@ static BlockDriver bdrv_iscsi = {
|
|
|
f375e62 |
.bdrv_aio_flush = iscsi_aio_flush,
|
|
|
f375e62 |
|
|
|
f375e62 |
.bdrv_aio_discard = iscsi_aio_discard,
|
|
|
f375e62 |
+ .bdrv_has_zero_init = iscsi_has_zero_init,
|
|
|
f375e62 |
|
|
|
f375e62 |
#ifdef __linux__
|
|
|
f375e62 |
.bdrv_ioctl = iscsi_ioctl,
|