Skip to content

Commit

Permalink
hotplug_virtio_mem: implements virtio-mem hotunplug
Browse files Browse the repository at this point in the history
Implements virtio-mem hotunplug as the final step of
the test case. At first, it tries to unplug the virtio-mem
device with some memory plugged in; as expected the
exception is catched. Finally resizes the device to zero
and the hotunplug is successfully done.

Signed-off-by: mcasquer <[email protected]>
  • Loading branch information
mcasquer committed Feb 6, 2024
1 parent 67154b1 commit a397ba2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions qemu/tests/hotplug_virtio_mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from virttest import error_context

from virttest.qemu_monitor import QMPCmdError
from virttest.utils_misc import normalize_data_size
from virttest.utils_test.qemu import MemoryHotplugTest
from provider import virtio_mem_utils
Expand Down Expand Up @@ -53,4 +54,13 @@ def run(test, params, env):
threshold, vm, test)
virtio_mem_utils.check_numa_plugged_mem(node_id, requested_size,
threshold, vm, test)
try:
hotplug_test.unplug_memory(vm, target_mem)
except QMPCmdError:
test.log.info("virtio-mem device cannot get unplugged while 'size' != '0'")

vm.monitor.qom_set(device_id, "requested-size", 0)
time.sleep(10)
hotplug_test.unplug_memory(vm, target_mem)

session.close()

0 comments on commit a397ba2

Please sign in to comment.