[PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes

Peter Krempa posted 7 patches 3 months, 2 weeks ago
Failed in applying to current master (apply log)
src/conf/domain_conf.c                        | 26 ++++++++++---
src/conf/domain_postparse.c                   | 21 ++++++++++
src/qemu/qemu_command.c                       | 19 ----------
src/qemu/qemu_domain_address.c                | 14 +++++--
src/qemu/qemu_validate.c                      |  9 +++++
.../autoindex.x86_64-latest.args              |  4 +-
.../channel-virtio-default.x86_64-latest.args |  2 +-
.../channel-virtio-unix.x86_64-latest.args    |  2 +-
.../chardev-reconnect.x86_64-latest.args      |  2 +-
.../pci-autoadd-idx.x86_64-latest.args        | 16 ++++----
.../pseries-many-buses-2.ppc64-latest.args    |  4 +-
.../shmem-invalid-size.x86_64-latest.err      |  2 +-
.../shmem-small-size.x86_64-latest.err        |  2 +-
.../aarch64-virt-graphics.aarch64-latest.xml  |  6 +--
.../aarch64-virt-headless.aarch64-latest.xml  |  6 +--
.../aarch64-virt-virtio.aarch64-4.2.0.xml     |  6 +--
.../aarch64-virt-virtio.aarch64-latest.xml    |  6 +--
...rch64-virtio-pci-default.aarch64-4.2.0.xml |  6 +--
...ch64-virtio-pci-default.aarch64-latest.xml |  6 +--
...io-pci-manual-addresses.aarch64-latest.xml |  6 +--
.../arm-virt-virtio.aarch64-latest.xml        |  6 +--
.../autoindex.x86_64-latest.xml               | 12 +++---
.../channel-virtio-auto.x86_64-latest.xml     |  2 +-
.../channel-virtio-autoadd.x86_64-latest.xml  |  2 +-
.../channel-virtio-default.x86_64-latest.xml  |  6 +--
.../channel-virtio-unix.x86_64-latest.xml     |  6 +--
.../chardev-reconnect.x86_64-latest.xml       |  6 +--
.../console-compat2.x86_64-latest.xml         |  2 +-
.../cpu-host-model-kvm.x86_64-4.2.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-5.0.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-5.1.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-5.2.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-6.0.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-6.1.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-6.2.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-7.0.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-7.1.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-7.2.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-8.0.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-8.1.0.xml       | 12 +++---
.../cpu-host-model-kvm.x86_64-latest.xml      | 12 +++---
.../cpu-host-model-tcg.x86_64-4.2.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-5.0.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-5.1.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-5.2.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-6.0.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-6.1.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-6.2.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-7.0.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-7.1.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-7.2.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-8.0.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-8.1.0.xml       | 12 +++---
.../cpu-host-model-tcg.x86_64-latest.xml      | 12 +++---
.../disk-floppy-q35.x86_64-latest.xml         |  8 ++--
...dev-scsi-autogen-address.x86_64-latest.xml |  6 +--
...tdev-vfio-zpci-boundaries.s390x-latest.xml |  4 +-
...f-aarch64-virt-headless.aarch64-latest.xml |  6 +--
.../hvf-x86_64-q35-headless.x86_64-latest.xml |  6 +--
...ach-virt-console-virtio.aarch64-latest.xml |  6 +--
.../net-isolated-port.x86_64-latest.xml       | 12 +++---
.../pci-autoadd-idx.x86_64-latest.xml         | 22 +++++------
.../pcie-expander-bus.x86_64-latest.xml       | 10 ++---
.../pcie-root.x86_64-latest.xml               | 12 +++---
...cie-switch-upstream-port.x86_64-latest.xml | 10 ++---
.../pcihole64-q35.x86_64-latest.xml           | 12 +++---
.../pseries-many-buses-2.ppc64-latest.xml     |  6 +--
...eries-phb-default-missing.ppc64-latest.xml |  8 ++--
.../qemuxml2xmloutdata/q35.x86_64-latest.xml  | 12 +++---
.../riscv64-virt-graphics.riscv64-latest.xml  |  6 +--
.../riscv64-virt-headless.riscv64-latest.xml  |  6 +--
.../shmem-invalid-size.x86_64-latest.xml      | 34 -----------------
.../shmem-small-size.x86_64-latest.xml        | 34 -----------------
.../user-aliases2.x86_64-latest.xml           |  8 ++--
.../watchdog-q35-multiple.x86_64-latest.xml   | 12 +++---
.../x86_64-q35-graphics.x86_64-latest.xml     |  6 +--
.../x86_64-q35-headless.x86_64-latest.xml     |  6 +--
tests/qemuxmlconftest.c                       | 38 ++++++++++++++++++-
78 files changed, 405 insertions(+), 404 deletions(-)
delete mode 100644 tests/qemuxml2xmloutdata/shmem-invalid-size.x86_64-latest.xml
delete mode 100644 tests/qemuxml2xmloutdata/shmem-small-size.x86_64-latest.xml
[PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes
Posted by Peter Krempa 3 months, 2 weeks ago
This series depends on the 'part 2' with cover letter's subject:

  [PATCH 00/23] qemu XML testing improvements, part 2 - enforcement of xml->xml testing

both this along with the rebased prerequisite series can be fetched
 from:

  git fetch https://gitlab.com/pipo.sk/libvirt.git test-improvements-3

The main goal of part 3 is to add testing based on parsing of the
libvirt-formatted files from tests/qemuxml2xmloutdata and formatting
them back, and checking that they are identical.

By adding this testing multiple problems in code auto-adding information
was discovered.

Peter Krempa (7):
  virDomainDefMaybeAddVirtioSerialController: Reformat hard to read
    linebreaks
  conf: domain: Insert auto-added controllers in same order as in XML
    parser
  virDomainAssignControllerIndexes: Ensure controller ordering after
    assigning indexes
  qemu: Move 'shmem' device size validation to qemu_validate
  qemuDomainAssignPCIAddresses: Assign extension addresses when
    auto-assigning PCI address
  virDomainDefAddConsoleCompat: Fix numbering of console targets after
    modification
  qemuxml2conftest: Test re-parsing of formatted XML

 src/conf/domain_conf.c                        | 26 ++++++++++---
 src/conf/domain_postparse.c                   | 21 ++++++++++
 src/qemu/qemu_command.c                       | 19 ----------
 src/qemu/qemu_domain_address.c                | 14 +++++--
 src/qemu/qemu_validate.c                      |  9 +++++
 .../autoindex.x86_64-latest.args              |  4 +-
 .../channel-virtio-default.x86_64-latest.args |  2 +-
 .../channel-virtio-unix.x86_64-latest.args    |  2 +-
 .../chardev-reconnect.x86_64-latest.args      |  2 +-
 .../pci-autoadd-idx.x86_64-latest.args        | 16 ++++----
 .../pseries-many-buses-2.ppc64-latest.args    |  4 +-
 .../shmem-invalid-size.x86_64-latest.err      |  2 +-
 .../shmem-small-size.x86_64-latest.err        |  2 +-
 .../aarch64-virt-graphics.aarch64-latest.xml  |  6 +--
 .../aarch64-virt-headless.aarch64-latest.xml  |  6 +--
 .../aarch64-virt-virtio.aarch64-4.2.0.xml     |  6 +--
 .../aarch64-virt-virtio.aarch64-latest.xml    |  6 +--
 ...rch64-virtio-pci-default.aarch64-4.2.0.xml |  6 +--
 ...ch64-virtio-pci-default.aarch64-latest.xml |  6 +--
 ...io-pci-manual-addresses.aarch64-latest.xml |  6 +--
 .../arm-virt-virtio.aarch64-latest.xml        |  6 +--
 .../autoindex.x86_64-latest.xml               | 12 +++---
 .../channel-virtio-auto.x86_64-latest.xml     |  2 +-
 .../channel-virtio-autoadd.x86_64-latest.xml  |  2 +-
 .../channel-virtio-default.x86_64-latest.xml  |  6 +--
 .../channel-virtio-unix.x86_64-latest.xml     |  6 +--
 .../chardev-reconnect.x86_64-latest.xml       |  6 +--
 .../console-compat2.x86_64-latest.xml         |  2 +-
 .../cpu-host-model-kvm.x86_64-4.2.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-5.0.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-5.1.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-5.2.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-6.0.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-6.1.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-6.2.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-7.0.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-7.1.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-7.2.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-8.0.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-8.1.0.xml       | 12 +++---
 .../cpu-host-model-kvm.x86_64-latest.xml      | 12 +++---
 .../cpu-host-model-tcg.x86_64-4.2.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-5.0.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-5.1.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-5.2.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-6.0.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-6.1.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-6.2.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-7.0.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-7.1.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-7.2.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-8.0.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-8.1.0.xml       | 12 +++---
 .../cpu-host-model-tcg.x86_64-latest.xml      | 12 +++---
 .../disk-floppy-q35.x86_64-latest.xml         |  8 ++--
 ...dev-scsi-autogen-address.x86_64-latest.xml |  6 +--
 ...tdev-vfio-zpci-boundaries.s390x-latest.xml |  4 +-
 ...f-aarch64-virt-headless.aarch64-latest.xml |  6 +--
 .../hvf-x86_64-q35-headless.x86_64-latest.xml |  6 +--
 ...ach-virt-console-virtio.aarch64-latest.xml |  6 +--
 .../net-isolated-port.x86_64-latest.xml       | 12 +++---
 .../pci-autoadd-idx.x86_64-latest.xml         | 22 +++++------
 .../pcie-expander-bus.x86_64-latest.xml       | 10 ++---
 .../pcie-root.x86_64-latest.xml               | 12 +++---
 ...cie-switch-upstream-port.x86_64-latest.xml | 10 ++---
 .../pcihole64-q35.x86_64-latest.xml           | 12 +++---
 .../pseries-many-buses-2.ppc64-latest.xml     |  6 +--
 ...eries-phb-default-missing.ppc64-latest.xml |  8 ++--
 .../qemuxml2xmloutdata/q35.x86_64-latest.xml  | 12 +++---
 .../riscv64-virt-graphics.riscv64-latest.xml  |  6 +--
 .../riscv64-virt-headless.riscv64-latest.xml  |  6 +--
 .../shmem-invalid-size.x86_64-latest.xml      | 34 -----------------
 .../shmem-small-size.x86_64-latest.xml        | 34 -----------------
 .../user-aliases2.x86_64-latest.xml           |  8 ++--
 .../watchdog-q35-multiple.x86_64-latest.xml   | 12 +++---
 .../x86_64-q35-graphics.x86_64-latest.xml     |  6 +--
 .../x86_64-q35-headless.x86_64-latest.xml     |  6 +--
 tests/qemuxmlconftest.c                       | 38 ++++++++++++++++++-
 78 files changed, 405 insertions(+), 404 deletions(-)
 delete mode 100644 tests/qemuxml2xmloutdata/shmem-invalid-size.x86_64-latest.xml
 delete mode 100644 tests/qemuxml2xmloutdata/shmem-small-size.x86_64-latest.xml

-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes
Posted by Michal Prívozník 1 month, 1 week ago
On 1/12/24 17:05, Peter Krempa wrote:
> The main goal of part 3 is to add testing based on parsing of the
> libvirt-formatted files from tests/qemuxml2xmloutdata and formatting
> them back, and checking that they are identical.

Firstly, sorry for resurrecting an old thread.
Secondly, sorry for hijacking it. BUT.

There were patches sent to the list recently [1] and I realized, the way
we usually used to do things is disturbed. I mean, whenever new device,
device knob, ... was introduced the patch series consisted (roughly) of
the following patches:

1) config, XML parser & formatter, RNG, docs AND xml2xml test case,
2) qemu caps
3) qemu cmd line AND xml2argv test case.

