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

Ján Tomko jtomko at redhat.com
Tue May 13 13:24:20 UTC 2014


On 05/06/2014 03:39 PM, 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?

I have sent a libvirt patch to clean up the sockets on qemu shutdown:
https://www.redhat.com/archives/libvir-list/2014-May/msg00398.html

Jan

> 
> 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.
> 
> Stefan
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140513/0af35338/attachment-0001.sig>


More information about the libvir-list mailing list