Received: from eggs.gnu.org ([140.186.70.92]:51318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4Oly-0002Ui-M6 for qemu-devel@nongnu.org; Thu, 15 Sep 2011 23:07:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4Olx-0000E4-09 for qemu-devel@nongnu.org; Thu, 15 Sep 2011 23:07:26 -0400 Date: Fri, 16 Sep 2011 13:06:16 +1000 From: David Gibson Message-ID: <20110916030616.GZ9025@yookeroo.fritz.box> References: <1315989802-18753-1-git-send-email-agraf@suse.de> <1315989802-18753-2-git-send-email-agraf@suse.de> <20110915031437.GR9025@yookeroo.fritz.box> <4E71A2D2.2080008@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E71A2D2.2080008@redhat.com> Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 01/58] spapr: proper qdevification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-ppc@nongnu.org, Alexander Graf , qemu-devel Developers On Thu, Sep 15, 2011 at 09:01:38AM +0200, Paolo Bonzini wrote: > On 09/15/2011 05:14 AM, David Gibson wrote: > >Under PAPR, there is generally only > >supposed to be one SCSI target (disk / cd / whatever) per virtual scsi > >bus. But the generic qdev code will, by default, keep assigning > >devices to the existing bus until it's full. Any thoughts on how to > >sanely change that behaviour on a per-machine basis? > > You could change the if_max_devs array in blockdev.c to something > provided by the machines. > > However, I'm not sure about this, for two reasons: > > 1) do you mean, in Linux terms, one target per SCSI _host_ or one > target per SCSI _channel_? i.e. if you looks at > /sys/bus/scsi/devices, right now it looks like > > 0:0:0:0 0:0:1:0 (two targets on the same host and channel) > > Should it be? > > 0:0:0:0 0:1:0:0 (one target per channel) > > or > > 0:0:0:0 1:0:0:0 (one target per host) > > If it is the former, then you are simply hitting a limitation of the > SCSI layer in QEMU and I do have patches to make assignment more > flexible. Based on the Linux VSCSI driver, and based on what SLOF > does, I'd guess that's what you mean. Well, now I'm confused. I had a look at a pHyp machine, and Linux seemed to see it as multiple targets on a single channel, but I'm sure the PAPR spec says you shouldn't have that. So I'm going to have to look closer now. > 2) does this matter at all? First, when doing "real world" > virtualization you won't use the legacy options (neither -hda/-cdrom > nor "-drive ...,if=scsi"), you would use -device to manually assign > the devices to their buses. Well, perhaps, but I really prefer to have sane defaults, rather than having to build the machine myself on the command line. > Second, why should you care in the case > of SCSI? It seems like a very hard limitation to me, and unlike the > PCI case it doesn't buy you anything in terms of isolation. Ah, there is a good reason on this side. I forget the exact details, but due to the protocol it uses there's some blocksize limit that is only advertised per vscsi adaptor, whereas it should really be a per-target quantity (and is different in practice for cdroms and disks). Of course that's arguably a bug in the vscsi protocol, but we can't fix that. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson