[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] iscsi: do not fail to stop a stopped pool

On Wed, Apr 29, 2015 at 03:08:14PM +0200, Ján Tomko wrote:
Just as we allow stopping filesystem pools when they were unmounted
externally, do not fail to stop an iscsi pool when someone else
closed the session externally.

src/storage/storage_backend_iscsi.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index 197d333..bea6758 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -449,8 +449,13 @@ virStorageBackendISCSIStopPool(virConnectPtr conn ATTRIBUTE_UNUSED,
                               virStoragePoolObjPtr pool)
    char *portal;
+    char *session;
    int ret = -1;

+    if ((session = virStorageBackendISCSISession(pool, false)) == NULL)

Shouldn't this be called with true and not false, so it doesn't report
an error?

+        return 0;
+    VIR_FREE(session);

Will this help that much, since it can be stopped right after the
previous command found it?  Wouldn't it be better to handle this in
virISCSIConnection() or virISCSIConnectionLogout() somehow?

I'm just asking because I'm not the proper one to review iscsi stuff,
otherwise I'd probably ACK'd it (if there was that "true"), since it
will fix more than it will break (1 >> 0).

    if ((portal = virStorageBackendISCSIPortal(&pool->def->source)) == NULL)
        return -1;


libvir-list mailing list
libvir-list redhat com

Attachment: signature.asc
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]