From: Chris Lalancette Date: Tue, 17 Jun 2008 12:47:10 +0000 (+0000) Subject: A small bugfix; we only need to call the iscsiadm sendtarget command when we are X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=94e3ba0e87d71fde9195939b3aabe527b0f28a09;p=libvirt.git A small bugfix; we only need to call the iscsiadm sendtarget command when we are first logging in; we don't need to do it for logout. Move the sendtarget command into the Login() function. Signed-off-by: Chris Lalancette --- diff --git a/src/storage_backend_iscsi.c b/src/storage_backend_iscsi.c index 78a623cdbc..32228a5ce5 100644 --- a/src/storage_backend_iscsi.c +++ b/src/storage_backend_iscsi.c @@ -158,14 +158,6 @@ virStorageBackendISCSIConnection(virConnectPtr conn, "--targetname", pool->def->source.devices[0].path, action, NULL }; - const char *cmdsendtarget[] = { - ISCSIADM, "--mode", "discovery", "--type", "sendtargets", - "--portal", portal, NULL - }; - - if (virRun(conn, (char **)cmdsendtarget, NULL) < 0) - return -1; - if (virRun(conn, (char **)cmdargv, NULL) < 0) return -1; @@ -403,6 +395,14 @@ virStorageBackendISCSILogin(virConnectPtr conn, virStoragePoolObjPtr pool, const char *portal) { + const char *const cmdsendtarget[] = { + ISCSIADM, "--mode", "discovery", "--type", "sendtargets", + "--portal", portal, NULL + }; + + if (virRun(conn, (char **)cmdsendtarget, NULL) < 0) + return -1; + return virStorageBackendISCSIConnection(conn, pool, portal, "--login"); }