From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MO3ER-0007oS-8k for qemu-devel@nongnu.org; Tue, 07 Jul 2009 01:28:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MO3EM-0007mm-62 for qemu-devel@nongnu.org; Tue, 07 Jul 2009 01:28:42 -0400 Received: from [199.232.76.173] (port=43881 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MO3EL-0007mb-So for qemu-devel@nongnu.org; Tue, 07 Jul 2009 01:28:37 -0400 Received: from mx2.redhat.com ([66.187.237.31]:54027) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MO3EL-0007Mi-FD for qemu-devel@nongnu.org; Tue, 07 Jul 2009 01:28:37 -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 n675SaHd001586 for ; Tue, 7 Jul 2009 01:28:36 -0400 Message-ID: <4A52DD05.9030007@redhat.com> Date: Tue, 07 Jul 2009 08:28:37 +0300 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 0/3] Allow host_net_add monitor command accept file descriptors References: <1246901401.12086.20.camel@blaa> In-Reply-To: <1246901401.12086.20.camel@blaa> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: qemu-devel 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. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.