Skip to content

(Refactored) VHD Support Addition

Ben Guthro xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4(Refactored) provide vhd support to qemutools/ioemu/Makefile.target tools/ioemu/block-vhd.c tools/ioemu/block.c +2 more+209 -82 replies
2/4(Refactored) provide vhd support to blktaptools/blktap/drivers/Makefile tools/blktap/drivers/block-vhd.c tools/blktap/drivers/tapdisk.c +1 more+376 -90 replies
3/4(Refactored) Add error checking in blktapctrltools/blktap/drivers/blktapctrl.c+22 -50 replies
4/4(Refactored) Add libvdisk, and vdisk_tooltools/Makefile tools/vdisk/Makefile tools/vdisk/list.h +9 more+4186 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] (Refactored) VHD Support Addition

[PATCH 0/4] (Refactored) VHD Support addition
The patches that follow implement Microsoft's VHD format support, and apply to xen-unstable.hg CS 15414:3827b12d24dd
Per Mark McLoughlin's suggestions - these have been reworked to use the tapaio wrapper.

This is based on the VHD format spec covered by Microsoft's "Open Specification Promise":
http://www.microsoft.com/interop/osp/default.mspx
MS VHD Spec can be found at the following link:
http://download.microsoft.com/download/f/f/e/ffef50a5-07dd-4cf8-aaa3-442c0673a029/Virtual%20Hard%20Disk%20Format%20Spec_10_18_06.doc

It is divided up into the following patches:

qemu-vhd-support.patch        [1/4]
tapdisk-vhd-support.patch     [2/4]
blktap-fixes.patch            [3/4]
vdisk-support.patch           [4/4]

### libvdisk ####
These patches implement a shared library (libvdisk) between qemu, and blktap which can be expanded upon for additional formats in the future. This was done in order to avoid code duplcation between the two areas. At this time, it only supports the vhd format.

### vdisk_tool ###
The vdisk_tool provides a means of creating, and converting vhd files. Like libvdisk, it is designed with future support of additional formats in mind, but currently only supports vhd.

Usage: vdisk_tool OPTIONS -# <format-specific options> <filename>
OPTIONS:
[-f <format>] [-C] [-H] [-M] [-D <block> [-b <num_blocks>] -o outfile]]
-C Create a vdisk
-H Read vdisk headers from file
-M Modify a vdisk
-D Dump a vhd
block first block to read (required)
num_blocks number of blocks to read. If not
specified, whole file will be read
outfile output file. If not specified,
stdout is used

With this, you can convert foo.vhd to raw volume /dev/foo/bar:
vdisk_tool -D 0 -o /dev/foo/bar foo.vhd

To convert foo.vhd to fixed bar.vhd
vdisk_tool -D 0 -o bar.vhd foo.vhd
vdisk_tool -C -# -S <sizeB> -f bar.vhd

To read blocks 2 through 6 from foo.vhd to stdout:
vdisk_tool -D 2 -b 5 foo.vhd