From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MO5LV-000111-FS for qemu-devel@nongnu.org; Tue, 07 Jul 2009 03:44:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MO5LQ-00010Y-Oz for qemu-devel@nongnu.org; Tue, 07 Jul 2009 03:44:08 -0400 Received: from [199.232.76.173] (port=40483 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MO5LQ-00010V-JR for qemu-devel@nongnu.org; Tue, 07 Jul 2009 03:44:04 -0400 Received: from mx20.gnu.org ([199.232.41.8]:54944) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MO5LQ-0003gV-5z for qemu-devel@nongnu.org; Tue, 07 Jul 2009 03:44:04 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MO5LP-0006LM-FO for qemu-devel@nongnu.org; Tue, 07 Jul 2009 03:44:03 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n677i2Sb032111 for ; Tue, 7 Jul 2009 03:44:02 -0400 Subject: Re: [Qemu-devel] [PATCH 0/3] Allow host_net_add monitor command accept file descriptors From: Mark McLoughlin In-Reply-To: <4A52DD05.9030007@redhat.com> References: <1246901401.12086.20.camel@blaa> <4A52DD05.9030007@redhat.com> Content-Type: text/plain Date: Tue, 07 Jul 2009 08:43:43 +0100 Message-Id: <1246952623.2836.13.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel On Tue, 2009-07-07 at 08:28 +0300, Avi Kivity wrote: > On 07/06/2009 08:30 PM, Mark McLoughlin wrote: > > Hi, > > You can pass file descriptors to qemu via the command line using '-net > > tap,fd=' or '-net socket,tap='. However, you cannot currently do this > > via the monitor. > > > > libvirt always configures tap interfaces before passing them to qemu. > > One reason for this is to allow libvirtd to have privileges > > to /dev/net/tun without allowing qemu those privileges. Because of this, > > libvirt currently does not support NIC hotplug for qemu. > > > > The following three patches add support for passing a file descriptor > > to the monitor command by allowing file descriptors to be received over > > monitor commands on a unix socket. > > > > > > I'm a great fan of SCM_RIGHTS. To make it easier to use in more > commands, I think it makes sense to have a separate command to pass the fd: > > (qemu) getfd foo > (qemu) getfd bar > (qemu) getfd baz > (qemu) pci_add ...,fd=foo > (qemu) pci_add ...,fd=bar ...,fd=baz > > A closefd command would be needed to deal with errors. Nice idea, certainly. However, since it's only currently useful for tap/socket networking, I'm happier with not adding two new monitor commands and only supporting a single fd for now. Cheers, Mark.