Now, since we have this one huge qemuxmlconftest.c it's not as easy. If
I try to introduce a test case in 1), the test case fails as there's no
corresponding .args file. Fair, but also not fair - the feature is not
finished at the time of 1) so .args shouldn't even be considered. But if
a test case is added at step 3) - well, then anybody backporting 1)
won't get the xml2xml test case. Pity. I mean, that's the whole point we
split the change into "frontend" and "backend", right?

Okay, you may add step 4), which introduces new qemuxmlconftest.c test
case. But it bundles both xml2xml AND xml2argv steps rendering it yet
again unsuitable for backport.

One way out might be to add new testcases to genericxml2xmltest.c, but
somehow that feels wrong.

Michal

1: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/LEAENTOC4GA5DJGGEII4A3BS6YYGO7IP/
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes
Posted by Peter Krempa 1 month, 1 week ago
On Tue, Mar 19, 2024 at 21:31:52 +0100, Michal Prívozník wrote:
> On 1/12/24 17:05, Peter Krempa wrote:
> > The main goal of part 3 is to add testing based on parsing of the
> > libvirt-formatted files from tests/qemuxml2xmloutdata and formatting
> > them back, and checking that they are identical.
> 
> Firstly, sorry for resurrecting an old thread.
> Secondly, sorry for hijacking it. BUT.
> 
> There were patches sent to the list recently [1] and I realized, the way
> we usually used to do things is disturbed. I mean, whenever new device,
> device knob, ... was introduced the patch series consisted (roughly) of
> the following patches:
> 
> 1) config, XML parser & formatter, RNG, docs AND xml2xml test case,
> 2) qemu caps
> 3) qemu cmd line AND xml2argv test case.
> 
> Now, since we have this one huge qemuxmlconftest.c it's not as easy. If
> I try to introduce a test case in 1), the test case fails as there's no
> corresponding .args file.

