From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: Re: [PATCH] libxl: basic support for virtio disk Date: Wed, 1 Jun 2011 22:51:25 +0800 Message-ID: References: <19942.17843.474817.123371@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <19942.17843.474817.123371@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "xen-devel@lists.xensource.com" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Wed, Jun 1, 2011 at 9:59 PM, Ian Jackson wro= te: > Wei Liu writes ("[Xen-devel] Re: [PATCH] libxl: basic support for virtio = disk"): >> Revised patch. >> >> Add code in libxl__device_disk_string_of_backend. >> >> Upper limit of virtio disk follows scsi. > > I'm not sure what you mean here. =C2=A0Do you mean that Linux only suppor= ts > as many virtio disks as it supports scsi disks ? =C2=A0Is this a > fundamental limitation of the virtio protocol ? > I asked about the limitation in qemu-devel, the answer is "virtio-blk as used by KVM is exposed as a virtio PCI adapter. There is a 1:1 mapping between virtio-blk, PCI adapters, and block devices being presented by QEMU: 1 virtio-blk device in guest =3D=3D 1 virtio-pci adapter in guest =3D=3D 1 block device in QEMU The maximum number is really limited by the PCI bus, not virtio. In terms of coding, you should try not to impose a hard limit at all." Thus Stefano suggest I use the same limitation as SCSI disk. >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else if (strncm= p(disks[i].vdev, "vd", 2) =3D=3D 0) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0d= rive =3D libxl__sprintf >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(gc, "file=3D%s,if=3Dvirtio,index=3D%d,media=3Ddisk,format=3D%= s", >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 disks[i].pdev_path, disk, format); > > Maybe I'm missing something but this seems not to use the partition > number at all ? > Also answered in qemu-devel "Partitions are not at the virtio-blk level. The guest operating system will see the virtio-blk disk and scan its partition table to determine which partitions are available. The limit then depends on the partitioning scheme that you use (legacy boot record, GPT, etc)." So I'm not using the partition number here. In fact, we should not support vda1, vda2, right? The discussion thread is at http://marc.info/?l=3Dqemu-devel&m=3D130689044627041&w=3D2 > The existing code seems rather broken TBH. > Hmm... I'm not catching up with libxl. Should be more careful next time... > Ian. > Wei.