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

[Xen-devel] Re: [PATCH] libxl: virtio-blk-pci support for FV domain



On Sun, May 8, 2011 at 11:48 AM, Takeshi HASEGAWA <hasegaw@xxxxxxxxx> 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@xxxxxxxxx>
>
> 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@xxxxxxxxx>
>

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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.