summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2015-04-16 16:08:25 +0200
committerKevin Wolf <kwolf@redhat.com>2015-04-28 15:36:09 +0200
commit20474e9aa040b9a255c63127f1eb873c29c54f68 (patch)
tree4731a2c6135a49c93b0ca53e8bd5657b87eafff8 /block
parentd5a8ee60a0fbc20a2c2d02f3bda1bb1bd365f1ee (diff)
downloadhqemu-20474e9aa040b9a255c63127f1eb873c29c54f68.zip
hqemu-20474e9aa040b9a255c63127f1eb873c29c54f68.tar.gz
block/iscsi: do not forget to logout from target
We actually were always impolitely dropping the connection and not cleanly logging out. CC: qemu-stable@nongnu.org Signed-off-by: Peter Lieven <pl@kamp.de> Message-id: 1429193313-4263-2-git-send-email-pl@kamp.de Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/iscsi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/block/iscsi.c b/block/iscsi.c
index ba33290..be8af46 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1501,6 +1501,9 @@ out:
if (ret) {
if (iscsi != NULL) {
+ if (iscsi_is_logged_in(iscsi)) {
+ iscsi_logout_sync(iscsi);
+ }
iscsi_destroy_context(iscsi);
}
memset(iscsilun, 0, sizeof(IscsiLun));
@@ -1514,6 +1517,9 @@ static void iscsi_close(BlockDriverState *bs)
struct iscsi_context *iscsi = iscsilun->iscsi;
iscsi_detach_aio_context(bs);
+ if (iscsi_is_logged_in(iscsi)) {
+ iscsi_logout_sync(iscsi);
+ }
iscsi_destroy_context(iscsi);
g_free(iscsilun->zeroblock);
g_free(iscsilun->allocationmap);
OpenPOWER on IntegriCloud