Skip to content

Commit

Permalink
hotplug_virtio_mem: updates unplug error message
Browse files Browse the repository at this point in the history
From QEMU 9.1 onwards the error message displayed when the
virtio-mem device is tried to be unplugged while it still has
some memory plugged has been updated. Adding support for
both messages based on the version.

Signed-off-by: mcasquer <[email protected]>
  • Loading branch information
mcasquer committed Oct 4, 2024
1 parent 2b6aff3 commit eeddc5e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions qemu/tests/cfg/hotplug_virtio_mem.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@
pcie_extra_root_port = 1
requested-size_test_vmem0 = "4G 2G"
error_msg = "virtio-mem device cannot get unplugged while 'size' != '0'"
new_error_msg = "virtio-mem device cannot get unplugged while some of its memory is still plugged"
4 changes: 3 additions & 1 deletion qemu/tests/hotplug_virtio_mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def run(test, params, env):
timeout = params.get_numeric("login_timeout", 240)
threshold = params.get_numeric("threshold", target_type=float)
error_msg = params.get("error_msg")
if qemu_version in VersionInterval("[9.0.0,)"):
error_msg = params.get("new_error_msg")
qemu_path = utils_misc.get_qemu_binary(params)
qemu_version = utils_qemu.get_qemu_version(qemu_path)[0]
vm = env.get_vm(params["main_vm"])
Expand Down Expand Up @@ -67,7 +69,7 @@ def run(test, params, env):
virtio_mem_utils.check_numa_plugged_mem(
node_id, requested_size, threshold, vm, test
)
if qemu_version in VersionInterval('[8.1.0,)'):
if qemu_version in VersionInterval("[8.1.0,)"):
try:
hotplug_test.unplug_memory(vm, target_mem)
except QMPCmdError as e:
Expand Down

0 comments on commit eeddc5e

Please sign in to comment.