From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45135 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OE5sM-0006uu-Hz for qemu-devel@nongnu.org; Mon, 17 May 2010 15:21:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OE5sF-0000Vk-V0 for qemu-devel@nongnu.org; Mon, 17 May 2010 15:21:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61296) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OE5sE-0000VN-FX for qemu-devel@nongnu.org; Mon, 17 May 2010 15:21:11 -0400 Message-ID: <4BF1971E.4040709@redhat.com> Date: Mon, 17 May 2010 21:21:02 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] QMP: Introduce commands doc References: <1273086712-29163-1-git-send-email-lcapitulino@redhat.com> <1273086712-29163-2-git-send-email-lcapitulino@redhat.com> <4BEC031D.6020506@redhat.com> <4BED6F85.50309@redhat.com> <4BED83BD.8000604@redhat.com> <4BF107E1.2020600@redhat.com> <4BF1847D.9090603@codemonkey.ws> In-Reply-To: <4BF1847D.9090603@codemonkey.ws> 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: Anthony Liguori Cc: bazulay@redhat.com, Markus Armbruster , qemu-devel@nongnu.org, Luiz Capitulino , juzhang@redhat.com, Avi Kivity Hi, >>> IMO, that's a serious bug. A slot is a user visible entity, both in >>> that devices can only be hotplugged only as slots, not functions, and >>> to determine the maximum number of devices you can add. If the user >>> knows about it, qemu should too. >>> >>> We can easily represent a slot/device as a qbus with each of the >>> functions as devices attached to it. Point being? >> Dunno. Gerd, what do you think? There is a PCIDevice for each function. PCIDevice->devfn (aka addr property) contains slot+function. So hw/pci.c can figure which device functions belong to the same slot. The pci hotplug code might need some fixes to handle multi-function devices correctly though (I guess this is the original issue?). unplug is probably easy, plug might be harder. You have to plug-in all functions belonging to the slot first, then signal the guest that the slot has been hotplugged, which might need changes in the monitor protocol. cheers, Gerd