[PATCH 0/2] Add unit test for timer validation
by Sebastian Mitterle
In v1, the minimal test case is moved to the existing
test suite qemuxml2argv. Support for error message
checking is added.
The error message expectations for existing test cases
have not been validated and reflect the current state.
Localization suppression was tested manually by running
the test suite executable with a different locale that
should have made one of the tests fail if it had been
localized.
Requiring the an expected failure to have an error was
tested manually by using the original qemuxml2argvmock
that didn't create an error message.
Sebastian Mitterle (2):
Add error message check in qemuxml2argv tests
Add unit test for timer validation
src/conf/domain_addr.c | 2 +-
.../440fx-ide-address-conflict.err | 1 +
tests/qemuxml2argvdata/440fx-wrong-root.err | 1 +
.../qemuxml2argvdata/aarch64-acpi-nouefi.err | 1 +
...4-features-sve-disabled.aarch64-latest.err | 1 +
.../aarch64-features-sve.aarch64-4.0.0.err | 1 +
.../aarch64-features-wrong.aarch64-latest.err | 1 +
tests/qemuxml2argvdata/aarch64-gic-host.err | 1 +
.../qemuxml2argvdata/aarch64-gic-invalid.err | 1 +
.../qemuxml2argvdata/aarch64-gic-not-arm.err | 1 +
.../qemuxml2argvdata/aarch64-gic-not-virt.err | 1 +
tests/qemuxml2argvdata/aarch64-gic-v3.err | 1 +
.../qemuxml2argvdata/aarch64-kvm-32-on-64.err | 1 +
tests/qemuxml2argvdata/boot-dev+order.err | 1 +
.../boot-menu-enable-with-timeout-invalid.err | 1 +
.../boot-menu-enable-with-timeout.err | 1 +
.../chardev-reconnect-generated-path.err | 1 +
.../chardev-reconnect-invalid-timeout.err | 1 +
.../qemuxml2argvdata/cpu-cache-emulate-l2.err | 1 +
.../cpu-cache-passthrough-l3.err | 1 +
.../cpu-cache-passthrough3.err | 1 +
.../cpu-host-model-nofallback.err | 1 +
.../cpu-hotplug-granularity.err | 1 +
tests/qemuxml2argvdata/cpu-nofallback.err | 1 +
tests/qemuxml2argvdata/cpu-numa-disjoint.err | 1 +
.../qemuxml2argvdata/cpu-numa-memshared-1.err | 1 +
.../qemuxml2argvdata/cpu-numa-memshared-1.xml | 1 +
tests/qemuxml2argvdata/cpu-numa-memshared.err | 1 +
tests/qemuxml2argvdata/cpu-numa3.err | 1 +
.../cpu-qemu-host-passthrough.err | 1 +
tests/qemuxml2argvdata/cpu-s390-features.err | 1 +
.../cputune-iothreadsched-toomuch.err | 1 +
.../cputune-vcpusched-overlap.err | 1 +
.../default-video-type-x86_64-caps-test-0.err | 1 +
.../disk-address-conflict.err | 1 +
...hing-partition-nosupport.x86_64-latest.err | 1 +
.../disk-device-lun-type-invalid.err | 1 +
.../disk-fdc-incompatible-address.err | 1 +
.../qemuxml2argvdata/disk-floppy-pseries.err | 1 +
tests/qemuxml2argvdata/disk-fmt-cow.err | 1 +
tests/qemuxml2argvdata/disk-fmt-dir.err | 1 +
tests/qemuxml2argvdata/disk-fmt-iso.err | 1 +
.../disk-hostdev-scsi-address-conflict.err | 1 +
.../disk-ide-incompatible-address.err | 1 +
...-network-iscsi-auth-secrettype-invalid.err | 1 +
...sk-network-iscsi-auth-wrong-secrettype.err | 1 +
.../disk-network-rbd-no-colon.err | 1 +
.../disk-network-source-auth-both.err | 1 +
tests/qemuxml2argvdata/disk-same-targets.err | 1 +
.../disk-sata-incompatible-address.err | 1 +
.../disk-scsi-disk-vpd-build-error.err | 1 +
.../disk-scsi-incompatible-address.err | 1 +
tests/qemuxml2argvdata/disk-shared-qcow.err | 1 +
tests/qemuxml2argvdata/disk-usb-nosupport.err | 1 +
tests/qemuxml2argvdata/disk-usb-pci.err | 1 +
...raphics-sdl-egl-headless.x86_64-latest.err | 1 +
...ice-invalid-egl-headless.x86_64-latest.err | 1 +
.../hostdev-mdev-display-missing-graphics.err | 1 +
.../hostdev-mdev-invalid-target-address.err | 1 +
.../hostdev-mdev-src-address-invalid.err | 1 +
...vhost-scsi-pci-boot-fail.x86_64-latest.err | 1 +
...ys-mdev-vfio-ap-boot-fail.s390x-latest.err | 1 +
...subsys-mdev-vfio-ccw-duplicate-address.err | 1 +
...v-subsys-mdev-vfio-ccw-invalid-address.err | 1 +
.../hostdev-subsys-mdev-vfio-ccw.err | 1 +
.../hostdev-vfio-zpci-autogenerate-fids.err | 1 +
.../hostdev-vfio-zpci-duplicate.err | 1 +
...ostdev-vfio-zpci-invalid-uid-valid-fid.err | 1 +
.../hostdev-vfio-zpci-set-zero.err | 1 +
.../hostdev-vfio-zpci-uid-set-zero.err | 1 +
.../hostdev-vfio-zpci-wrong-arch.err | 1 +
tests/qemuxml2argvdata/hostdev-vfio-zpci.err | 1 +
.../hostdevs-drive-address-conflict.err | 1 +
.../hugepages-default-1G-nodeset-2M.err | 1 +
.../hugepages-memaccess-invalid.err | 1 +
.../qemuxml2argvdata/hugepages-memaccess3.err | 1 +
.../hugepages-nodeset-nonexist.err | 1 +
.../hugepages-numa-nodeset-nonexist.err | 1 +
...ntel-iommu-wrong-machine.x86_64-latest.err | 1 +
tests/qemuxml2argvdata/iothreads-nocap.err | 1 +
tests/qemuxml2argvdata/luks-disk-invalid.err | 1 +
.../luks-disks-source-both.err | 1 +
.../luks-disks-source-qcow2.err | 1 +
.../mach-virt-serial-invalid-machine.err | 1 +
.../machine-aeskeywrap-off-cap.err | 1 +
.../machine-aeskeywrap-off-caps.err | 1 +
.../machine-aeskeywrap-on-cap.err | 1 +
.../machine-aeskeywrap-on-caps.err | 1 +
.../machine-deakeywrap-off-cap.err | 1 +
.../machine-deakeywrap-off-caps.err | 1 +
.../machine-deakeywrap-on-cap.err | 1 +
.../machine-deakeywrap-on-caps.err | 1 +
.../machine-loadparm-s390-char-invalid.err | 1 +
.../machine-loadparm-s390-len-invalid.err | 1 +
tests/qemuxml2argvdata/memory-align-fail.err | 1 +
.../memory-hotplug-nonuma.err | 1 +
tests/qemuxml2argvdata/minimal-no-memory.err | 1 +
tests/qemuxml2argvdata/misc-enable-s4.err | 1 +
tests/qemuxml2argvdata/missing-machine.err | 1 +
tests/qemuxml2argvdata/net-hostdev-fail.err | 1 +
tests/qemuxml2argvdata/net-vhostuser-fail.err | 1 +
.../qemuxml2argvdata/net-vhostuser-multiq.err | 1 +
.../net-virtio-rxqueuesize-invalid-size.err | 1 +
tests/qemuxml2argvdata/net-virtio-teaming.err | 1 +
.../non-x86_64-timer-error.err | 1 +
.../non-x86_64-timer-error.xml | 18 +++++++++
...d-auto-vcpu-static-numatune-no-nodeset.err | 1 +
.../numatune-memnode-no-memory.err | 1 +
.../numatune-memnode-nocpu.err | 1 +
tests/qemuxml2argvdata/numatune-memnode.err | 1 +
.../numatune-memnodes-problematic.err | 1 +
.../numatune-memory-invalid-nodeset.err | 1 +
...umatune-static-nodeset-exceed-hostnode.err | 1 +
.../pci-bridge-duplicate-index.err | 1 +
.../pci-bridge-negative-index-invalid.err | 1 +
tests/qemuxml2argvdata/pci-bus-invalid.err | 1 +
tests/qemuxml2argvdata/pci-domain-invalid.err | 1 +
.../pci-expander-bus-bad-bus.err | 1 +
.../pci-expander-bus-bad-machine.err | 1 +
.../pci-expander-bus-bad-node.err | 1 +
.../qemuxml2argvdata/pci-function-invalid.err | 1 +
tests/qemuxml2argvdata/pci-root-address.err | 1 +
.../pci-root-nonzero-index.err | 1 +
tests/qemuxml2argvdata/pci-slot-invalid.err | 1 +
.../pcie-expander-bus-bad-bus.err | 1 +
.../pcie-expander-bus-bad-machine.err | 1 +
.../pcie-root-port-too-many.err | 1 +
tests/qemuxml2argvdata/pcihole64-none.err | 1 +
tests/qemuxml2argvdata/ppc64-tpm-double.err | 1 +
.../ppc64-tpmproxy-double.err | 1 +
.../pseries-cpu-compat-power9.err | 1 +
.../pseries-default-phb-numa-node.err | 1 +
.../qemuxml2argvdata/pseries-features-ccf.err | 1 +
.../qemuxml2argvdata/pseries-features-ccf.xml | 1 +
.../pseries-features-cfpc.err | 1 +
.../pseries-features-cfpc.xml | 1 +
.../pseries-features-hpt-pagesize.err | 1 +
.../pseries-features-hpt-pagesize.xml | 1 +
.../qemuxml2argvdata/pseries-features-htm.err | 1 +
.../qemuxml2argvdata/pseries-features-htm.xml | 1 +
.../pseries-features-htp-resize.err | 1 +
.../pseries-features-htp-resize.xml | 1 +
.../qemuxml2argvdata/pseries-features-ibs.err | 1 +
.../qemuxml2argvdata/pseries-features-ibs.xml | 1 +
.../pseries-features-invalid-machine.err | 1 +
.../pseries-features-nested-hv.err | 1 +
.../pseries-features-nested-hv.xml | 1 +
.../pseries-features-sbbc.err | 1 +
.../pseries-features-sbbc.xml | 1 +
.../qemuxml2argvdata/pseries-no-parallel.err | 1 +
.../pseries-panic-address.err | 1 +
.../pseries-phb-invalid-target-index-1.err | 1 +
.../pseries-phb-invalid-target-index-2.err | 1 +
.../pseries-phb-invalid-target-index-3.err | 1 +
.../pseries-serial-invalid-machine.err | 1 +
.../pseries-spaprvio-invalid.err | 1 +
.../pseries-vio-address-clash.err | 1 +
.../qemuxml2argvdata/q35-dmi-bad-address1.err | 1 +
.../qemuxml2argvdata/q35-dmi-bad-address2.err | 1 +
tests/qemuxml2argvdata/q35-noacpi-uefi.err | 1 +
tests/qemuxml2argvdata/q35-wrong-root.err | 1 +
.../reboot-timeout-enabled.err | 1 +
tests/qemuxml2argvdata/s390-no-parallel.err | 1 +
tests/qemuxml2argvdata/s390-panic-address.err | 1 +
.../seclabel-device-duplicates.err | 1 +
tests/qemuxml2argvdata/seclabel-multiple.err | 1 +
.../serial-unix-missing-source.err | 1 +
.../shmem-invalid-address.err | 1 +
tests/qemuxml2argvdata/shmem-invalid-size.err | 1 +
tests/qemuxml2argvdata/shmem-msi-only.err | 1 +
tests/qemuxml2argvdata/shmem-small-size.err | 1 +
tests/qemuxml2argvdata/shmem.err | 1 +
tests/qemuxml2argvdata/smbios-date.err | 1 +
tests/qemuxml2argvdata/smbios-uuid-match.err | 1 +
.../tpm-no-backend-invalid.err | 1 +
.../tseg-explicit-size.x86_64-2.10.0.err | 1 +
.../tseg-i440fx.x86_64-latest.err | 1 +
.../tseg-invalid-size.x86_64-latest.err | 1 +
tests/qemuxml2argvdata/usb-bus-missing.err | 1 +
...usb-controller-default-unavailable-q35.err | 1 +
...sb-controller-explicit-unavailable-q35.err | 1 +
.../usb-controller-qemu-xhci-limit.err | 1 +
.../usb-controller-qemu-xhci-unavailable.err | 1 +
.../usb-controller-xhci-limit.err | 1 +
tests/qemuxml2argvdata/usb-hub-conflict.err | 1 +
.../qemuxml2argvdata/usb-hub-nonexistent.err | 1 +
.../usb-ich9-no-companion.err | 1 +
tests/qemuxml2argvdata/usb-none-hub.err | 1 +
tests/qemuxml2argvdata/usb-none-other.err | 1 +
tests/qemuxml2argvdata/usb-none-usbtablet.err | 1 +
.../usb-ports-out-of-range.err | 1 +
.../usb-too-long-port-path-invalid.err | 1 +
.../vhost-user-fs-readonly.x86_64-latest.err | 1 +
.../qemuxml2argvdata/vhost_queues-invalid.err | 1 +
.../video-invalid-multiple-devices.err | 1 +
...splay-device-pci-address.x86_64-latest.err | 1 +
.../virtio-options-controller-ats.err | 1 +
.../virtio-options-controller-iommu.err | 1 +
.../virtio-options-controller-packed.err | 1 +
.../virtio-options-disk-ats.err | 1 +
.../virtio-options-disk-iommu.err | 1 +
.../virtio-options-disk-packed.err | 1 +
.../virtio-options-fs-ats.err | 1 +
.../virtio-options-fs-iommu.err | 1 +
.../virtio-options-fs-packed.err | 1 +
.../virtio-options-input-ats.err | 1 +
.../virtio-options-input-iommu.err | 1 +
.../virtio-options-input-packed.err | 1 +
.../virtio-options-memballoon-ats.err | 1 +
.../virtio-options-memballoon-iommu.err | 1 +
.../virtio-options-memballoon-packed.err | 1 +
.../virtio-options-net-ats.err | 1 +
.../virtio-options-net-iommu.err | 1 +
.../virtio-options-net-packed.err | 1 +
.../virtio-options-rng-ats.err | 1 +
.../virtio-options-rng-iommu.err | 1 +
.../virtio-options-rng-packed.err | 1 +
.../virtio-options-video-ats.err | 1 +
.../virtio-options-video-iommu.err | 1 +
.../virtio-options-video-packed.err | 1 +
.../qemuxml2argvdata/virtio-rng-egd-crash.err | 1 +
...ansitional-not-supported.x86_64-latest.err | 1 +
tests/qemuxml2argvmock.c | 3 ++
tests/qemuxml2argvtest.c | 40 ++++++++++++++-----
tests/testutilsqemu.c | 1 +
tests/testutilsqemu.h | 1 +
226 files changed, 273 insertions(+), 12 deletions(-)
create mode 100644 tests/qemuxml2argvdata/440fx-ide-address-conflict.err
create mode 100644 tests/qemuxml2argvdata/440fx-wrong-root.err
create mode 100644 tests/qemuxml2argvdata/aarch64-acpi-nouefi.err
create mode 100644 tests/qemuxml2argvdata/aarch64-features-sve-disabled.aarch64-latest.err
create mode 100644 tests/qemuxml2argvdata/aarch64-features-sve.aarch64-4.0.0.err
create mode 100644 tests/qemuxml2argvdata/aarch64-features-wrong.aarch64-latest.err
create mode 100644 tests/qemuxml2argvdata/aarch64-gic-host.err
create mode 100644 tests/qemuxml2argvdata/aarch64-gic-invalid.err
create mode 100644 tests/qemuxml2argvdata/aarch64-gic-not-arm.err
create mode 100644 tests/qemuxml2argvdata/aarch64-gic-not-virt.err
create mode 100644 tests/qemuxml2argvdata/aarch64-gic-v3.err
create mode 100644 tests/qemuxml2argvdata/aarch64-kvm-32-on-64.err
create mode 100644 tests/qemuxml2argvdata/boot-dev+order.err
create mode 100644 tests/qemuxml2argvdata/boot-menu-enable-with-timeout-invalid.err
create mode 100644 tests/qemuxml2argvdata/boot-menu-enable-with-timeout.err
create mode 100644 tests/qemuxml2argvdata/chardev-reconnect-generated-path.err
create mode 100644 tests/qemuxml2argvdata/chardev-reconnect-invalid-timeout.err
create mode 100644 tests/qemuxml2argvdata/cpu-cache-emulate-l2.err
create mode 100644 tests/qemuxml2argvdata/cpu-cache-passthrough-l3.err
create mode 100644 tests/qemuxml2argvdata/cpu-cache-passthrough3.err
create mode 100644 tests/qemuxml2argvdata/cpu-host-model-nofallback.err
create mode 100644 tests/qemuxml2argvdata/cpu-hotplug-granularity.err
create mode 100644 tests/qemuxml2argvdata/cpu-nofallback.err
create mode 100644 tests/qemuxml2argvdata/cpu-numa-disjoint.err
create mode 100644 tests/qemuxml2argvdata/cpu-numa-memshared-1.err
create mode 120000 tests/qemuxml2argvdata/cpu-numa-memshared-1.xml
create mode 100644 tests/qemuxml2argvdata/cpu-numa-memshared.err
create mode 100644 tests/qemuxml2argvdata/cpu-numa3.err
create mode 100644 tests/qemuxml2argvdata/cpu-qemu-host-passthrough.err
create mode 100644 tests/qemuxml2argvdata/cpu-s390-features.err
create mode 100644 tests/qemuxml2argvdata/cputune-iothreadsched-toomuch.err
create mode 100644 tests/qemuxml2argvdata/cputune-vcpusched-overlap.err
create mode 100644 tests/qemuxml2argvdata/default-video-type-x86_64-caps-test-0.err
create mode 100644 tests/qemuxml2argvdata/disk-address-conflict.err
create mode 100644 tests/qemuxml2argvdata/disk-attaching-partition-nosupport.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/disk-device-lun-type-invalid.err
create mode 100644 tests/qemuxml2argvdata/disk-fdc-incompatible-address.err
create mode 100644 tests/qemuxml2argvdata/disk-floppy-pseries.err
create mode 100644 tests/qemuxml2argvdata/disk-fmt-cow.err
create mode 100644 tests/qemuxml2argvdata/disk-fmt-dir.err
create mode 100644 tests/qemuxml2argvdata/disk-fmt-iso.err
create mode 100644 tests/qemuxml2argvdata/disk-hostdev-scsi-address-conflict.err
create mode 100644 tests/qemuxml2argvdata/disk-ide-incompatible-address.err
create mode 100644 tests/qemuxml2argvdata/disk-network-iscsi-auth-secrettype-invalid.err
create mode 100644 tests/qemuxml2argvdata/disk-network-iscsi-auth-wrong-secrettype.err
create mode 100644 tests/qemuxml2argvdata/disk-network-rbd-no-colon.err
create mode 100644 tests/qemuxml2argvdata/disk-network-source-auth-both.err
create mode 100644 tests/qemuxml2argvdata/disk-same-targets.err
create mode 100644 tests/qemuxml2argvdata/disk-sata-incompatible-address.err
create mode 100644 tests/qemuxml2argvdata/disk-scsi-disk-vpd-build-error.err
create mode 100644 tests/qemuxml2argvdata/disk-scsi-incompatible-address.err
create mode 100644 tests/qemuxml2argvdata/disk-shared-qcow.err
create mode 100644 tests/qemuxml2argvdata/disk-usb-nosupport.err
create mode 100644 tests/qemuxml2argvdata/disk-usb-pci.err
create mode 100644 tests/qemuxml2argvdata/graphics-sdl-egl-headless.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/graphics-spice-invalid-egl-headless.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.err
create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-invalid-target-address.err
create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-src-address-invalid.err
create mode 100644 tests/qemuxml2argvdata/hostdev-scsi-vhost-scsi-pci-boot-fail.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ap-boot-fail.s390x-latest.err
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-duplicate-address.err
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-invalid-address.err
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw.err
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-autogenerate-fids.err
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-duplicate.err
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-invalid-uid-valid-fid.err
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-set-zero.err
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-uid-set-zero.err
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci-wrong-arch.err
create mode 100644 tests/qemuxml2argvdata/hostdev-vfio-zpci.err
create mode 100644 tests/qemuxml2argvdata/hostdevs-drive-address-conflict.err
create mode 100644 tests/qemuxml2argvdata/hugepages-default-1G-nodeset-2M.err
create mode 100644 tests/qemuxml2argvdata/hugepages-memaccess-invalid.err
create mode 100644 tests/qemuxml2argvdata/hugepages-memaccess3.err
create mode 100644 tests/qemuxml2argvdata/hugepages-nodeset-nonexist.err
create mode 100644 tests/qemuxml2argvdata/hugepages-numa-nodeset-nonexist.err
create mode 100644 tests/qemuxml2argvdata/intel-iommu-wrong-machine.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/iothreads-nocap.err
create mode 100644 tests/qemuxml2argvdata/luks-disk-invalid.err
create mode 100644 tests/qemuxml2argvdata/luks-disks-source-both.err
create mode 100644 tests/qemuxml2argvdata/luks-disks-source-qcow2.err
create mode 100644 tests/qemuxml2argvdata/mach-virt-serial-invalid-machine.err
create mode 100644 tests/qemuxml2argvdata/machine-aeskeywrap-off-cap.err
create mode 100644 tests/qemuxml2argvdata/machine-aeskeywrap-off-caps.err
create mode 100644 tests/qemuxml2argvdata/machine-aeskeywrap-on-cap.err
create mode 100644 tests/qemuxml2argvdata/machine-aeskeywrap-on-caps.err
create mode 100644 tests/qemuxml2argvdata/machine-deakeywrap-off-cap.err
create mode 100644 tests/qemuxml2argvdata/machine-deakeywrap-off-caps.err
create mode 100644 tests/qemuxml2argvdata/machine-deakeywrap-on-cap.err
create mode 100644 tests/qemuxml2argvdata/machine-deakeywrap-on-caps.err
create mode 100644 tests/qemuxml2argvdata/machine-loadparm-s390-char-invalid.err
create mode 100644 tests/qemuxml2argvdata/machine-loadparm-s390-len-invalid.err
create mode 100644 tests/qemuxml2argvdata/memory-align-fail.err
create mode 100644 tests/qemuxml2argvdata/memory-hotplug-nonuma.err
create mode 100644 tests/qemuxml2argvdata/minimal-no-memory.err
create mode 100644 tests/qemuxml2argvdata/misc-enable-s4.err
create mode 100644 tests/qemuxml2argvdata/missing-machine.err
create mode 100644 tests/qemuxml2argvdata/net-hostdev-fail.err
create mode 100644 tests/qemuxml2argvdata/net-vhostuser-fail.err
create mode 100644 tests/qemuxml2argvdata/net-vhostuser-multiq.err
create mode 100644 tests/qemuxml2argvdata/net-virtio-rxqueuesize-invalid-size.err
create mode 100644 tests/qemuxml2argvdata/net-virtio-teaming.err
create mode 100644 tests/qemuxml2argvdata/non-x86_64-timer-error.err
create mode 100644 tests/qemuxml2argvdata/non-x86_64-timer-error.xml
create mode 100644 tests/qemuxml2argvdata/numad-auto-vcpu-static-numatune-no-nodeset.err
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-no-memory.err
create mode 100644 tests/qemuxml2argvdata/numatune-memnode-nocpu.err
create mode 100644 tests/qemuxml2argvdata/numatune-memnode.err
create mode 100644 tests/qemuxml2argvdata/numatune-memnodes-problematic.err
create mode 100644 tests/qemuxml2argvdata/numatune-memory-invalid-nodeset.err
create mode 100644 tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode.err
create mode 100644 tests/qemuxml2argvdata/pci-bridge-duplicate-index.err
create mode 100644 tests/qemuxml2argvdata/pci-bridge-negative-index-invalid.err
create mode 100644 tests/qemuxml2argvdata/pci-bus-invalid.err
create mode 100644 tests/qemuxml2argvdata/pci-domain-invalid.err
create mode 100644 tests/qemuxml2argvdata/pci-expander-bus-bad-bus.err
create mode 100644 tests/qemuxml2argvdata/pci-expander-bus-bad-machine.err
create mode 100644 tests/qemuxml2argvdata/pci-expander-bus-bad-node.err
create mode 100644 tests/qemuxml2argvdata/pci-function-invalid.err
create mode 100644 tests/qemuxml2argvdata/pci-root-address.err
create mode 100644 tests/qemuxml2argvdata/pci-root-nonzero-index.err
create mode 100644 tests/qemuxml2argvdata/pci-slot-invalid.err
create mode 100644 tests/qemuxml2argvdata/pcie-expander-bus-bad-bus.err
create mode 100644 tests/qemuxml2argvdata/pcie-expander-bus-bad-machine.err
create mode 100644 tests/qemuxml2argvdata/pcie-root-port-too-many.err
create mode 100644 tests/qemuxml2argvdata/pcihole64-none.err
create mode 100644 tests/qemuxml2argvdata/ppc64-tpm-double.err
create mode 100644 tests/qemuxml2argvdata/ppc64-tpmproxy-double.err
create mode 100644 tests/qemuxml2argvdata/pseries-cpu-compat-power9.err
create mode 100644 tests/qemuxml2argvdata/pseries-default-phb-numa-node.err
create mode 100644 tests/qemuxml2argvdata/pseries-features-ccf.err
create mode 120000 tests/qemuxml2argvdata/pseries-features-ccf.xml
create mode 100644 tests/qemuxml2argvdata/pseries-features-cfpc.err
create mode 120000 tests/qemuxml2argvdata/pseries-features-cfpc.xml
create mode 100644 tests/qemuxml2argvdata/pseries-features-hpt-pagesize.err
create mode 120000 tests/qemuxml2argvdata/pseries-features-hpt-pagesize.xml
create mode 100644 tests/qemuxml2argvdata/pseries-features-htm.err
create mode 120000 tests/qemuxml2argvdata/pseries-features-htm.xml
create mode 100644 tests/qemuxml2argvdata/pseries-features-htp-resize.err
create mode 120000 tests/qemuxml2argvdata/pseries-features-htp-resize.xml
create mode 100644 tests/qemuxml2argvdata/pseries-features-ibs.err
create mode 120000 tests/qemuxml2argvdata/pseries-features-ibs.xml
create mode 100644 tests/qemuxml2argvdata/pseries-features-invalid-machine.err
create mode 100644 tests/qemuxml2argvdata/pseries-features-nested-hv.err
create mode 120000 tests/qemuxml2argvdata/pseries-features-nested-hv.xml
create mode 100644 tests/qemuxml2argvdata/pseries-features-sbbc.err
create mode 120000 tests/qemuxml2argvdata/pseries-features-sbbc.xml
create mode 100644 tests/qemuxml2argvdata/pseries-no-parallel.err
create mode 100644 tests/qemuxml2argvdata/pseries-panic-address.err
create mode 100644 tests/qemuxml2argvdata/pseries-phb-invalid-target-index-1.err
create mode 100644 tests/qemuxml2argvdata/pseries-phb-invalid-target-index-2.err
create mode 100644 tests/qemuxml2argvdata/pseries-phb-invalid-target-index-3.err
create mode 100644 tests/qemuxml2argvdata/pseries-serial-invalid-machine.err
create mode 100644 tests/qemuxml2argvdata/pseries-spaprvio-invalid.err
create mode 100644 tests/qemuxml2argvdata/pseries-vio-address-clash.err
create mode 100644 tests/qemuxml2argvdata/q35-dmi-bad-address1.err
create mode 100644 tests/qemuxml2argvdata/q35-dmi-bad-address2.err
create mode 100644 tests/qemuxml2argvdata/q35-noacpi-uefi.err
create mode 100644 tests/qemuxml2argvdata/q35-wrong-root.err
create mode 100644 tests/qemuxml2argvdata/reboot-timeout-enabled.err
create mode 100644 tests/qemuxml2argvdata/s390-no-parallel.err
create mode 100644 tests/qemuxml2argvdata/s390-panic-address.err
create mode 100644 tests/qemuxml2argvdata/seclabel-device-duplicates.err
create mode 100644 tests/qemuxml2argvdata/seclabel-multiple.err
create mode 100644 tests/qemuxml2argvdata/serial-unix-missing-source.err
create mode 100644 tests/qemuxml2argvdata/shmem-invalid-address.err
create mode 100644 tests/qemuxml2argvdata/shmem-invalid-size.err
create mode 100644 tests/qemuxml2argvdata/shmem-msi-only.err
create mode 100644 tests/qemuxml2argvdata/shmem-small-size.err
create mode 100644 tests/qemuxml2argvdata/shmem.err
create mode 100644 tests/qemuxml2argvdata/smbios-date.err
create mode 100644 tests/qemuxml2argvdata/smbios-uuid-match.err
create mode 100644 tests/qemuxml2argvdata/tpm-no-backend-invalid.err
create mode 100644 tests/qemuxml2argvdata/tseg-explicit-size.x86_64-2.10.0.err
create mode 100644 tests/qemuxml2argvdata/tseg-i440fx.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/tseg-invalid-size.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/usb-bus-missing.err
create mode 100644 tests/qemuxml2argvdata/usb-controller-default-unavailable-q35.err
create mode 100644 tests/qemuxml2argvdata/usb-controller-explicit-unavailable-q35.err
create mode 100644 tests/qemuxml2argvdata/usb-controller-qemu-xhci-limit.err
create mode 100644 tests/qemuxml2argvdata/usb-controller-qemu-xhci-unavailable.err
create mode 100644 tests/qemuxml2argvdata/usb-controller-xhci-limit.err
create mode 100644 tests/qemuxml2argvdata/usb-hub-conflict.err
create mode 100644 tests/qemuxml2argvdata/usb-hub-nonexistent.err
create mode 100644 tests/qemuxml2argvdata/usb-ich9-no-companion.err
create mode 100644 tests/qemuxml2argvdata/usb-none-hub.err
create mode 100644 tests/qemuxml2argvdata/usb-none-other.err
create mode 100644 tests/qemuxml2argvdata/usb-none-usbtablet.err
create mode 100644 tests/qemuxml2argvdata/usb-ports-out-of-range.err
create mode 100644 tests/qemuxml2argvdata/usb-too-long-port-path-invalid.err
create mode 100644 tests/qemuxml2argvdata/vhost-user-fs-readonly.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/vhost_queues-invalid.err
create mode 100644 tests/qemuxml2argvdata/video-invalid-multiple-devices.err
create mode 100644 tests/qemuxml2argvdata/video-ramfb-display-device-pci-address.x86_64-latest.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-controller-ats.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-controller-iommu.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-controller-packed.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-disk-ats.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-disk-iommu.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-disk-packed.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-fs-ats.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-fs-iommu.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-fs-packed.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-input-ats.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-input-iommu.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-input-packed.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-memballoon-ats.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-memballoon-iommu.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-memballoon-packed.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-net-ats.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-net-iommu.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-net-packed.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-rng-ats.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-rng-iommu.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-rng-packed.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-video-ats.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-video-iommu.err
create mode 100644 tests/qemuxml2argvdata/virtio-options-video-packed.err
create mode 100644 tests/qemuxml2argvdata/virtio-rng-egd-crash.err
create mode 100644 tests/qemuxml2argvdata/virtio-transitional-not-supported.x86_64-latest.err
--
2.26.2
4 years, 2 months
[PATCH] bhyve: add missing test files
by Roman Bogorodskiy
Fixes: 4277e61e22b7532dc476c44a356081053da470f8
Signed-off-by: Roman Bogorodskiy <bogorodskiy(a)gmail.com>
---
Pushed as build breaker & trivial.
...yvexml2argv-addr-non-isa-controller-on-slot-1.args | 11 +++++++++++
...exml2argv-addr-non-isa-controller-on-slot-1.ldargs | 1 +
2 files changed, 12 insertions(+)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.ldargs
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.args b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.args
new file mode 100644
index 0000000000..cbbf768d71
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.args
@@ -0,0 +1,11 @@
+/usr/sbin/bhyve \
+-c 1 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-l bootrom,/path/to/test.fd \
+-s 2:0,lpc \
+-s 3:0,ahci,hd:/tmp/freebsd.img \
+-s 1:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 bhyve
diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.ldargs b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.ldargs
new file mode 100644
index 0000000000..421376db9e
--- /dev/null
+++ b/tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.ldargs
@@ -0,0 +1 @@
+dummy
--
2.27.0
4 years, 2 months
[PATCH v6 0/3] bhyve: support 'isa' controller for LPC
by Roman Bogorodskiy
Changes since v5:
Added patch 3/3 to allow to use slot 1 for devices other than LPC.
Technically, it can be squashed into the second patch, but this
way it should be easier to review; I can squash it before merging, but
I also it's probably self-contained enough to stay separated.
No changes in 1-2/3 except rebasing.
Roman Bogorodskiy (3):
conf: add 'isa' controller type
bhyve: support 'isa' controller for LPC
bhyve: soften requirements for slot 1
docs/schemas/domaincommon.rng | 6 +++
po/POTFILES.in | 1 -
src/bhyve/bhyve_command.c | 27 +++++++-------
src/bhyve/bhyve_device.c | 37 ++++++++++++-------
src/bhyve/bhyve_domain.c | 25 ++++++++++++-
src/bhyve/bhyve_domain.h | 2 -
src/conf/domain_conf.c | 9 +++++
src/conf/domain_conf.h | 8 ++++
src/qemu/qemu_command.c | 1 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain_address.c | 1 +
src/qemu/qemu_validate.c | 1 +
src/vbox/vbox_common.c | 1 +
...ml2argv-addr-isa-controller-on-slot-1.args | 10 +++++
...2argv-addr-isa-controller-on-slot-1.ldargs | 3 ++
...xml2argv-addr-isa-controller-on-slot-1.xml | 26 +++++++++++++
...l2argv-addr-isa-controller-on-slot-31.args | 10 +++++
...argv-addr-isa-controller-on-slot-31.ldargs | 3 ++
...ml2argv-addr-isa-controller-on-slot-31.xml | 26 +++++++++++++
...argv-addr-non-isa-controller-on-slot-1.xml | 24 ++++++++++++
.../bhyvexml2argv-console.args | 2 +-
.../bhyvexml2argv-isa-controller.args | 10 +++++
.../bhyvexml2argv-isa-controller.ldargs | 3 ++
.../bhyvexml2argv-isa-controller.xml | 24 ++++++++++++
...bhyvexml2argv-isa-multiple-controllers.xml | 25 +++++++++++++
.../bhyvexml2argv-serial-grub-nocons.args | 2 +-
.../bhyvexml2argv-serial-grub.args | 2 +-
.../bhyvexml2argv-serial.args | 2 +-
.../bhyvexml2argvdata/bhyvexml2argv-uefi.args | 4 +-
.../bhyvexml2argv-vnc-autoport.args | 4 +-
.../bhyvexml2argv-vnc-vgaconf-io.args | 4 +-
.../bhyvexml2argv-vnc-vgaconf-off.args | 4 +-
.../bhyvexml2argv-vnc-vgaconf-on.args | 4 +-
.../bhyvexml2argvdata/bhyvexml2argv-vnc.args | 4 +-
tests/bhyvexml2argvtest.c | 5 +++
...l2xmlout-addr-isa-controller-on-slot-1.xml | 36 ++++++++++++++++++
...2xmlout-addr-isa-controller-on-slot-31.xml | 36 ++++++++++++++++++
.../bhyvexml2xmlout-console.xml | 3 ++
.../bhyvexml2xmlout-isa-controller.xml | 36 ++++++++++++++++++
.../bhyvexml2xmlout-serial-grub-nocons.xml | 3 ++
.../bhyvexml2xmlout-serial-grub.xml | 3 ++
.../bhyvexml2xmlout-serial.xml | 3 ++
.../bhyvexml2xmlout-vnc-autoport.xml | 3 ++
.../bhyvexml2xmlout-vnc-vgaconf-io.xml | 3 ++
.../bhyvexml2xmlout-vnc-vgaconf-off.xml | 3 ++
.../bhyvexml2xmlout-vnc-vgaconf-on.xml | 3 ++
.../bhyvexml2xmlout-vnc.xml | 3 ++
tests/bhyvexml2xmltest.c | 3 ++
48 files changed, 412 insertions(+), 47 deletions(-)
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-1.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-isa-controller-on-slot-31.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-addr-non-isa-controller-on-slot-1.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.args
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.ldargs
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-controller.xml
create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-isa-multiple-controllers.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-1.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-addr-isa-controller-on-slot-31.xml
create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-isa-controller.xml
--
2.27.0
4 years, 2 months
[libvirt PATCH] news: Document changes to NVDIMM handling on ppc64
by Andrea Bolognani
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
NEWS.rst | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index a2f7ecaf1d..685c5e2225 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -35,6 +35,13 @@ v6.8.0 (unreleased)
change we also remove dependency on libdbus and possibly fix all the DBus
related libvirtd crashes seen over the time.
+ * Re-introduce NVDIMM auto-alignment for pSeries Guests
+
+ The auto-alignment logic was removed in v6.7.0 in favor of requiring the
+ size provided by the user to be already aligned; however, this had the
+ unintended consequence of breaking some existing guests. v6.8.0 restores
+ the previous behavior.
+
* **Bug fixes**
* **Removed features**
--
2.26.2
4 years, 2 months
[PATCH v1 0/4] revert latest PPC64 NVDIMM changes
by Daniel Henrique Barboza
Hi,
In [1], Daniel pointed out that the changes made by [2]
are uncompliant with the Libvirt design of not doing
anything that can compromise guests in the wild.
This series aims to solve that by reverting the changes
made by [2]. It also enhances the auto-alignment of ppc64
NVDIMM in a way that we can have consistency between the sizes
reported in the domain XML and what QEMU will see, while not
hurting any running guests that are already using the auto-alignment
feature.
For simplicity, first patch contains the revert of all relevant
patches from [2] in a single commit.
[1] https://www.redhat.com/archives/libvir-list/2020-September/msg00572.html
[2] https://www.redhat.com/archives/libvir-list/2020-July/msg02010.html
Daniel Henrique Barboza (4):
qemu: revert latest pSeries NVDIMM design changes
conf, qemu: move qemuDomainNVDimmAlignSizePseries to domain_conf.c
domain_conf.c: auto-align pSeries NVDIMM in
virDomainMemoryDefParseXML()
NEWS.rst: document the pSeries NVDIMM auto-alignment revival
NEWS.rst | 12 ++++
docs/formatdomain.rst | 6 +-
src/conf/domain_conf.c | 71 +++++++++++++++----
src/conf/domain_conf.h | 3 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_domain.c | 19 +++--
src/qemu/qemu_domain.h | 6 +-
src/qemu/qemu_hotplug.c | 6 +-
src/qemu/qemu_validate.c | 42 ++---------
...ory-hotplug-nvdimm-ppc64.ppc64-latest.args | 2 +-
.../memory-hotplug-nvdimm-ppc64.xml | 2 +-
.../memory-hotplug-nvdimm-ppc64.xml | 2 +-
12 files changed, 105 insertions(+), 67 deletions(-)
--
2.26.2
4 years, 2 months
[PATCH] util: support PCI passthrough net device stats collection
by zhenwei pi
Collect PCI passthrough net device stats from kernel by netlink
API.
Currently, libvirt can not get PCI passthrough net device stats,
run command:
#virsh domifstat instance --interface=52:54:00:2d:b2:35
error: Failed to get interface stats instance 52:54:00:2d:b2:35
error: internal error: Interface name not provided
The PCI device(usually SR-IOV virtual function device) is detached
while it's used in PCI passthrough mode. And we can not parse this
device from /proc/net/dev any more.
In this patch, libvirt check net device is VF of not firstly, then
query virNetDevVFInterfaceStats(new API).
virNetDevVFInterfaceStats parses VFs info of all PFs, compares MAC
address until the two MAC addresses match.
'#ip -s link show' can get the same result. Instead of parsing the
output result, implement this feature by libnl API.
Notice that this feature deponds on driver of PF.
Test on Mellanox ConnectX-4 Lx, it works well.
Also test on Intel Corporation 82599ES, it works, but only get 0.
(ip-link command get the same result).
Signed-off-by: zhenwei pi <pizhenwei(a)bytedance.com>
---
meson.build | 4 ++
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 3 +
src/util/virnetdev.c | 158 +++++++++++++++++++++++++++++++++++++++++++++++
src/util/virnetdev.h | 5 ++
5 files changed, 171 insertions(+)
diff --git a/meson.build b/meson.build
index 24535a403c..e17da9e2b9 100644
--- a/meson.build
+++ b/meson.build
@@ -1392,6 +1392,10 @@ if not get_option('virtualport').disabled()
endif
endif
+if cc.has_header_symbol('linux/if_link.h', 'IFLA_VF_STATS')
+ conf.set('WITH_VF_STATS', 1)
+endif
+
if host_machine.system() == 'windows'
ole32_dep = cc.find_library('ole32')
oleaut32_dep = cc.find_library('oleaut32')
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index bdbe3431b8..bcc40b8d69 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2585,6 +2585,7 @@ virNetDevSetRcvMulti;
virNetDevSetupControl;
virNetDevSysfsFile;
virNetDevValidateConfig;
+virNetDevVFInterfaceStats;
# util/virnetdevbandwidth.h
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ae715c01d7..f554010c40 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -10196,6 +10196,9 @@ qemuDomainInterfaceStats(virDomainPtr dom,
if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
if (virNetDevOpenvswitchInterfaceStats(net->ifname, stats) < 0)
goto cleanup;
+ } else if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
+ if (virNetDevVFInterfaceStats(&net->mac, stats) < 0)
+ goto cleanup;
} else {
if (virNetDevTapInterfaceStats(net->ifname, stats,
!virDomainNetTypeSharesHostView(net)) < 0)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index e1a4cc2bef..be9b8ce4a9 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1489,6 +1489,9 @@ static struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = {
.maxlen = sizeof(struct ifla_vf_mac) },
[IFLA_VF_VLAN] = { .type = NLA_UNSPEC,
.maxlen = sizeof(struct ifla_vf_vlan) },
+#if defined(WITH_VF_STATS)
+ [IFLA_VF_STATS] = { .type = NLA_NESTED },
+#endif
};
@@ -2265,6 +2268,151 @@ virNetDevSetNetConfig(const char *linkdev, int vf,
return 0;
}
+#if defined(WITH_VF_STATS)
+static struct nla_policy ifla_vfstats_policy[IFLA_VF_STATS_MAX+1] = {
+ [IFLA_VF_STATS_RX_PACKETS] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_TX_PACKETS] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_RX_BYTES] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_TX_BYTES] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_BROADCAST] = { .type = NLA_U64 },
+ [IFLA_VF_STATS_MULTICAST] = { .type = NLA_U64 },
+};
+
+static int
+virNetDevParseVfStats(struct nlattr **tb, virMacAddrPtr mac,
+ virDomainInterfaceStatsPtr stats)
+{
+ int ret = -1, len;
+ struct ifla_vf_mac *vf_lladdr;
+ struct nlattr *nla, *t[IFLA_VF_MAX+1];
+ struct nlattr *stb[IFLA_VF_STATS_MAX+1];
+
+ if (tb == NULL || mac == NULL || stats == NULL) {
+ return -1;
+ }
+
+ if (!tb[IFLA_VFINFO_LIST])
+ return -1;
+
+ len = nla_len(tb[IFLA_VFINFO_LIST]);
+
+ for (nla = nla_data(tb[IFLA_VFINFO_LIST]); nla_ok(nla, len);
+ nla = nla_next(nla, &len)) {
+ ret = nla_parse(t, IFLA_VF_MAX, nla_data(nla), nla_len(nla),
+ ifla_vf_policy);
+ if (ret < 0)
+ return -1;
+
+ if (t[IFLA_VF_MAC] == NULL) {
+ continue;
+ }
+
+ vf_lladdr = nla_data(t[IFLA_VF_MAC]);
+ if(virMacAddrCmpRaw(mac, vf_lladdr->mac)) {
+ continue;
+ }
+
+ if (t[IFLA_VF_STATS]) {
+ ret = nla_parse_nested(stb, IFLA_VF_STATS_MAX,
+ t[IFLA_VF_STATS],
+ ifla_vfstats_policy);
+ if (ret < 0)
+ return -1;
+
+ stats->rx_bytes = nla_get_u64(stb[IFLA_VF_STATS_RX_BYTES]);
+ stats->tx_bytes = nla_get_u64(stb[IFLA_VF_STATS_TX_BYTES]);
+ stats->rx_packets = nla_get_u64(stb[IFLA_VF_STATS_RX_PACKETS]);
+ stats->tx_packets = nla_get_u64(stb[IFLA_VF_STATS_TX_PACKETS]);
+ }
+ return 0;
+ }
+
+ return ret;
+}
+
+/**
+ * virNetDevVFInterfaceStats:
+ * @mac: MAC address of the VF interface
+ * @stats: returns stats of the VF interface
+ *
+ * Get the VF interface from kernel by netlink.
+ * Returns 0 on success, -1 on failure.
+ */
+int
+virNetDevVFInterfaceStats(virMacAddrPtr mac,
+ virDomainInterfaceStatsPtr stats)
+{
+ FILE *fp;
+ char line[256], *colon, *ifname;
+ int rc = -1;
+ void *nlData = NULL;
+ struct nlattr *tb[IFLA_MAX + 1] = {NULL, };
+ char *sysfsDevicePath = NULL;
+
+ fp = fopen("/proc/net/dev", "r");
+ if (!fp) {
+ virReportSystemError(errno, "%s",
+ _("Could not open /proc/net/dev"));
+ return -1;
+ }
+
+ /* get all PCI net devices, and parse VFs list from netlink API.
+ * compare MAC address, collect device stats if matching.
+ */
+ while (fgets(line, sizeof(line), fp)) {
+ /* The line looks like:
+ * " eth0:..."
+ * Split it at the colon. and strip blank from head.
+ */
+ colon = strchr(line, ':');
+ if (!colon)
+ continue;
+ *colon = '\0';
+ ifname = line;
+ while((*ifname == ' ') && (ifname < colon))
+ ifname++;
+
+ if (virNetDevSysfsFile(&sysfsDevicePath, ifname, "device") < 0)
+ break;
+
+ if (virNetDevIsPCIDevice(sysfsDevicePath)) {
+ rc = virNetlinkDumpLink(ifname, -1, &nlData, tb, 0, 0);
+ if (rc < 0) {
+ rc = -1;
+ goto cleanup;
+ }
+
+ rc = virNetDevParseVfStats(tb, mac, stats);
+ VIR_FREE(nlData);
+ if (rc == 0)
+ goto cleanup;
+ }
+ VIR_FREE(sysfsDevicePath);
+ }
+
+cleanup:
+ VIR_FREE(sysfsDevicePath);
+ VIR_FORCE_FCLOSE(fp);
+ return rc;
+}
+
+#else /* #if defined(WITH_VF_STATS) */
+
+int
+virNetDevVFInterfaceStats(virMacAddrPtr mac,
+ virDomainInterfaceStatsPtr stats)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Unable to get VF net device stats on this kernel, please upgrade kernel at lease linux-4.2"));
+
+ /* no need to do anything, just fix compling error here */
+ if (mac == NULL || stats == NULL) {
+ return -1;
+ }
+
+ return -1;
+}
+#endif /* #if defined(WITH_VF_STATS) */
#else /* defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX) */
@@ -2309,6 +2457,16 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUSED,
}
+int
+virNetDevVFInterfaceStats(virMacAddrPtr mac,
+ virDomainInterfaceStatsPtr stats)
+{
+ virReportSystemError(ENOSYS, "%s",
+ _("Unable to get VF net device stats on this platform"));
+ return -1;
+}
+
+
#endif /* defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX) */
VIR_ENUM_IMPL(virNetDevIfState,
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 5f581323ed..ff59d9d341 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -312,4 +312,9 @@ int virNetDevSysfsFile(char **pf_sysfs_device_link,
int virNetDevRunEthernetScript(const char *ifname, const char *script)
G_GNUC_NO_INLINE;
+int virNetDevVFInterfaceStats(virMacAddrPtr mac,
+ virDomainInterfaceStatsPtr stats)
+ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
+
+
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevRxFilter, virNetDevRxFilterFree);
--
2.11.0
4 years, 2 months
[PATCH] udevProcessCSS: fix segfault
by Marc Hartmayer
Don't process subchannel devices where `def->driver` is not set. This
fixes the following segfault:
Thread 21 "nodedev-init" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x3ffb08fc910 (LWP 64303)]
(gdb) bt
#0 0x000003fffd1272b4 in __strcmp_vx () at /lib64/libc.so.6
#1 0x000003ffc260c3a8 in udevProcessCSS (device=0x3ff9018d130, def=0x3ff90194a90)
#2 0x000003ffc260cb78 in udevGetDeviceDetails (device=0x3ff9018d130, def=0x3ff90194a90)
#3 0x000003ffc260d126 in udevAddOneDevice (device=0x3ff9018d130)
#4 0x000003ffc260d414 in udevProcessDeviceListEntry (udev=0x3ffa810d800, list_entry=0x3ff90001990)
#5 0x000003ffc260d638 in udevEnumerateDevices (udev=0x3ffa810d800)
#6 0x000003ffc260e08e in nodeStateInitializeEnumerate (opaque=0x3ffa810d800)
#7 0x000003fffdaa14b6 in virThreadHelper (data=0x3ffa810df00)
#8 0x000003fffc309ed6 in start_thread ()
#9 0x000003fffd185e66 in thread_start ()
(gdb) p *def
$2 = {
name = 0x0,
sysfs_path = 0x3ff90198e80 "/sys/devices/css0/0.0.ff40",
parent = 0x0,
parent_sysfs_path = 0x0,
parent_wwnn = 0x0,
parent_wwpn = 0x0,
parent_fabric_wwn = 0x0,
driver = 0x0,
devnode = 0x0,
devlinks = 0x3ff90194670,
caps = 0x3ff90194380
}
Fixes: 05e6cdafa6e0 ("node_device: detect CSS devices")
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
---
src/node_device/node_device_udev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 5f2841bb7d8e..12e3f30badd1 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1130,8 +1130,9 @@ udevProcessCSS(struct udev_device *device,
virNodeDeviceDefPtr def)
{
/* only process IO subchannel and vfio-ccw devices to keep the list sane */
- if (STRNEQ(def->driver, "io_subchannel") &&
- STRNEQ(def->driver, "vfio_ccw"))
+ if (!def->driver ||
+ (STRNEQ(def->driver, "io_subchannel") &&
+ STRNEQ(def->driver, "vfio_ccw")))
return -1;
if (udevGetCCWAddress(def->sysfs_path, &def->caps->data) < 0)
--
2.25.4
4 years, 2 months
[PATCH] tests: avoid close of bad file handle in commandtest
by Daniel P. Berrangé
Closed file handles need to be initialized to -1, not 0. This caused a
inappropriate double close of stdin, which is not desirable, although
it had no ill effects.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
tests/commandtest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/commandtest.c b/tests/commandtest.c
index 42225a8ef2..cbbcda4e5f 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -1091,8 +1091,8 @@ static int test27(const void *unused G_GNUC_UNUSED)
printf("Could not set send buffers\n");
goto cleanup;
}
- pipe1[1] = 0;
- pipe2[1] = 0;
+ pipe1[1] = -1;
+ pipe2[1] = -1;
buffer1 = NULL;
buffer2 = NULL;
--
2.26.2
4 years, 2 months
[libvirt PATCH] tests: don't mix FILE* and UNIX FD I/O on same stream
by Daniel P. Berrangé
There is currently a hand in test27 that exhibits itself on FreeBSD 11.4
only. The behaviour is that virCommandProcessIO gets POLLIN on the
FD for stdout, but read() blocks. Meanwhile commandtest also blocks
in write for stderr because the pipe buffers are full.
This fix in commandhelper likely does not really address the root cause
just hides it due to the buffering done by FILE *. Mixing UNIX FD I/O
and FILE * I/O is bad practice regardles.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
tests/commandhelper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/commandhelper.c b/tests/commandhelper.c
index 05f577730f..7c260c4e13 100644
--- a/tests/commandhelper.c
+++ b/tests/commandhelper.c
@@ -221,9 +221,9 @@ int main(int argc, char **argv) {
}
for (i = 0; i < numpollfds; i++) {
- if (write(STDOUT_FILENO, buffers[i], buflen[i]) != buflen[i])
+ if (fwrite(buffers[i], 1, buflen[i], stdout) != buflen[i])
goto cleanup;
- if (write(STDERR_FILENO, buffers[i], buflen[i]) != buflen[i])
+ if (fwrite(buffers[i], 1, buflen[i], stderr) != buflen[i])
goto cleanup;
}
--
2.26.2
4 years, 2 months
[PATCH v5 0/8] Configurable policy for handling deprecated interfaces
by Markus Armbruster
New option -compat lets you configure what to do when deprecated
interfaces get used. This is intended for testing users of the
management interfaces. It is experimental.
-compat deprecated-input=<in-policy> configures what to do when
deprecated input is received. Available policies:
* accept: Accept deprecated commands and arguments (default)
* reject: Reject them
* crash: Crash
-compat deprecated-output=<out-policy> configures what to do when
deprecated output is sent. Available output policies:
* accept: Emit deprecated command results and events (default)
* hide: Suppress them
For now, -compat covers only deprecated syntactic aspects of QMP. We
may want to extend it to cover semantic aspects, CLI, and experimental
features.
v5:
* Old PATCH 01-26 merged in commit f57587c7d47.
* Rebased, non-trivial conflicts in PATCH 1 due to Meson, and in PATCH
7 due to visitor changes
* PATCH 1: Comments updated for 5.2 [Eric]
* PATCH 2: Harmless missing initialization fixed [Eric]
* PATCH 3+4: Harmless missing has_FOO = true fixed [Eric]
* PATCH 6+7: Commit message tweaked
v4:
* PATCH 05+07: Temporary memory leak plugged [Marc-André]
* PATCH 23: Rewritten [Marc-André]
* PATCH 24: Comment typo [Marc-André]
* PATCH 30: Memory leaks plugged
v3:
* Rebased, non-trivial conflicts in PATCH 01+26+27+34 due to RST
conversion and code motion
* PATCH 28-29: Old PATCH 28 split up to ease review
* PATCH 30-31: New
* PATCH 32-33: Old PATCH 29 split up to ease review
Comparison to RFC (24 Oct 2019):
* Cover arguments and results in addition to commands and events
* Half-baked "[RFC PATCH 18/19] qapi: Include a warning in the
response to a deprecated command" dropped
See also last item of
Subject: Minutes of KVM Forum BoF on deprecating stuff
Date: Fri, 26 Oct 2018 16:03:51 +0200
Message-ID: <87mur0ls8o.fsf(a)dusky.pond.sub.org>
https://lists.nongnu.org/archive/html/qemu-devel/2018-10/msg05828.html
Cc: Lukáš Doktor <ldoktor(a)redhat.com>
Cc: libguestfs(a)redhat.com
Cc: libvir-list(a)redhat.com
Cc: Daniel P. Berrange <berrange(a)redhat.com>
Cc: Peter Krempa <pkrempa(a)redhat.com>
Cc: Kevin Wolf <kwolf(a)redhat.com>
Markus Armbruster (8):
qemu-options: New -compat to set policy for deprecated interfaces
qapi: Implement deprecated-output=hide for QMP command results
qapi: Implement deprecated-output=hide for QMP events
qapi: Implement deprecated-output=hide for QMP event data
qapi: Implement deprecated-output=hide for QMP introspection
qapi: Implement deprecated-input=reject for QMP commands
qapi: Implement deprecated-input=reject for QMP command arguments
qapi: New -compat deprecated-input=crash
qapi/compat.json | 52 ++++++++++++
qapi/introspect.json | 2 +-
qapi/qapi-schema.json | 1 +
include/qapi/compat-policy.h | 20 +++++
include/qapi/qmp/dispatch.h | 1 +
include/qapi/qobject-input-visitor.h | 9 +++
include/qapi/qobject-output-visitor.h | 9 +++
include/qapi/visitor-impl.h | 6 ++
include/qapi/visitor.h | 18 +++++
monitor/monitor-internal.h | 3 -
monitor/misc.c | 2 -
monitor/qmp-cmds-control.c | 100 +++++++++++++++++++++---
qapi/qapi-visit-core.c | 18 +++++
qapi/qmp-dispatch.c | 17 ++++
qapi/qobject-input-visitor.c | 29 +++++++
qapi/qobject-output-visitor.c | 19 +++++
softmmu/vl.c | 17 ++++
storage-daemon/qemu-storage-daemon.c | 2 -
tests/test-qmp-cmds.c | 91 +++++++++++++++++++--
tests/test-qmp-event.c | 41 ++++++++++
qapi/meson.build | 1 +
qapi/trace-events | 2 +
qemu-options.hx | 22 ++++++
scripts/qapi/commands.py | 14 ++--
scripts/qapi/events.py | 22 +++++-
scripts/qapi/visit.py | 15 ++++
tests/qapi-schema/qapi-schema-test.json | 20 +++--
tests/qapi-schema/qapi-schema-test.out | 20 ++---
28 files changed, 522 insertions(+), 51 deletions(-)
create mode 100644 qapi/compat.json
create mode 100644 include/qapi/compat-policy.h
--
2.26.2
4 years, 2 months