[libvirt] [PATCH 2/4] tests: Initialize basic capabilities properly

John Ferlan jferlan at redhat.com
Mon Mar 27 12:03:29 UTC 2017



On 03/09/2017 12:37 PM, Andrea Bolognani wrote:
> The capabilities used in test cases should match those used
> during normal operation for the tests to make any sense.
> ---
>  src/qemu/qemu_capabilities.c                             |  2 ++
>  .../qemuxml2argv-balloon-ccw-deflate.args                |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-console-sclp.args    |  1 -
>  .../qemuxml2argv-console-virtio-ccw.args                 |  1 -
>  .../qemuxml2argv-console-virtio-s390.args                |  1 -
>  .../qemuxml2argvdata/qemuxml2argv-cpu-s390-features.args |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-cpu-s390-zEC12.args  |  1 -
>  .../qemuxml2argv-disk-virtio-ccw-many.args               |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-disk-virtio-ccw.args |  1 -
>  .../qemuxml2argvdata/qemuxml2argv-disk-virtio-s390.args  |  1 -
>  .../qemuxml2argv-disk-virtio-scsi-ccw.args               |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args        |  1 -
>  .../qemuxml2argv-hostdev-scsi-vhost-scsi-ccw.args        |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-hugepages-numa.args  |  1 +
>  .../qemuxml2argv-iothreads-disk-virtio-ccw.args          |  1 -
>  .../qemuxml2argv-iothreads-virtio-scsi-ccw.args          |  1 -
>  .../qemuxml2argv-machine-aeskeywrap-off-cap.args         |  1 -
>  .../qemuxml2argv-machine-aeskeywrap-off-caps.args        |  1 -
>  .../qemuxml2argv-machine-aeskeywrap-on-cap.args          |  1 -
>  .../qemuxml2argv-machine-aeskeywrap-on-caps.args         |  1 -
>  .../qemuxml2argv-machine-deakeywrap-off-cap.args         |  1 -
>  .../qemuxml2argv-machine-deakeywrap-off-caps.args        |  1 -
>  .../qemuxml2argv-machine-deakeywrap-on-cap.args          |  1 -
>  .../qemuxml2argv-machine-deakeywrap-on-caps.args         |  1 -
>  .../qemuxml2argv-machine-keywrap-none-caps.args          |  1 -
>  .../qemuxml2argv-machine-keywrap-none.args               |  1 -
>  .../qemuxml2argv-memory-hotplug-ppc64-nonuma.args        |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-ccw.args  |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-net-virtio-s390.args |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args         |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-ppce500-serial.args  |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-pseries-basic.args   |  1 -
>  .../qemuxml2argv-pseries-cpu-compat.args                 |  1 -
>  .../qemuxml2argvdata/qemuxml2argv-pseries-cpu-exact.args |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-pseries-cpu-le.args  |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-pseries-nvram.args   |  1 -
>  .../qemuxml2argv-pseries-panic-missing.args              |  1 -
>  .../qemuxml2argv-pseries-panic-no-address.args           |  1 -
>  .../qemuxml2argv-pseries-usb-default.args                |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args |  1 -
>  .../qemuxml2argvdata/qemuxml2argv-pseries-usb-multi.args |  1 -
>  .../qemuxml2argv-pseries-vio-user-assigned.args          |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-pseries-vio.args     |  1 -
>  .../qemuxml2argv-q35-virt-manager-basic.args             |  1 +
>  .../qemuxml2argv-s390-allow-bogus-usb-controller.args    |  1 -
>  .../qemuxml2argv-s390-allow-bogus-usb-none.args          |  1 -
>  .../qemuxml2argv-s390-panic-missing.args                 |  1 -
>  .../qemuxml2argv-s390-panic-no-address.args              |  1 -
>  tests/qemuxml2argvdata/qemuxml2argv-virtio-rng-ccw.args  |  1 -
>  .../qemuxml2argvdata/qemuxml2argv-watchdog-diag288.args  |  1 -
>  tests/qemuxml2argvtest.c                                 | 16 ++++++++++++++--
>  51 files changed, 18 insertions(+), 49 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 4ec34f8..a2d8e9e 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -4231,6 +4231,8 @@ virQEMUCapsInitArchQMPBasic(virQEMUCapsPtr qemuCaps,
>          goto cleanup;
>      }
>  
> +    /* Important: keep this in sync with testUpdateQEMUCaps() */
> +

Using my suggestion from previous patch, this becomes unnecessary...

>      /* ACPI only works on x86 and aarch64 */
>      if (ARCH_IS_X86(qemuCaps->arch) ||
>          qemuCaps->arch == VIR_ARCH_AARCH64) {

[...]

> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
> index d2d267f..5ddede9 100644
> --- a/tests/qemuxml2argvtest.c
> +++ b/tests/qemuxml2argvtest.c
> @@ -360,8 +360,6 @@ testInitQEMUCaps(struct testInfo *info,
>      if (!(info->qemuCaps = virQEMUCapsNew()))
>          goto cleanup;
>  
> -    virQEMUCapsSet(info->qemuCaps, QEMU_CAPS_NO_ACPI);
> -
>      if (testQemuCapsSetGIC(info->qemuCaps, gic) < 0)
>          goto cleanup;
>  
> @@ -381,6 +379,20 @@ testUpdateQEMUCaps(const struct testInfo *info,
>  
>      virQEMUCapsSetArch(info->qemuCaps, vm->def->os.arch);
>  
> +    /* Important: keep this in sync with virQEMUCapsInitArchQMPBasic() */
> +
> +    /* ACPI only works on x86 and aarch64 */
> +    if (ARCH_IS_X86(vm->def->os.arch) ||
> +        vm->def->os.arch == VIR_ARCH_AARCH64) {
> +        virQEMUCapsSet(info->qemuCaps, QEMU_CAPS_NO_ACPI);
> +    }
> +
> +    /* HPET and KVM PIT are x86 specific */
> +    if (ARCH_IS_X86(vm->def->os.arch)) {
> +        virQEMUCapsSet(info->qemuCaps, QEMU_CAPS_NO_HPET);
> +        virQEMUCapsSet(info->qemuCaps, QEMU_CAPS_NO_KVM_PIT);
> +    }
> +

And this just calls the function

John
>      /* We need to pretend QEMU 2.0.0 is in use so that pSeries guests
>       * will get the correct alias assigned to their buses.
>       * See virQEMUCapsHasPCIMultiBus() */
> 




More information about the libvir-list mailing list