yeahuh / rpms / qemu-kvm

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