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

Peter Krempa pkrempa at redhat.com
Tue Apr 21 08:37:10 UTC 2015


On Mon, Apr 20, 2015 at 15:39:23 -0400, John Ferlan wrote:
> 
> 
> On 04/20/2015 09:45 AM, Peter Krempa wrote:
> > On Sun, Apr 19, 2015 at 20:49:09 -0400, John Ferlan wrote:
> >> 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;
> >> +
> > 
> > Okay, it might be marginally worth at this point, since gluster is/was
> > leaking some memory and threads after it was initialized.
> > 
> > On the other hand you'll be resolving the hostname again a few lines
> > below.
> > 
> 
> Which call, glfs_set_volfile_server?  It wasn't intuitively obvious...

glfs_init does all the magic (and leaking)
-------------- 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/20150421/b2d174d8/attachment-0001.sig>


More information about the libvir-list mailing list