[PATCH 0/6] qemu: Fix crash when validating a XML without disk's <target>

Peter Krempa posted 6 patches 2 weeks, 4 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1631020910.git.pkrempa@redhat.com
src/conf/domain_conf.c                        |  1 +
src/conf/domain_validate.c                    | 94 ++++++++++++++-----
src/conf/domain_validate.h                    |  2 +
src/libvirt_private.syms                      |  1 +
src/qemu/qemu_domain.c                        | 50 ----------
src/qemu/qemu_domain.h                        |  3 -
src/qemu/qemu_driver.c                        |  2 +-
src/qemu/qemu_validate.c                      |  3 -
.../default-video-type-x86_64-caps-test-0.err |  2 +-
.../disk-fdc-incompatible-address.err         |  2 +-
.../disk-ide-incompatible-address.err         |  2 +-
.../disk-missing-target-invalid.err           |  1 +
.../disk-missing-target-invalid.xml           | 22 +++++
.../disk-sata-incompatible-address.err        |  2 +-
.../disk-scsi-incompatible-address.err        |  2 +-
.../pseries-default-phb-numa-node.err         |  2 +-
.../pseries-phb-invalid-target-index-1.err    |  2 +-
.../pseries-phb-invalid-target-index-2.err    |  2 +-
.../pseries-phb-invalid-target-index-3.err    |  2 +-
.../video-invalid-multiple-devices.err        |  2 +-
...splay-device-pci-address.x86_64-latest.err |  2 +-
tests/qemuxml2argvtest.c                      |  1 +
22 files changed, 109 insertions(+), 93 deletions(-)
create mode 100644 tests/qemuxml2argvdata/disk-missing-target-invalid.err
create mode 100644 tests/qemuxml2argvdata/disk-missing-target-invalid.xml

[PATCH 0/6] qemu: Fix crash when validating a XML without disk's <target>

Posted by Peter Krempa 2 weeks, 4 days ago
Apart from fixing the crash the validation code is fixed to do the
correct thing and a test case is added.

Peter Krempa (6):
  qemuDomainDefValidateDiskLunSource: Unbreak error messages
  conf: validate: Move qemu-specific LUN disk validation to global
    validation
  conf: validate: Run global device definition validation before
    callbacks
  conf: Don't call 'virDomainDiskDefAssignAddress' when disk->dst is
    NULL
  virDomainDiskDefValidate: Move validation of disk target
  qemuxml2argvtest: Add test case for missing disk '<target>'

 src/conf/domain_conf.c                        |  1 +
 src/conf/domain_validate.c                    | 94 ++++++++++++++-----
 src/conf/domain_validate.h                    |  2 +
 src/libvirt_private.syms                      |  1 +
 src/qemu/qemu_domain.c                        | 50 ----------
 src/qemu/qemu_domain.h                        |  3 -
 src/qemu/qemu_driver.c                        |  2 +-
 src/qemu/qemu_validate.c                      |  3 -
 .../default-video-type-x86_64-caps-test-0.err |  2 +-
 .../disk-fdc-incompatible-address.err         |  2 +-
 .../disk-ide-incompatible-address.err         |  2 +-
 .../disk-missing-target-invalid.err           |  1 +
 .../disk-missing-target-invalid.xml           | 22 +++++
 .../disk-sata-incompatible-address.err        |  2 +-
 .../disk-scsi-incompatible-address.err        |  2 +-
 .../pseries-default-phb-numa-node.err         |  2 +-
 .../pseries-phb-invalid-target-index-1.err    |  2 +-
 .../pseries-phb-invalid-target-index-2.err    |  2 +-
 .../pseries-phb-invalid-target-index-3.err    |  2 +-
 .../video-invalid-multiple-devices.err        |  2 +-
 ...splay-device-pci-address.x86_64-latest.err |  2 +-
 tests/qemuxml2argvtest.c                      |  1 +
 22 files changed, 109 insertions(+), 93 deletions(-)
 create mode 100644 tests/qemuxml2argvdata/disk-missing-target-invalid.err
 create mode 100644 tests/qemuxml2argvdata/disk-missing-target-invalid.xml

-- 
2.31.1

Re: [PATCH 0/6] qemu: Fix crash when validating a XML without disk's <target>

Posted by Michal Prívozník 2 weeks, 3 days ago
On 9/7/21 3:22 PM, Peter Krempa wrote:
> Apart from fixing the crash the validation code is fixed to do the
> correct thing and a test case is added.
> 
> Peter Krempa (6):
>   qemuDomainDefValidateDiskLunSource: Unbreak error messages
>   conf: validate: Move qemu-specific LUN disk validation to global
>     validation
>   conf: validate: Run global device definition validation before
>     callbacks
>   conf: Don't call 'virDomainDiskDefAssignAddress' when disk->dst is
>     NULL
>   virDomainDiskDefValidate: Move validation of disk target
>   qemuxml2argvtest: Add test case for missing disk '<target>'
> 
>  src/conf/domain_conf.c                        |  1 +
>  src/conf/domain_validate.c                    | 94 ++++++++++++++-----
>  src/conf/domain_validate.h                    |  2 +
>  src/libvirt_private.syms                      |  1 +
>  src/qemu/qemu_domain.c                        | 50 ----------
>  src/qemu/qemu_domain.h                        |  3 -
>  src/qemu/qemu_driver.c                        |  2 +-
>  src/qemu/qemu_validate.c                      |  3 -
>  .../default-video-type-x86_64-caps-test-0.err |  2 +-
>  .../disk-fdc-incompatible-address.err         |  2 +-
>  .../disk-ide-incompatible-address.err         |  2 +-
>  .../disk-missing-target-invalid.err           |  1 +
>  .../disk-missing-target-invalid.xml           | 22 +++++
>  .../disk-sata-incompatible-address.err        |  2 +-
>  .../disk-scsi-incompatible-address.err        |  2 +-
>  .../pseries-default-phb-numa-node.err         |  2 +-
>  .../pseries-phb-invalid-target-index-1.err    |  2 +-
>  .../pseries-phb-invalid-target-index-2.err    |  2 +-
>  .../pseries-phb-invalid-target-index-3.err    |  2 +-
>  .../video-invalid-multiple-devices.err        |  2 +-
>  ...splay-device-pci-address.x86_64-latest.err |  2 +-
>  tests/qemuxml2argvtest.c                      |  1 +
>  22 files changed, 109 insertions(+), 93 deletions(-)
>  create mode 100644 tests/qemuxml2argvdata/disk-missing-target-invalid.err
>  create mode 100644 tests/qemuxml2argvdata/disk-missing-target-invalid.xml
> 

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal