From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhfbO-0002NR-S9 for qemu-devel@nongnu.org; Tue, 06 May 2014 09:40:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WhfbF-0001bn-SH for qemu-devel@nongnu.org; Tue, 06 May 2014 09:40:10 -0400 Received: from mail-we0-x22e.google.com ([2a00:1450:400c:c03::22e]:56863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WhfbF-0001aZ-MS for qemu-devel@nongnu.org; Tue, 06 May 2014 09:40:01 -0400 Received: by mail-we0-f174.google.com with SMTP id k48so8943304wev.19 for ; Tue, 06 May 2014 06:40:00 -0700 (PDT) Date: Tue, 6 May 2014 15:39:57 +0200 From: Stefan Hajnoczi Message-ID: <20140506133957.GX15810@stefanha-thinkpad.redhat.com> References: <533B22F2.4030209@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <533B22F2.4030209@windriver.com> Subject: Re: [Qemu-devel] qemu leaving unix sockets behind after VM is shut down List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chris Friesen Cc: libvir-list@redhat.com, qemu-devel@nongnu.org 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. Stefan