[libvirt] [PATCH 2/7] iscsi: Check for validity of pool source hostname
Peter Krempa
pkrempa at redhat.com
Mon Apr 20 13:41:16 UTC 2015
On Sun, Apr 19, 2015 at 20:49:07 -0400, John Ferlan wrote:
> 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 at redhat.com>
> ---
> 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;
This overwrites the error from virIsValidHostname()
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150420/56f06d15/attachment-0001.sig>
More information about the libvir-list
mailing list