[libvirt] [PATCH 4/7] gluster: Check for validity of pool source hostname

John Ferlan jferlan at redhat.com
Mon Apr 20 00:49:09 UTC 2015


Prior to attempting to open the gluster connection, let's make sure we
can resolve the source pool hostname.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/storage/storage_backend_gluster.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c
index d2e79bc..e3a8c21 100644
--- a/src/storage/storage_backend_gluster.c
+++ b/src/storage/storage_backend_gluster.c
@@ -96,6 +96,9 @@ virStorageBackendGlusterOpen(virStoragePoolObjPtr pool)
             trailing_slash = false;
     }
 
+    if (!virIsValidHostname(pool->def->source.hosts[0].name))
+        return NULL;
+
     if (VIR_ALLOC(ret) < 0)
         return NULL;
 
-- 
2.1.0




More information about the libvir-list mailing list