[libvirt] Why does libvirt not unlink qemu-ga or any other socket in function qemuProcessStop()

Hello, I have defined a vm with two UNIX domain sockets. One is for qemu-ga and the other is for my service. These two devices will act as UNIX domain socket server. They are automatically generated by qemu. But when the vm was dead, these two sockets were not deleted. I find that libvirt will unlink vm's monitor socket(/var/lib/libvirt/qemu) in function qemuProcessStop(). Why does libvirt not unlink qemu-ga or any other socket in function qemuProcessStop()? xml file is given below. ---------------------------------------------------------------------------- <domain type='kvm' > <name>kvm-1</name> <memory>4194304</memory> <currentMemory>4194304</currentMemory> <vcpu>4</vcpu> <cpu> <topology sockets='1' cores='4' threads='1'/> </cpu> <os> <type arch='x86_64'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'> <timer name='hpet' present='no'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='raw' cache='none' io='native'/> <source file='/home/linux.img'/> <target dev='sda' bus='virtio'/> </disk> <channel type='unix'> <source mode='bind' path='/var/run/libvirt/qemu/kvm-1'/> <target type='virtio' name='org.qemu.guest_agent.1'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <channel type='unix'> <source mode='bind' path='/var/run/libvirt/qemu/kvm-1.agent'/> <target type='virtio' name='org.qemu.guest_agent.0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> <interface type='bridge'> <source bridge='br0'/> <mac address='00:22:3e:56:55:a7'/> <model type='virtio'/> </interface> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <graphics type='vnc' autoport='yes' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics> <video> <model type='cirrus' vram='9216' heads='1'/> </video> <memballon model='none'/> </devices> </domain> ------------------------------------------------------------------------ Thank you!

On Wed, Jul 17, 2013 at 08:14:35AM +0000, Wangyufei (A) wrote:
Hello, I have defined a vm with two UNIX domain sockets. One is for qemu-ga and the other is for my service. These two devices will act as UNIX domain socket server. They are automatically generated by qemu. But when the vm was dead, these two sockets were not deleted. I find that libvirt will unlink vm's monitor socket(/var/lib/libvirt/qemu) in function qemuProcessStop(). Why does libvirt not unlink qemu-ga or any other socket in function qemuProcessStop()?
I guess it just never occurred to anyone to implement code to unlink these other unix sockets. While QEMU could unlink them itself, a crashing QEMU certainly would not, so it would be good practice for libvirt to explicitly clean up any UNIX domain sockets after a guest shuts down. If you want to add such clean up code, please do send a patch. If you can't write it yourself, then at least file a bug to record this issue, so that we can track the issue. 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 :|
participants (2)
-
Daniel P. Berrange
-
Wangyufei (A)