From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41104 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODwL3-0000Kc-VD for qemu-devel@nongnu.org; Mon, 17 May 2010 05:10:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODwKj-0005XC-Sk for qemu-devel@nongnu.org; Mon, 17 May 2010 05:09:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46449) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODwKj-0005X1-Ky for qemu-devel@nongnu.org; Mon, 17 May 2010 05:09:57 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4H99ulG031384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 May 2010 05:09:56 -0400 Message-ID: <4BF107E1.2020600@redhat.com> Date: Mon, 17 May 2010 12:09:53 +0300 From: Avi Kivity 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: bazulay@redhat.com, juzhang@redhat.com, qemu-devel@nongnu.org, Luiz Capitulino On 05/17/2010 11:27 AM, Markus Armbruster wrote: > > >>>> A slot is the hotpluggable entity. Open your computer and you can >>>> actually see them. >>>> >>>> >>> QEMU doesn't really know that. >>> >>> >> How can that be? Do we signal hotplug notifications to a function or >> to a slot? >> >> Can we hotplug a single function in an already occupied slot? >> > What I meant to say: we have no concept of "slot" in the higher level > interfaces, we have only bus and device. > > If a PCI device has multiple functions, we have a separate qdev device > for each function. You can't unplug a "slot" (concept doesn't exist in > qdev), only a qdev device. Naturally, when you unplug a qdev device, > all functions in the same PCI slot need to go. This happens deep down > in the bowels of ACPI, in piix4_device_hotplug(). qdev is not aware of > this magic relation between the qdev devices for functions in the same > slot. > 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. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.