You can add a corresponding .args file that will not yet have the
commandline bits added by the patches, as the implementation is missing.

This means that the corresponding patch adding the qemu code will need
to contain the corresponding .args change.

> Fair, but also not fair - the feature is not
> finished at the time of 1) so .args shouldn't even be considered.

Well, it still covers what the code does at that point, so at the very
least in theory it makes sense. In practice, it possibly looks a bit
awkward, but the tests can still be added in a separate commit after
both the XML and qemu bits are implemented.

As long as the patches test the code I don't really have a problem with
that.

> But if
> a test case is added at step 3) - well, then anybody backporting 1)
> won't get the xml2xml test case. Pity. I mean, that's the whole point we
> split the change into "frontend" and "backend", right?

This case would be a problem only if a patchset would add
implementations in two hypervisor drivers at same time and you'd decide
to backport only the non-qemu one. In such case the qemu XML coverage
would be missing.

Reallistically that won't happen, but if it did, the corresponding
patches to the other hypervisor driver should add their own tests which
you really should bacport or you can also add genericxml2xmltest cases.

In quite a lot of cases the qemuxml2xmltest case was also added in a
separate commit which is totally fine and the 'backport' case above
would not cover that one either.

> Okay, you may add step 4), which introduces new qemuxmlconftest.c test
> case. But it bundles both xml2xml AND xml2argv steps rendering it yet
> again unsuitable for backport.

