[PATCH 4/6] util: Add "--op nonpersistent" to iSCSI sendtargets

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

 



From: Fritz Elfert <fritz@xxxxxxxxxxxxxxx>

The root cause of commit id '3c12b654' was to ensure that an iSCSI
sendtargets command to discover all the available targets on the
host didn't reset the "node.startup" value for a future restarts
on any target that libvirt is managing.

However, by adding the "--op nonpersistent" inhibits the iSCSI
initiator from recording/modifying in the bowels /var/lib/iscsi
of any target.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/util/viriscsi.c  | 1 +
 tests/viriscsitest.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/util/viriscsi.c b/src/util/viriscsi.c
index ea01b3d..36612c5 100644
--- a/src/util/viriscsi.c
+++ b/src/util/viriscsi.c
@@ -446,6 +446,7 @@ virISCSIScanTargets(const char *portal,
                                              "--mode", "discovery",
                                              "--type", "sendtargets",
                                              "--portal", portal,
+                                             "--op", "nonpersistent",
                                              NULL);
 
     memset(&list, 0, sizeof(list));
diff --git a/tests/viriscsitest.c b/tests/viriscsitest.c
index c697a4a..b5b0e20 100644
--- a/tests/viriscsitest.c
+++ b/tests/viriscsitest.c
@@ -90,7 +90,9 @@ static void testIscsiadmCb(const char *const*args,
                args[4] && STREQ(args[4], "sendtargets") &&
                args[5] && STREQ(args[5], "--portal") &&
                args[6] && STREQ(args[6], "10.20.30.40:3260,1") &&
-               args[7] == NULL) {
+               args[7] && STREQ(args[7], "--op") &&
+               args[8] && STREQ(args[8], "nonpersistent") &&
+               args[9] == NULL) {
         ignore_value(VIR_STRDUP(*output, iscsiadmSendtargetsOutput));
     } else {
         *status = -1;
-- 
2.5.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]