Re: [Qemu-devel] qemu leaving unix sockets behind after VM is shut down

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 06, 2014 at 03:39:57PM +0200, Stefan Hajnoczi wrote:
> On Tue, Apr 01, 2014 at 02:34:58PM -0600, Chris Friesen wrote:
> > When running qemu with something like this
> > 
> > -device virtio-serial \
> > -chardev socket,path=/tmp/foo,server,nowait,id=foo \
> > -device virtserialport,chardev=foo,name=host.port.0
> > 
> > the VM starts up as expected and creates a socket at /tmp/foo as expected.
> > 
> > However, when I shut down the VM the socket at /tmp/foo is left
> > behind in the filesystem.  Basically qemu has "leaked" a file.
> > 
> > With something like OpenStack where we could be creating/destroying
> > many VMs this could end up creating a significant number of files in
> > the specified directory.
> > 
> > Has any thought been given to either automatically cleaning up the
> > unix socket in the filesystem when qemu exits, or else supporting
> > the abstract namespace for unix sockets to allow for automatic
> > cleanup?
> 
> Libvirt has a special case for the monitor socket in its
> qemuProcessStop() function.
> 
> Are you using the OpenStack libvirt driver?
> 
> Perhaps QEMU should support cleanup but first I think we should check
> the situation with libvirt.

We have explicit cleanup (ie unlink() call) for the monitor
UNIX socket, but guess we forgot todo the same for other
char device sockets.

We can't rely on QEMU to cleanup since it can obviously
SEGV at any time which would prevent it cleaning up after
itself. So libvirt must have any neccessary cleanup itself,
even if QEMU did make an effort to clean up.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]