提交 f807ecd5 编写于 作者: P Peter Lieven 提交者: Paolo Bonzini

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: NPeter Lieven <pl@kamp.de>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 e829b0bb
...@@ -951,6 +951,11 @@ static void iscsi_close(BlockDriverState *bs) ...@@ -951,6 +951,11 @@ static void iscsi_close(BlockDriverState *bs)
memset(iscsilun, 0, sizeof(IscsiLun)); memset(iscsilun, 0, sizeof(IscsiLun));
} }
static int iscsi_has_zero_init(BlockDriverState *bs)
{
return 0;
}
static BlockDriver bdrv_iscsi = { static BlockDriver bdrv_iscsi = {
.format_name = "iscsi", .format_name = "iscsi",
.protocol_name = "iscsi", .protocol_name = "iscsi",
...@@ -966,6 +971,7 @@ static BlockDriver bdrv_iscsi = { ...@@ -966,6 +971,7 @@ static BlockDriver bdrv_iscsi = {
.bdrv_aio_flush = iscsi_aio_flush, .bdrv_aio_flush = iscsi_aio_flush,
.bdrv_aio_discard = iscsi_aio_discard, .bdrv_aio_discard = iscsi_aio_discard,
.bdrv_has_zero_init = iscsi_has_zero_init,
#ifdef __linux__ #ifdef __linux__
.bdrv_ioctl = iscsi_ioctl, .bdrv_ioctl = iscsi_ioctl,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册