[PATCH 2/7] iscsi: Check for validity of pool source hostname

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

 



Ensure that the pool that's being started has a source pool hostname
that can be resolved before trying to start an iSCSI session.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/storage/storage_backend_iscsi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index 197d333..958c347 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -385,6 +385,13 @@ virStorageBackendISCSIStartPool(virConnectPtr conn,
         return -1;
     }
 
+    if (!virIsValidHostname(pool->def->source.hosts[0].name)) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("cannot resolve hostname '%s' on this host"),
+                       pool->def->source.hosts[0].name);
+        return -1;
+    }
+
     if (pool->def->source.ndevice != 1 ||
         pool->def->source.devices[0].path == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-- 
2.1.0

--
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]