From: Wei Liu <liuw@liuw.name>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [Qemu-devel] Question on virtio disk maximum index and maximum partition
Date: Wed, 1 Jun 2011 14:03:54 +0800 [thread overview]
Message-ID: <BANLkTi=hS7-Qquap+igpKOhnny+Qy7o0LQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimS=6JENjQc0+uBLyB8h2OGiRvA0Q@mail.gmail.com>
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
next prev parent reply other threads:[~2011-06-01 6:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2011-06-01 10:12 ` Stefano Stabellini
2011-06-14 12:27 ` Richard W.M. Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTi=hS7-Qquap+igpKOhnny+Qy7o0LQ@mail.gmail.com' \
--to=liuw@liuw.name \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefano.stabellini@eu.citrix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).