|
|
9ae3a8 |
From 865f21e1199cf38bc461b91c30d97bf1baceb8ba Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Date: Tue, 28 Jan 2014 14:21:57 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 22/22] block: add .bdrv_reopen_prepare() stub for iscsi
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Message-id: <884dd65be83603e336fac7a2fd2640ec52fe095d.1390918756.git.jcody@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 57003
|
|
|
9ae3a8 |
O-Subject: [RHEL7 qemu-kvm PATCH v2 1/1] block: add .bdrv_reopen_prepare() stub for iscsi
|
|
|
9ae3a8 |
Bugzilla: 1030301
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
To suppport reopen(), the .bdrv_reopen_prepare() stub must exist.
|
|
|
9ae3a8 |
iSCSI does not have anything that needs to be done to support reopen,
|
|
|
9ae3a8 |
so we can just implement the _prepare() stub.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Jeff Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit dc6afb99b39a78cf416c6d19e35f680f202016be)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RHEL7 Note: It should be noted that this _prepare() empty stub
|
|
|
9ae3a8 |
is all that is needed when performing a reopen, because
|
|
|
9ae3a8 |
the bdrv flags are ignored by iscsi_open. Specifically, in
|
|
|
9ae3a8 |
this form, reopen will not reconnect to an iSCSI target.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/iscsi.c | 9 +++++++++
|
|
|
9ae3a8 |
1 file changed, 9 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
block/iscsi.c | 9 +++++++++
|
|
|
9ae3a8 |
1 files changed, 9 insertions(+), 0 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/block/iscsi.c b/block/iscsi.c
|
|
|
9ae3a8 |
index fa6f7c4..1c5b0a2 100644
|
|
|
9ae3a8 |
--- a/block/iscsi.c
|
|
|
9ae3a8 |
+++ b/block/iscsi.c
|
|
|
9ae3a8 |
@@ -1506,6 +1506,14 @@ static void iscsi_close(BlockDriverState *bs)
|
|
|
9ae3a8 |
memset(iscsilun, 0, sizeof(IscsiLun));
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+/* We have nothing to do for iSCSI reopen, stub just returns
|
|
|
9ae3a8 |
+ * success */
|
|
|
9ae3a8 |
+static int iscsi_reopen_prepare(BDRVReopenState *state,
|
|
|
9ae3a8 |
+ BlockReopenQueue *queue, Error **errp)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ return 0;
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
static int iscsi_truncate(BlockDriverState *bs, int64_t offset)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
IscsiLun *iscsilun = bs->opaque;
|
|
|
9ae3a8 |
@@ -1613,6 +1621,7 @@ static BlockDriver bdrv_iscsi = {
|
|
|
9ae3a8 |
.bdrv_close = iscsi_close,
|
|
|
9ae3a8 |
.bdrv_create = iscsi_create,
|
|
|
9ae3a8 |
.create_options = iscsi_create_options,
|
|
|
9ae3a8 |
+ .bdrv_reopen_prepare = iscsi_reopen_prepare,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
.bdrv_getlength = iscsi_getlength,
|
|
|
9ae3a8 |
.bdrv_get_info = iscsi_get_info,
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|