summary refs log tree commit diff stats
path: root/tests/migration-stress/guestperf/hardware.py
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2024-12-12 18:45:09 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2024-12-12 18:45:09 -0500
commitbdce9bc9179bd7b6f4e12c759dd3cd6794e26a6b (patch)
treeac50a528b74309d205ce97bf770d7e8b1b0fd5c4 /tests/migration-stress/guestperf/hardware.py
parent1eec82cc06cd68b6ffaf13ba8337fac0080c7bce (diff)
parentde8bc62cc4871fa97d1891ebb96e782b0c75b56a (diff)
downloadfocaccia-qemu-bdce9bc9179bd7b6f4e12c759dd3cd6794e26a6b.tar.gz
focaccia-qemu-bdce9bc9179bd7b6f4e12c759dd3cd6794e26a6b.zip
Merge tag 'qtest-20241212-pull-request' of https://gitlab.com/farosas/qemu into staging
Qtest pull request

- TIMEOUT_MULTIPLIER setting to allow tests to take longer when asan is enabled
- New qtest_system_reset() wrapper to properly wait for a system reset
- Split of migration-test.c into multiple files under qtest/migration/

# -----BEGIN PGP SIGNATURE-----
#
# iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmda+84QHGZhcm9zYXNA
# c3VzZS5kZQAKCRDHmNx0G+wxnXWZEACcxW/P9EiLxIeCf4ke7/qq+8HSOOLdQrEa
# hP5ZCzLlY0K8KQ9fhTGvc6UgRBsScXcLuj4eoR8Gke9e4tID39XVdkion/x6OCiv
# grC2Ll9/BNrWtR8DiXs3krsU1CXhav6qcT56bMiXV3Qo+KsTmB7RkpXpbkZLZxkn
# P2aqZlYFS0zZ3PZQceCasQEzB6Dls7o1wNXvgSJXr2E4IuIEcbyWtQpr5DfctnfN
# STbqGTgMXADyjlqh3CWwSLsZQvIVoN9+3twOrZn4j0D+fyEsTjKsZPlUpRtr72ap
# FVT+zVIUfxieBlDTsRSwcieD1ePFUUjl7ikQFwypGs33TI9VDTsB88IG7h0/080o
# 7dYbSMSG0pGEq9QIB8jkV26OZi3y00L/zmLMNDsN6nxKN4mSySlfVD/B/Jb70Smy
# lwbLklnr921kqsF89Bsq8YRyg8bbGXtx2ifGROgqF+JtrxRW0ElF9K/h4HQtPjuD
# nZJ4rtrDIv1iMTLJwbNu39fhxvuQowdBYTrbPMgw+xIv++LodqYJSDxbEX+FaDqI
# LMf772jiAgesl7qe1d9TJizhvonyi9PIdcUILg0SH0H1KvoSjpS3mlGgvo8zgvh+
# zvhhzkFGDIHmlCvOaIYyCpadJ5SMMS627q/Q13X3DHjUTkpPUhxGgc9oO7T39+iA
# 4dOLDRjUcg==
# =H6xv
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 12 Dec 2024 10:05:50 EST
# gpg:                using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D
# gpg:                issuer "farosas@suse.de"
# gpg: Good signature from "Fabiano Rosas <farosas@suse.de>" [unknown]
# gpg:                 aka "Fabiano Almeida Rosas <fabiano.rosas@suse.com>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: AA1B 48B0 A223 26A5 A4C3  64CF C798 DC74 1BEC 319D

* tag 'qtest-20241212-pull-request' of https://gitlab.com/farosas/qemu: (22 commits)
  tests/qtest/migration: Split validation tests + misc
  tests/qtest/migration-test: Fix and enable test_ignore_shared
  tests/qtest/migration: Split CPR tests
  tests/qtest/migration: Split precopy tests
  tests/qtest/migration: Split file tests
  tests/qtest/migration: Split postcopy tests
  tests/qtest/migration: Split compression tests from migration-test.c
  tests/qtest/migration: Split TLS tests from migration-test.c
  tests/qtest/migration: Move common test code
  tests/qtest/migration: Isolate test initialization
  tests/qtest/migration: Move kvm_dirty_ring_supported to utils
  tests/qtest/migration: Move ufd_version_check to utils
  tests/qtest/migration: Rename migration-helpers.c
  tests/qtest/migration: Move qmp helpers to a separate file
  tests/qtest/migration: Move bootfile code to its own file
  tests/migration: Disambiguate guestperf vs. a-b
  tests/qtest/migration: Stop calling everything "test"
  tests/qtest/migration: Standardize hook names
  tests/qtest: Use qtest_system_reset_nowait() where appropriate
  tests/qtest: Use qtest_system_reset() instead of open-coded versions
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/migration-stress/guestperf/hardware.py')
-rw-r--r--tests/migration-stress/guestperf/hardware.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/migration-stress/guestperf/hardware.py b/tests/migration-stress/guestperf/hardware.py
new file mode 100644
index 0000000000..f779cc050b
--- /dev/null
+++ b/tests/migration-stress/guestperf/hardware.py
@@ -0,0 +1,66 @@
+#
+# Migration test hardware configuration description
+#
+# Copyright (c) 2016 Red Hat, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#
+
+
+class Hardware(object):
+    def __init__(self, cpus=1, mem=1,
+                 src_cpu_bind=None, src_mem_bind=None,
+                 dst_cpu_bind=None, dst_mem_bind=None,
+                 prealloc_pages = False,
+                 huge_pages=False, locked_pages=False,
+                 dirty_ring_size=0):
+        self._cpus = cpus
+        self._mem = mem # GiB
+        self._src_mem_bind = src_mem_bind # List of NUMA nodes
+        self._src_cpu_bind = src_cpu_bind # List of pCPUs
+        self._dst_mem_bind = dst_mem_bind # List of NUMA nodes
+        self._dst_cpu_bind = dst_cpu_bind # List of pCPUs
+        self._prealloc_pages = prealloc_pages
+        self._huge_pages = huge_pages
+        self._locked_pages = locked_pages
+        self._dirty_ring_size = dirty_ring_size
+
+
+    def serialize(self):
+        return {
+            "cpus": self._cpus,
+            "mem": self._mem,
+            "src_mem_bind": self._src_mem_bind,
+            "dst_mem_bind": self._dst_mem_bind,
+            "src_cpu_bind": self._src_cpu_bind,
+            "dst_cpu_bind": self._dst_cpu_bind,
+            "prealloc_pages": self._prealloc_pages,
+            "huge_pages": self._huge_pages,
+            "locked_pages": self._locked_pages,
+            "dirty_ring_size": self._dirty_ring_size,
+        }
+
+    @classmethod
+    def deserialize(cls, data):
+        return cls(
+            data["cpus"],
+            data["mem"],
+            data["src_cpu_bind"],
+            data["src_mem_bind"],
+            data["dst_cpu_bind"],
+            data["dst_mem_bind"],
+            data["prealloc_pages"],
+            data["huge_pages"],
+            data["locked_pages"],
+            data["dirty_ring_size"])