I don't see how that would be unsuitable for backport. If you are
backporting a qemu feature, then the qemu* tests are relevant. Otherwise
you should be backporting the corresponding tests at least for that
hypervisor you are adding.

> One way out might be to add new testcases to genericxml2xmltest.c, but
> somehow that feels wrong.

Why? Genericxml2xml test is there for all generic configs. It's just
that most code usually adds a qemu implementation and it's both more
convenient and sufficient to excercise all things to add just the
qemuxmlconftest case.

P.S: 37% qemuxml2argv test cases did not have a corresponding
qemuxml2xmltest case at the time when I've converted it over. Additional
few were actually testing something else due to a mismatch in
capabilities.
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH 0/7] qemu XML testing improvements, part 3 - xmlout->xmlout testing and fixes
Posted by Ján Tomko 3 months, 1 week ago
On a Friday in 2024, Peter Krempa wrote:
>This series depends on the 'part 2' with cover letter's subject:
>
>  [PATCH 00/23] qemu XML testing improvements, part 2 - enforcement of xml->xml testing
>
>both this along with the rebased prerequisite series can be fetched
> from:
>
>  git fetch https://gitlab.com/pipo.sk/libvirt.git test-improvements-3
>
>The main goal of part 3 is to add testing based on parsing of the
>libvirt-formatted files from tests/qemuxml2xmloutdata and formatting
>them back, and checking that they are identical.
>
>By adding this testing multiple problems in code auto-adding information
>was discovered.
>
>Peter Krempa (7):
>  virDomainDefMaybeAddVirtioSerialController: Reformat hard to read
>    linebreaks
>  conf: domain: Insert auto-added controllers in same order as in XML
>    parser
>  virDomainAssignControllerIndexes: Ensure controller ordering after
>    assigning indexes
>  qemu: Move 'shmem' device size validation to qemu_validate
>  qemuDomainAssignPCIAddresses: Assign extension addresses when
>    auto-assigning PCI address
>  virDomainDefAddConsoleCompat: Fix numbering of console targets after
>    modification
>  qemuxml2conftest: Test re-parsing of formatted XML
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org