[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 26/39] tests/qtest: migration-test: Make sure QEMU process
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [PATCH v2 26/39] tests/qtest: migration-test: Make sure QEMU process "to" exited after migration is canceled |
Date: |
Wed, 21 Sep 2022 17:29:55 +0100 |
User-agent: |
Mutt/2.2.7 (2022-08-07) |
* Bin Meng (bmeng.cn@gmail.com) wrote:
> From: Xuzhou Cheng <xuzhou.cheng@windriver.com>
>
> Make sure QEMU process "to" exited before launching another target
> for migration in the test_multifd_tcp_cancel case.
>
> Signed-off-by: Xuzhou Cheng <xuzhou.cheng@windriver.com>
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Hmm you might want to put a small usleep in that loop; otherwise
it'll burn CPU.
There is a slim risk with this that another, entirely unrelated, process
will start up with the same PID between the end of migrate_cancel
and then you'll be spinning on it rather than the 'to' qemu.
I wonder if there's a better way to check for it dieing; e.g. an error
on it's qmp interface or something?
Dave
> ---
>
> Changes in v2:
> - Change to a busy wait after migration is canceled
>
> tests/qtest/migration-test.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> index c87afad9e8..aedd9ddb72 100644
> --- a/tests/qtest/migration-test.c
> +++ b/tests/qtest/migration-test.c
> @@ -2133,6 +2133,10 @@ static void test_multifd_tcp_cancel(void)
> wait_for_migration_pass(from);
>
> migrate_cancel(from);
> + /* Make sure QEMU process "to" exited */
> + while (qtest_probe_child(to)) {
> + ;
> + }
>
> args = (MigrateStart){
> .only_target = true,
> --
> 2.34.1
>
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
- Re: [PATCH v2 18/39] tests/qtest: libqtest: Install signal handler via signal(), (continued)
- [PATCH v2 20/39] tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32, Bin Meng, 2022/09/20
- [PATCH v2 19/39] tests/qtest: Support libqtest to build and run on Windows, Bin Meng, 2022/09/20
- [PATCH v2 23/39] tests/qtest: ide-test: Open file in binary mode, Bin Meng, 2022/09/20
- [PATCH v2 27/39] hw/ppc: spapr: Use qemu_vfree() to free spapr->htab, Bin Meng, 2022/09/20
- [PATCH v2 26/39] tests/qtest: migration-test: Make sure QEMU process "to" exited after migration is canceled, Bin Meng, 2022/09/20
- [PATCH v2 21/39] tests/qtest: bios-tables-test: Adapt the case for win32, Bin Meng, 2022/09/20
- [PATCH v2 22/39] tests/qtest: migration-test: Disable IO redirection for win32, Bin Meng, 2022/09/20
- [PATCH v2 29/39] tests/qtest: microbit-test: Fix socket access for win32, Bin Meng, 2022/09/20
- [PATCH v2 25/39] chardev/char-file: Add FILE_SHARE_WRITE when openning the file for win32, Bin Meng, 2022/09/20