xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <liuw@liuw.name>
To: Takeshi HASEGAWA <hasegaw@gmail.com>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Xen Devel <Xen-devel@lists.xensource.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH] libxl: virtio-blk-pci support for FV domain
Date: Sun, 8 May 2011 12:56:56 +0800	[thread overview]
Message-ID: <BANLkTimfyi1okskdUa=5CA0L=Ld-__QrGw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTin2+FtCL4-L1ZsZUov2153HiXSq7w@mail.gmail.com>

On Sun, May 8, 2011 at 11:48 AM, Takeshi HASEGAWA <hasegaw@gmail.com> wrote:
> I am working to support virtio-blk-pci device on Xen FV domain.
> This patch adds virtio-blk-pci support to libxl.
>
> New vbd type (252 << 8) is added.
> I borrow 252 from major number of linux virtio-blk frontend (vd).
> virtio-blk-pci does not use this type right now, but it should
> also work with Wei Liu's work.
>
>
> I have already seen virtio device on HVM domain with upstream-qemu,
> but there looks some issues when I/O occurs.
> (fdisk works, but qemu dies during mkfs)
> I am going to look into the problem.
>
> Any suggestions are welcome!
>
> Thanks,
> Takeshi
>
>
> Signed-off-by: Takeshi HASEGAWA <hasegaw@gmail.com>
>
> diff -r 4b0692880dfa docs/misc/vbd-interface.txt
> --- a/docs/misc/vbd-interface.txt       Thu May 05 17:40:34 2011 +0100
> +++ b/docs/misc/vbd-interface.txt       Sun May 08 12:46:00 2011 +0900
> @@ -73,6 +73,7 @@
>
>     1 << 28 | disk << 8 | partition      xvd, disks or partitions 16 onwards
>    202 << 8 | disk << 4 | partition      xvd, disks and partitions up to 15
> +   252 << 8 | disk << 4 | partition      vd, disks and partitions up to 15
>      8 << 8 | disk << 4 | partition      sd, disks and partitions up to 15
>      3 << 8 | disk << 6 | partition      hd, disks 0..1, partitions 0..63
>     22 << 8 | (disk-2) << 6 | partition  hd, disks 2..3, partitions 0..63
> diff -r 4b0692880dfa tools/libxl/libxl_device.c
> --- a/tools/libxl/libxl_device.c        Thu May 05 17:40:34 2011 +0100
> +++ b/tools/libxl/libxl_device.c        Sun May 08 12:46:00 2011 +0900
> @@ -238,6 +238,13 @@
>         if (pdisk) *pdisk = disk;
>         if (ppartition) *ppartition = partition;
>         return (8 << 8) | (disk << 4) | partition;
> +    }
> +    if (device_virtdisk_matches(virtpath, "vd",
> +                                &disk, 15,
> +                                &partition, 15)) {
> +        if (pdisk) *pdisk = disk;
> +        if (ppartition) *ppartition = partition;
> +        return (252 << 8) | (disk << 4) | partition;
>     }
>     return -1;
>  }
> diff -r 4b0692880dfa tools/libxl/libxl_dm.c
> --- a/tools/libxl/libxl_dm.c    Thu May 05 17:40:34 2011 +0100
> +++ b/tools/libxl/libxl_dm.c    Sun May 08 12:46:00 2011 +0900
> @@ -418,6 +418,10 @@
>                 if (strncmp(disks[i].vdev, "sd", 2) == 0)
>                     drive = libxl__sprintf
>                         (gc, "file=%s,if=scsi,bus=0,unit=%d,format=%s",
> +                         disks[i].pdev_path, disk, format);
> +                else if (strncmp(disks[i].vdev, "vd", 2) == 0)
> +                    drive = libxl__sprintf
> +                        (gc, "file=%s,if=virtio,bus=0,unit=%d,format=%s",
>                          disks[i].pdev_path, disk, format);
>                 else if (disk < 4)
>                     drive = libxl__sprintf
>
> --
> Takeshi HASEGAWA <hasegaw@gmail.com>
>

Thanks, I just started working on VirtIO block support yesterday.

I was trying to add support to parse_disk_config() so that we can
specify "-if" option in the config file.

I'm wondering which approach is better -- configure through
device_virtdisk_matches() or parse_disk_config() .

Any suggestions?

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

  reply	other threads:[~2011-05-08  4:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-08  3:48 [PATCH] libxl: virtio-blk-pci support for FV domain Takeshi HASEGAWA
2011-05-08  4:56 ` Wei Liu [this message]
2011-05-08  5:24   ` Wei Liu
2011-05-08 11:26     ` Takeshi HASEGAWA
2011-05-09  9:04       ` Ian Campbell
2011-05-09 14:44       ` Stefano Stabellini
2011-05-09  8:56 ` Ian Campbell
2011-05-09  9:01   ` Ian Campbell

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='BANLkTimfyi1okskdUa=5CA0L=Ld-__QrGw@mail.gmail.com' \
    --to=liuw@liuw.name \
    --cc=Xen-devel@lists.xensource.com \
    --cc=anthony.perard@citrix.com \
    --cc=hasegaw@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).