qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Question on virtio disk maximum index and maximum parti


From: Wei Liu
Subject: Re: [Qemu-devel] Question on virtio disk maximum index and maximum partition
Date: Wed, 1 Jun 2011 14:03:54 +0800

Stefano Stabellini CC'ed

On Wed, Jun 1, 2011 at 12:56 PM, Stefan Hajnoczi <address@hidden> wrote:
> On Wed, Jun 1, 2011 at 2:06 AM, Wei Liu <address@hidden> 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
> <address@hidden> for general virtio
> discussion.
>

Thanks.

> Stefan
>


-- 
Best regards
Wei Liu
Twitter: @iliuw
Site: http://liuw.name



reply via email to

[Prev in Thread] Current Thread [Next in Thread]