Received: from eggs.gnu.org ([2001:4830:134:3::10]:48565) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYr6B-0002SY-Ef for qemu-devel@nongnu.org; Tue, 30 Sep 2014 02:39:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYr65-0005sA-9p for qemu-devel@nongnu.org; Tue, 30 Sep 2014 02:39:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYr65-0005rP-1e for qemu-devel@nongnu.org; Tue, 30 Sep 2014 02:39:41 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8U6dZGr003299 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 30 Sep 2014 02:39:35 -0400 From: Markus Armbruster References: <1412009238-13530-1-git-send-email-jsnow@redhat.com> <1412009238-13530-4-git-send-email-jsnow@redhat.com> Date: Tue, 30 Sep 2014 08:39:33 +0200 In-Reply-To: <1412009238-13530-4-git-send-email-jsnow@redhat.com> (John Snow's message of "Mon, 29 Sep 2014 12:47:15 -0400") Message-ID: <87iok5d32y.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 3/6] pc/vl: Add units-per-default-bus property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com John Snow writes: > This patch adds the 'units_per_default_bus' property which > allows individual boards to declare their desired > index => (bus,unit) mapping for their default HBA, so that > boards such as Q35 can specify that its default if_ide HBA, > AHCI, only accepts one unit per bus. > > This property only overrides the mapping for drives matching > the block_default_type interface. > > This patch also adds this property to *all* past and present > Q35 machine types. This retroactive addition is justified > because the previous erroneous index=>(bus,unit) mappings > caused by lack of such a property were not utilized due to > lack of initialization code in the Q35 init routine. > > Further, semantically, the Q35 board type has always had the > property that its default HBA, AHCI, only accepts one unit per > bus. The new code added to add devices to drives relies upon > the accuracy of this mapping. Thus, the property is applied > retroactively to reduce complexity of allowing IDE HBAs with > different units per bus. > > Examples: > > Prior to this patch, all IDE HBAs were assumed to use 2 units > per bus (Master, Slave). When using Q35 and AHCI, however, we > only allow one unit per bus. > > -hdb foo.qcow2 would become index=1, or bus=0,unit=1. > -hdd foo.qcow2 would become index=3, or bus=1,unit=1. > -drive file=foo.qcow2,index=5 becomes bus=2,unit=1. > > These are invalid for AHCI. They now become, under Q35 only: > > -hdb foo.qcow2 --> index=1, bus=1, unit=0. > -hdd foo.qcow2 --> index=3, bus=3, unit=0. > -drive file=foo.qcow2,index=5 --> bus=5,unit=0. > > The mapping is adjusted based on the fact that the default IF > for the Q35 machine type is IF_IDE, and units-per-default-bus > overrides the IDE mapping from its default of 2 units per bus > to just 1 unit per bus. > > Signed-off-by: John Snow Nice examples, thank you!