From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LUkbY-0004Tl-8M for qemu-devel@nongnu.org; Wed, 04 Feb 2009 11:28:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LUkbW-0004S1-PB for qemu-devel@nongnu.org; Wed, 04 Feb 2009 11:27:59 -0500 Received: from [199.232.76.173] (port=36735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUkbW-0004Ra-Ds for qemu-devel@nongnu.org; Wed, 04 Feb 2009 11:27:58 -0500 Received: from mx1.redhat.com ([66.187.233.31]:55663) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LUkbW-0008Rs-3p for qemu-devel@nongnu.org; Wed, 04 Feb 2009 11:27:58 -0500 Date: Wed, 4 Feb 2009 15:37:08 +0000 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [patch 18/18] qemu: PCI device, disk and host network hot-add / hot-remove Message-ID: <20090204153708.GF26946@redhat.com> References: <20090204133303.113145633@localhost.localdomain> <20090204133924.976199377@localhost.localdomain> <20090204143843.GA26946@redhat.com> <4989B25F.6000100@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4989B25F.6000100@codemonkey.ws> Reply-To: "Daniel P. Berrange" , qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Marcelo Tosatti , qemu-devel@nongnu.org On Wed, Feb 04, 2009 at 09:21:03AM -0600, Anthony Liguori wrote: > Daniel P. Berrange wrote: > >On Wed, Feb 04, 2009 at 11:33:21AM -0200, Marcelo Tosatti wrote: > > > >>Add monitor command to hot-add PCI devices (nic and storage). > >> > >>Syntax is: > >> > >>pci_add pcibus nic|storage params > >> > >>It returns the bus slot and function for the newly added device on > >>success. > >> > >>It is possible to attach a disk to a device after PCI initialization via > >>the drive_add command. If so, a manual scan of the SCSI bus on the guest > >>is necessary. > >> > >>Save QEMUMachine necessary for drive_init. > >> > >>Add monitor command to hot-remove devices, remove device data on _EJ0 > >>notification. > >> > > > >Does this allow for hot-add of host TAP devices passing a open > >file descriptor across with SCM_RIGHTS (man 7 unix) on the UNIX > >domain socket connection to the monitor ? This ability is > >critical for libvirt, because we need to be able to allocate the > >TAP devices ourselves & do various configuration tasks before giving > >them to QEMU - the external script capability isn't suitable /flexible > >enough for this. > > > > It doesn't support this today but additional patches to enable that are > certainly welcome. The best way would be a generic mechanism to send a > file descriptor to QEMU that could then be used anywhere fd= is valid. > For instance: > > (qemu) receivefd unix:foo.sock,server > fd=5 > (qemu) closefd 5 I think this is a bit of an unpleasent way to interact. There should be no need for the user of the monitor to know or care about the FD number from QEMU's side. When running the 'host_net_add' command QEMU should be able to see that it is being asked to use an FD, and automatically receive it at this time. This avoids need for user of the monitor to run separate commands, and worry about closing the FD if something fails in the 2nd command, and avoids having to parse the receivefd command, and splice that into the next command. eg I'd expect that (qemu) host_net_add tap,fd=,vlan=9,ifname=vnet3 should see the empty 'fd=' arg and just 'do the right thing' by using SCM_RIGHTS to fetch the FD. Or could we avoid the FD passing, and just rely on giving an 'ifname' that already exists, and expect QEMU to open this existing named TAP device ? Though there may be difficulties with transfering "ownership" of the TAP device, to ensure it disappears when QEMU quits, rather than when the monitor caller quits. Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|