From patchwork Thu Jan 27 12:21:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 80657 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 10667B710F for ; Thu, 27 Jan 2011 23:22:23 +1100 (EST) Received: from localhost ([127.0.0.1]:38923 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiQrk-00025z-8D for incoming@patchwork.ozlabs.org; Thu, 27 Jan 2011 07:22:20 -0500 Received: from [140.186.70.92] (port=50113 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiQpO-0000sS-K3 for qemu-devel@nongnu.org; Thu, 27 Jan 2011 07:19:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiQpN-0005mH-DV for qemu-devel@nongnu.org; Thu, 27 Jan 2011 07:19:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiQpN-0005m2-6Z for qemu-devel@nongnu.org; Thu, 27 Jan 2011 07:19:53 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0RCJiUx018703 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 27 Jan 2011 07:19:45 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-5-175.str.redhat.com [10.32.5.175]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p0RCJgng015470 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 27 Jan 2011 07:19:44 -0500 Message-ID: <4D416342.6080001@redhat.com> Date: Thu, 27 Jan 2011 13:21:22 +0100 From: Kevin Wolf User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10 MIME-Version: 1.0 To: Markus Armbruster References: In-Reply-To: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Christoph Hellwig , qemu-devel@nongnu.org, Hannes Reinecke Subject: [Qemu-devel] Re: Commit 622b520f changed -drive if=scsi, index=N, intentional? X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Am 27.01.2011 13:10, schrieb Markus Armbruster: > Consider -drive if=scsi,index=12,... > > Before the commit, index=12 meant bus=1,unit=5. Example: > > [...] > > Two scsi-buses, and scsi1-cd5 with scsi-id 5 is on the second one, > i.e. bus=1, unit=5. > > After the commit, it means bus=0,unit=12. The drive is created, but not > the guest device. That's because lsi53c895a supports only 7 units > (LSI_MAX_DEVS), and scsi_bus_legacy_handle_cmdline() ignores drives with > unit numbers exceeding that limit. Example: > > [...] > > One scsi-bus, and scsi1-cd5 nowhere to be found. > > I'd call this a regression. > > What now? That's a really good question. We could do something like this: max_devs = 0; That's very obviously not much more than a hack, but I don't think blockdev.c can get the real number easily (please prove me wrong). With this hack, we would get the old behaviour for -drive (which doesn't use any other controller anyway) and you can still use -device to attach more devices to a non-lsi bus. Kevin --- a/blockdev.c +++ b/blockdev.c @@ -192,7 +192,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) max_devs = MAX_IDE_DEVS; } else if (!strcmp(buf, "scsi")) { type = IF_SCSI; - max_devs = MAX_SCSI_DEVS; + max_devs = 7; } else if (!strcmp(buf, "floppy")) { type = IF_FLOPPY;