From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWrbc-0003WN-6b for qemu-devel@nongnu.org; Tue, 10 Feb 2009 07:20:48 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWrbY-0003Tn-0p for qemu-devel@nongnu.org; Tue, 10 Feb 2009 07:20:45 -0500 Received: from [199.232.76.173] (port=45788 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWrbX-0003TX-Pc for qemu-devel@nongnu.org; Tue, 10 Feb 2009 07:20:43 -0500 Received: from mx1.redhat.com ([66.187.233.31]:51235) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LWrbX-0000QX-Gv for qemu-devel@nongnu.org; Tue, 10 Feb 2009 07:20:43 -0500 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n1ACKd2f025234 for ; Tue, 10 Feb 2009 07:20:39 -0500 Date: Tue, 10 Feb 2009 12:20:37 +0000 From: "Daniel P. Berrange" Subject: Re: [Qemu-devel] [patch 2/2] qemu: PCI device, disk and host network hot-add / hot-remove Message-ID: <20090210122037.GG31871@redhat.com> References: <20090206174406.589893548@amt.cnet> <20090206174840.681967121@amt.cnet> <498EAF22.1030902@redhat.com> <20090208172844.GA3854@amt.cnet> <20090209084139.GA20629@redhat.com> <20090209224125.GA11520@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090209224125.GA11520@amt.cnet> 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: Marcelo Tosatti Cc: Markus Armbruster , Avi Kivity , qemu-devel@nongnu.org On Mon, Feb 09, 2009 at 08:41:25PM -0200, Marcelo Tosatti wrote: > On Mon, Feb 09, 2009 at 08:41:39AM +0000, Daniel P. Berrange wrote: > > > > Also bear in mind that we need the ability to hot unplug devices which > > were specified on the command line argv. For these we currently have > > neither the pci , nor are given any 'name'. > > Any reason you can't discover from "info pci" ? > (domain/bus are always zero at the moment). 'info pci' just gives you a list of PCI devices, and no direct means to correlate these to devices listed in your command line argv. eg, I launch QEMU with 3 nics qemu \ ....more args... -net tap -net nic,mac=01:02:03:04:05:01 \ -net tap -net nic,mac=01:02:03:04:05:02 \ -net tap -net nic,mac=01:02:03:04:05:03 \ ....more args... Then info pci shows this: ...snip... Bus 0, device 3, function 0: Ethernet controller: PCI device 10ec:8029 IRQ 11. BAR0: I/O at 0xc100 [0xc1ff]. Bus 0, device 4, function 0: Ethernet controller: PCI device 10ec:8029 IRQ 9. BAR0: I/O at 0xc200 [0xc2ff]. Bus 0, device 5, function 0: Ethernet controller: PCI device 10ec:8029 IRQ 11. BAR0: I/O at 0xc300 [0xc3ff]. ...snip... I want to remove NIC with mac adress 01:02:03:04:05:02, but there is no way to correlate this 'info pci' data to the NIC I wish to remove. They may happen to appear in the same sorted order immediately after startup, but if you've hot added & removed a couple of devices already, then the order from 'info pci' can't easily map back to argv, unless you very carefully tracked all changes. > > Markus has previously suggested allowing to be > > specified on the cli which would let us manually assign & use that > > info for unplug. > > > A device type specific unique naming would be useful too though. In > > changeset r6220, Mark McLoughlin provided the ability to give every > > single NIC a unique name. I'd like to be able to use that name for > > unplug. > > The NIC identifiers are not specific to PCI. So if you specify a > non-PCI nic with the cli, you should not expect "pci_del name" to work. > Now I see where you're getting at with the private discussion around > "dev_add/dev_add". Yes, if the device already had a unqiue identifier, it some ways it would be easier to just be able todo 'nic_del 01:02:03:04:05:02' Or for a SCSI disk 'drive_del bus=scsi,index=3'. QEMU ought to have enough info internally to be able to map this to the PCI address it needs to remove. 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 :|