]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
iscsi: do not fail to stop a stopped pool
authorJán Tomko <jtomko@redhat.com>
Wed, 29 Apr 2015 12:59:08 +0000 (14:59 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 30 Apr 2015 11:05:10 +0000 (13:05 +0200)
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.

Reported at:
https://bugzilla.redhat.com/show_bug.cgi?id=1171984

src/storage/storage_backend_iscsi.c

index 197d33381f6374f339681e45d9c47484a812b14d..9e2d01e457fb16a2eac6bf42e133e7498fdbe6d2 100644 (file)
@@ -449,8 +449,13 @@ virStorageBackendISCSIStopPool(virConnectPtr conn ATTRIBUTE_UNUSED,
                                virStoragePoolObjPtr pool)
 {
     char *portal;
+    char *session;
     int ret = -1;
 
+    if ((session = virStorageBackendISCSISession(pool, true)) == NULL)
+        return 0;
+    VIR_FREE(session);
+
     if ((portal = virStorageBackendISCSIPortal(&pool->def->source)) == NULL)
         return -1;