[libvirt] [PATCH 7/8] tests: Introduce QEMU memory locking limit tests

Andrea Bolognani abologna at redhat.com
Mon Mar 27 10:48:45 UTC 2017


On Thu, 2017-03-23 at 19:16 +0100, Andrea Bolognani wrote:
> These tests cover a number of scenarios where we care about
> the memory locking limit being set correctly for the guest
> to work properly.

[...]
> diff --git a/tests/qemumemlockdata/qemumemlock-pseries-hostdev.xml b/tests/qemumemlockdata/qemumemlock-pseries-hostdev.xml
> new file mode 100644
> index 0000000..daf70a4
> --- /dev/null
> +++ b/tests/qemumemlockdata/qemumemlock-pseries-hostdev.xml
> @@ -0,0 +1,17 @@
> +<domain type='kvm'>
> +  <name>guest</name>
> +  <memory unit='KiB'>1048576</memory>
> +  <vcpu placement='static'>1</vcpu>
> +  <os>
> +    <type arch='ppc64' machine='pseries'>hvm</type>
> +  </os>
> +  <devices>
> +    <emulator>/usr/bin/qemu-system-ppc64</emulator>
> +    <hostdev mode='subsystem' type='pci' managed='yes'>
> +      <driver name='vfio'/>
> +      <source>
> +        <address domain='0x0000' bus='0x04' slot='0x02' function='0x0'/>
> +      </source>
> +    </hostdev>
> +  </devices>
> +</domain>
> diff --git a/tests/qemumemlockdata/qemumemlock-pseries-kvm.xml b/tests/qemumemlockdata/qemumemlock-pseries-kvm.xml
> new file mode 100644
> index 0000000..5a065da
> --- /dev/null
> +++ b/tests/qemumemlockdata/qemumemlock-pseries-kvm.xml
> @@ -0,0 +1,11 @@
> +<domain type='kvm'>
> +  <name>guest</name>
> +  <memory unit='KiB'>1048576</memory>
> +  <vcpu placement='static'>1</vcpu>
> +  <os>
> +    <type arch='ppc64' machine='pseries'>hvm</type>
> +  </os>
> +  <devices>
> +    <emulator>/usr/bin/qemu-system-ppc64</emulator>
> +  </devices>
> +</domain>

[...]
> +    qemuTestSetHostArch(driver.caps, VIR_ARCH_PPC64);
> +
> +    DO_TEST("pseries-kvm", 20971520);
[...]
> +    DO_TEST("pseries-hostdev", 2168455168);

Hi David,

since I'm finally introducing test suite coverage for this,
it would be great if you could double-check that the values
we're going to test against actually make sense :)

You can see the configuration for the guests above: they
both have 1 GiB of RAM and use KVM, but one of the two is
using device assignment. The sizes are in bytes, so that's
~20 MiB for the basic guest and ~2 GiB for the one using
device assignment.

For reference, the code doing the calculation is

  https://github.com/libvirt/libvirt/blob/9b93c4c26483308371aae3ae30bf5536c88b7f4b/src/qemu/qemu_domain.c#L6234-L6310

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list