* [Qemu-devel] Question on virtio disk maximum index and maximum partition
@ 2011-06-01 1:06 Wei Liu
2011-06-01 4:56 ` Stefan Hajnoczi
0 siblings, 1 reply; 5+ messages in thread
From: Wei Liu @ 2011-06-01 1:06 UTC (permalink / raw)
To: qemu-devel
Hi, all.
I'm programming for virtio disk support in Xen tool stack. I would
like to know the limitation of virtio disk.
That is, what's the maximum number of disks supported through virtio
bus, and what's the maximum number of partitions supported per disk.
If I'm posting to the wrong list, please point me the right direction.
Thanks.
--
Best regards
Wei Liu
Twitter: @iliuw
Site: http://liuw.name
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Question on virtio disk maximum index and maximum partition
2011-06-01 1:06 [Qemu-devel] Question on virtio disk maximum index and maximum partition Wei Liu
@ 2011-06-01 4:56 ` Stefan Hajnoczi
2011-06-01 6:03 ` Wei Liu
2011-06-14 12:27 ` Richard W.M. Jones
0 siblings, 2 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2011-06-01 4:56 UTC (permalink / raw)
To: Wei Liu; +Cc: qemu-devel
On Wed, Jun 1, 2011 at 2:06 AM, Wei Liu <liuw@liuw.name> wrote:
> I'm programming for virtio disk support in Xen tool stack. I would
> like to know the limitation of virtio disk.
I'm interested what you are implementing - a virtio-blk backend for
Xen (which would basically mean vhost-blk)?
> That is, what's the maximum number of disks supported through virtio
> bus, and what's the maximum number of partitions supported per disk.
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 == 1 virtio-pci adapter in guest == 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.
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).
> If I'm posting to the wrong list, please point me the right direction.
You might also be interested in
<virtualization@lists.linux-foundation.org> for general virtio
discussion.
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Question on virtio disk maximum index and maximum partition
2011-06-01 4:56 ` Stefan Hajnoczi
@ 2011-06-01 6:03 ` Wei Liu
2011-06-01 10:12 ` Stefano Stabellini
2011-06-14 12:27 ` Richard W.M. Jones
1 sibling, 1 reply; 5+ messages in thread
From: Wei Liu @ 2011-06-01 6:03 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-devel, Stefano Stabellini
Stefano Stabellini CC'ed
On Wed, Jun 1, 2011 at 12:56 PM, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Wed, Jun 1, 2011 at 2:06 AM, Wei Liu <liuw@liuw.name> wrote:
>> I'm programming for virtio disk support in Xen tool stack. I would
>> like to know the limitation of virtio disk.
>
> I'm interested what you are implementing - a virtio-blk backend for
> Xen (which would basically mean vhost-blk)?
>
No, I'm not implementing any backends. I am just writing patch for
Xen's tool stack -- libxl. We are about to switch to upstream QEMU
entirely. So the actual "backend" for virtio devices is QEMU.
For disks to be added to virtual machines, we need to validate the
disk before adding. For those Xen-specific disks supported by blkback,
we have the checking conceptually like:
int device_virtdisk_matches(const char *virtpath, const char *devtype,
int *index_r, int max_index,
int *partition_r, int max_partition)
The max_index means "how many disks are supported by this controller"
(to my understanding, correct me if I'm wrong). The max_partition
means "the largest possible partition number supported by this
device".
So, for a IDE disk, we would invoke the function as:
device_virtdisk_matches(virtpath, "hd",
&disk, 3,
&partition, 63)
I was trying to apply the same checking for virtio disk, just don't
know what parameters to be filled in for max_index and max_partition.
>> That is, what's the maximum number of disks supported through virtio
>> bus, and what's the maximum number of partitions supported per disk.
>
> 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 == 1 virtio-pci adapter in guest == 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.
>
> 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).
>
That's exactly what I'm seeing...
Maybe I should modify the checking and make a exception for virtio
disk? Stefano, what would you say?
>> If I'm posting to the wrong list, please point me the right direction.
>
> You might also be interested in
> <virtualization@lists.linux-foundation.org> for general virtio
> discussion.
>
Thanks.
> Stefan
>
--
Best regards
Wei Liu
Twitter: @iliuw
Site: http://liuw.name
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Question on virtio disk maximum index and maximum partition
2011-06-01 6:03 ` Wei Liu
@ 2011-06-01 10:12 ` Stefano Stabellini
0 siblings, 0 replies; 5+ messages in thread
From: Stefano Stabellini @ 2011-06-01 10:12 UTC (permalink / raw)
To: Wei Liu; +Cc: Stefan Hajnoczi, qemu-devel@nongnu.org, Stefano Stabellini
On Wed, 1 Jun 2011, Wei Liu wrote:
> That's exactly what I'm seeing...
>
> Maybe I should modify the checking and make a exception for virtio
> disk? Stefano, what would you say?
That is not a check, it is just the upper limit to decode "vda1" or
"vde2" in a disk number and partition number.
I would just use the same as scsi.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Question on virtio disk maximum index and maximum partition
2011-06-01 4:56 ` Stefan Hajnoczi
2011-06-01 6:03 ` Wei Liu
@ 2011-06-14 12:27 ` Richard W.M. Jones
1 sibling, 0 replies; 5+ messages in thread
From: Richard W.M. Jones @ 2011-06-14 12:27 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-devel, Wei Liu
On Wed, Jun 01, 2011 at 05:56:02AM +0100, Stefan Hajnoczi wrote:
> 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).
But practically the Linux virtio implementation imposes a limit of 15
partitions (vda + vda1 .. vda15 = 16), since it encodes the partition
number in 4 bits. If you have a virtio disk with more than 15
partitions, Linux guests will ignore the extra partitions. This may
or may not matter, but it's worth considering.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-14 12:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-01 1:06 [Qemu-devel] Question on virtio disk maximum index and maximum partition Wei Liu
2011-06-01 4:56 ` Stefan Hajnoczi
2011-06-01 6:03 ` Wei Liu
2011-06-01 10:12 ` Stefano Stabellini
2011-06-14 12:27 ` Richard W.M. Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).