qemu/0337-iscsi-do-not-assume-device-is-zero-initialized.patch

45 lines
1.2 KiB
Diff
Raw Normal View History

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