提交 20474e9a 编写于 作者: P Peter Lieven 提交者: Kevin Wolf

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: NPeter Lieven <pl@kamp.de>
Message-id: 1429193313-4263-2-git-send-email-pl@kamp.de
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 d5a8ee60
...@@ -1501,6 +1501,9 @@ out: ...@@ -1501,6 +1501,9 @@ out:
if (ret) { if (ret) {
if (iscsi != NULL) { if (iscsi != NULL) {
if (iscsi_is_logged_in(iscsi)) {
iscsi_logout_sync(iscsi);
}
iscsi_destroy_context(iscsi); iscsi_destroy_context(iscsi);
} }
memset(iscsilun, 0, sizeof(IscsiLun)); memset(iscsilun, 0, sizeof(IscsiLun));
...@@ -1514,6 +1517,9 @@ static void iscsi_close(BlockDriverState *bs) ...@@ -1514,6 +1517,9 @@ static void iscsi_close(BlockDriverState *bs)
struct iscsi_context *iscsi = iscsilun->iscsi; struct iscsi_context *iscsi = iscsilun->iscsi;
iscsi_detach_aio_context(bs); iscsi_detach_aio_context(bs);
if (iscsi_is_logged_in(iscsi)) {
iscsi_logout_sync(iscsi);
}
iscsi_destroy_context(iscsi); iscsi_destroy_context(iscsi);
g_free(iscsilun->zeroblock); g_free(iscsilun->zeroblock);
g_free(iscsilun->allocationmap); g_free(iscsilun->allocationmap);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册