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(a)redhat.com>
---
src/storage/storage_backend_iscsi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c
index 197d333..0482dfb 100644
--- a/src/storage/storage_backend_iscsi.c
+++ b/src/storage/storage_backend_iscsi.c
@@ -1,7 +1,7 @@
/*
* storage_backend_iscsi.c: storage backend for iSCSI handling
*
- * Copyright (C) 2007-2014 Red Hat, Inc.
+ * Copyright (C) 2007-2015 Red Hat, Inc.
* Copyright (C) 2007-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
@@ -385,6 +385,10 @@ virStorageBackendISCSIStartPool(virConnectPtr conn,
return -1;
}
+ if (virSocketAddrParseName(NULL, pool->def->source.hosts[0].name,
+ AF_UNSPEC, IPPROTO_TCP) < 0)
+ return -1;
+
if (pool->def->source.ndevice != 1 ||
pool->def->source.devices[0].path == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
--
2.1.0