From bae26e2cfad38f81f844a1386816010e8ba5c624 Mon Sep 17 00:00:00 2001 From: Yihuang Yu Date: Fri, 11 Aug 2023 11:16:25 +0800 Subject: [PATCH] live_backup_add_bitmap: Replace system_shutdown with graceful_shutdown `system_shutdown` will use qmp command to shut down the guest, but when guest is still booting, sometimes it may ignore the `POWERDOWN` event, this causes the guest failed to down. To safely shut down the guest, send a shell command by guest itself would be better. Signed-off-by: Yihuang Yu --- qemu/tests/live_backup_add_bitmap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu/tests/live_backup_add_bitmap.py b/qemu/tests/live_backup_add_bitmap.py index b6aaebbfd4..70acf2ae70 100644 --- a/qemu/tests/live_backup_add_bitmap.py +++ b/qemu/tests/live_backup_add_bitmap.py @@ -52,9 +52,9 @@ def check_bitmap_existence_as_expected(bitmaps, existence_param): error_context.context("check bitmap existence", test.log.info) check_bitmap_existence_as_expected(bitmaps, "existence") - error_context.context("system powerdown", test.log.info) - vm.monitor.system_powerdown() - if not vm.wait_for_shutdown(int(params.get("shutdown_timeout", 360))): + error_context.context("Shutting down the guest", test.log.info) + vm.graceful_shutdown(params.get_numeric("shutdown_timeout", 360)) + if not vm.wait_for_shutdown(): test.fail("guest refuses to go down") error_context.context("start vm", test.log.info)