From: Ján Tomko Date: Wed, 29 Apr 2015 12:59:08 +0000 (+0200) Subject: iscsi: do not fail to stop a stopped pool X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a41b1f196c3495385790e95706e5c83cf2056121;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git iscsi: do not fail to stop a stopped pool 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 --- diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c index 197d33381..9e2d01e45 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, true)) == NULL) + return 0; + VIR_FREE(session); + if ((portal = virStorageBackendISCSIPortal(&pool->def->source)) == NULL) return -1;