[Openstack] Libguestfs in Icehouse with ubuntu 14

Richard W.M. Jones rjones at redhat.com
Tue Jun 17 15:58:59 UTC 2014


On Tue, Jun 17, 2014 at 04:41:21PM +0100, Pádraig Brady wrote:
> On 06/17/2014 03:17 PM, Pádraig Brady wrote:
> > On 06/17/2014 11:47 AM, Mahardhika Gilang wrote:
> >> Hi, i've got this warning in nova-compute.log
> >> *Failed to close augeas aug_close: call launch before using this function**
> >> **(in guestfish, don't forget to use the 'run' command)*
> >>
> >> is that mean i have to install libguestfs?
> >> thanks
> > 
> > Is this intermittent?
> > Perhaps there was an issue starting the VM,
> > and this is just a warning issued when making sure everything is torn down.
> 
> The unbalanced teardown() calls seem to be since:

The teardown function has a hunk that calls g.aug_close().  I think
that whole hunk could be dropped as it is unnecessary.

I suspect that hunk is the one which is printing the warning.

> https://review.openstack.org/#/c/67586/
> These should not cause a problem,
> though we might we able to clean things up here.

Setting self.handle = None is sufficient to completely clean up
libguestfs, including destroying the appliance, *provided* that
self.handle hasn't been leaked outside the class (ie. another
reference is held).

In guestfs.py:

    def __del__ (self):
        if self._o:
            libguestfsmod.close (self._o)

In guestfs-py.c:

  static PyMethodDef methods[] = {
  ...
    { (char *) "close", py_guestfs_close, METH_VARARGS, NULL },
  ...

py_guestfs_close is defined here:

  https://github.com/libguestfs/libguestfs/blob/master/python/guestfs-py-byhand.c#L60

and it calls guestfs_close.

guestfs_close is defined here:

  https://github.com/libguestfs/libguestfs/blob/master/src/handle.c#L296

and you can see that it shuts down the backend, removes the temporary
directory and finally frees the handle.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org




More information about the Openstack mailing list