[PATCH 00/15] qemu: Handle 'size' and 'offset' attributes of 'raw' format

Richard W.M. Jones rjones at redhat.com
Thu Feb 6 21:21:49 UTC 2020


On Thu, Feb 06, 2020 at 08:51:52AM +0100, Peter Krempa wrote:
> This series fixes and improves the 'json:' pseudo-protocol parser and
> implements the 'offset' and 'size' attributes and exposes them as
> <slice> in the XML.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1791788
> 
> Peter Krempa (15):
>   virStorageSourceParseBackingJSON: Pass around original backing file
>     string
>   virStorageSourceParseBackingJSON: Move deflattening of json: URIs out
>     of recursion
>   virStorageSourceJSONDriverParser: annotate 'format' drivers
>   virStorageSourceParseBackingJSON: Allow 'json:' pseudo URIs without
>     'file' wrapper
>   virStorageSourceParseBackingJSON: Prevent arbitrary nesting with
>     format drivers
>   tests: virstorage: Add test cases for "json:" pseudo-URI without
>     'file' wrapper
>   tests: virstorage: Add test data for json specified raw image with
>     offset/size
>   util: virstoragefile: Add data structure for storing storage source
>     slices
>   qemuBlockStorageSourceGetFormatRawProps: format 'offset' and 'size'
>     for slice
>   qemuDomainValidateStorageSource: Reject unsupported slices
>   docs: formatdomain: Close <source> on one of disk examples
>   docs: Document the new <slices> sub-element of disk's <source>
>   conf: Implement support for <slices> of disk source
>   tests: qemu: Add test data for the new <slice> element
>   virStorageSourceParseBackingJSONRaw: Parse 'offset' and 'size'
>     attributes

So with this patch, virt-v2v -i ova now fails with:

  Original error from libvirt: unsupported configuration: format slice
  is not supported for format 'vmdk' [code=67 int1=-1]

The overlay was created (by virt-v2v) with:

$ qemu-img create -q -f qcow2 -b 'json:{ "file": { "driver": "raw", "offset": 512, "size": 349405696, "file": { "driver": "file", "filename": "/var/tmp/First.ova" } } }' -o 'compat=1.1,backing_fmt=vmdk' /tmp/v2vovl.qcow2

A simple test case to use is:

$ wget http://oirase.annexia.org/tmp/First.ova
$ virt-v2v -i ova First.ova -o null -v -x

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top




More information about the libvir-list mailing list