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

Peter Krempa posted 15 patches 4 years, 1 month ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1581530481.git.pkrempa@redhat.com
docs/formatdomain.html.in                     |  14 ++
docs/schemas/domaincommon.rng                 |  19 ++
src/conf/domain_conf.c                        |  86 +++++++++
src/qemu/qemu_block.c                         | 169 ++++++++++++++----
src/qemu/qemu_block.h                         |   4 +
src/qemu/qemu_blockjob.c                      |   1 +
src/qemu/qemu_command.c                       |   8 +
src/qemu/qemu_domain.c                        |  36 +++-
src/util/virstoragefile.c                     |  49 +++++
src/util/virstoragefile.h                     |  12 ++
tests/qemublocktest.c                         |   2 +
.../qcow2-backing-qcow2-slice.json            |  15 ++
.../imagecreate/qcow2-backing-qcow2-slice.xml |   1 +
.../imagecreate/qcow2-backing-raw-slice.json  |  15 ++
.../imagecreate/qcow2-backing-raw-slice.xml   |   1 +
.../imagecreate/qcow2-slice.xml               |  14 ++
.../imagecreate/raw-slice.xml                 |  14 ++
tests/qemustatusxml2xmldata/modern-in.xml     |   4 +
.../disk-slices.x86_64-latest.args            |  53 ++++++
tests/qemuxml2argvdata/disk-slices.xml        |  45 +++++
tests/qemuxml2argvtest.c                      |   2 +
.../disk-slices.x86_64-latest.xml             |  56 ++++++
tests/qemuxml2xmltest.c                       |   2 +
tests/virstoragetest.c                        |  13 ++
24 files changed, 590 insertions(+), 45 deletions(-)
create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-backing-qcow2-slice.json
create mode 120000 tests/qemublocktestdata/imagecreate/qcow2-backing-qcow2-slice.xml
create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-backing-raw-slice.json
create mode 120000 tests/qemublocktestdata/imagecreate/qcow2-backing-raw-slice.xml
create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-slice.xml
create mode 100644 tests/qemublocktestdata/imagecreate/raw-slice.xml
create mode 100644 tests/qemuxml2argvdata/disk-slices.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/disk-slices.xml
create mode 100644 tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml
[PATCH v3 00/15] qemu: Handle 'size' and 'offset' attributes of 'raw' format
Posted by Peter Krempa 4 years, 1 month ago
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.

The previous version attempted an easy route, but that didn't cover all
cases. This version adds storage slice support for everything except
image creation.

https://bugzilla.redhat.com/show_bug.cgi?id=1791788

Peter Krempa (15):
  qemu: domain: Refactor formatting of node names into status XML
  docs: formatdomain: Close <source> on one of disk examples
  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
  qemu: block: forbid creation of storage sources with <slice>
  docs: Document the new <slices> sub-element of disk's <source>
  conf: Implement support for <slices> of disk source
  qemu: domain: Store nodenames of slice in status XML
  qemu: block: Properly format storage slice into backing store strings
  tests: qemublock: Add cases for creating image overlays on top of
    disks with <slice>
  qemu: Add support for slices of type 'storage'
  tests: qemu: Add test data for the new <slice> element
  virStorageSourceParseBackingJSONRaw: Parse 'offset' and 'size'
    attributes

 docs/formatdomain.html.in                     |  14 ++
 docs/schemas/domaincommon.rng                 |  19 ++
 src/conf/domain_conf.c                        |  86 +++++++++
 src/qemu/qemu_block.c                         | 169 ++++++++++++++----
 src/qemu/qemu_block.h                         |   4 +
 src/qemu/qemu_blockjob.c                      |   1 +
 src/qemu/qemu_command.c                       |   8 +
 src/qemu/qemu_domain.c                        |  36 +++-
 src/util/virstoragefile.c                     |  49 +++++
 src/util/virstoragefile.h                     |  12 ++
 tests/qemublocktest.c                         |   2 +
 .../qcow2-backing-qcow2-slice.json            |  15 ++
 .../imagecreate/qcow2-backing-qcow2-slice.xml |   1 +
 .../imagecreate/qcow2-backing-raw-slice.json  |  15 ++
 .../imagecreate/qcow2-backing-raw-slice.xml   |   1 +
 .../imagecreate/qcow2-slice.xml               |  14 ++
 .../imagecreate/raw-slice.xml                 |  14 ++
 tests/qemustatusxml2xmldata/modern-in.xml     |   4 +
 .../disk-slices.x86_64-latest.args            |  53 ++++++
 tests/qemuxml2argvdata/disk-slices.xml        |  45 +++++
 tests/qemuxml2argvtest.c                      |   2 +
 .../disk-slices.x86_64-latest.xml             |  56 ++++++
 tests/qemuxml2xmltest.c                       |   2 +
 tests/virstoragetest.c                        |  13 ++
 24 files changed, 590 insertions(+), 45 deletions(-)
 create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-backing-qcow2-slice.json
 create mode 120000 tests/qemublocktestdata/imagecreate/qcow2-backing-qcow2-slice.xml
 create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-backing-raw-slice.json
 create mode 120000 tests/qemublocktestdata/imagecreate/qcow2-backing-raw-slice.xml
 create mode 100644 tests/qemublocktestdata/imagecreate/qcow2-slice.xml
 create mode 100644 tests/qemublocktestdata/imagecreate/raw-slice.xml
 create mode 100644 tests/qemuxml2argvdata/disk-slices.x86_64-latest.args
 create mode 100644 tests/qemuxml2argvdata/disk-slices.xml
 create mode 100644 tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml

-- 
2.24.1

Re: [PATCH v3 00/15] qemu: Handle 'size' and 'offset' attributes of 'raw' format
Posted by Richard W.M. Jones 4 years, 1 month ago
On Wed, Feb 12, 2020 at 07:03:11PM +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.
> 
> The previous version attempted an easy route, but that didn't cover all
> cases. This version adds storage slice support for everything except
> image creation.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1791788

This one seems to handle the ‘virt-v2v -i ova’ case, so it's good from
my point of view.

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