xref: /kvm-unit-tests/lib/migrate.c (revision 14ea7bdac078acb46357c7943b3aa384ef5eb3f3)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Migration-related functions
4  *
5  * Copyright IBM Corp. 2022
6  * Author: Nico Boehr <nrb@linux.ibm.com>
7  */
8 #include <libcflat.h>
9 #include "migrate.h"
10 
11 /*
12  * Initiate migration and wait for it to complete.
13  */
14 void migrate(void)
15 {
16 	puts("Now migrate the VM, then press a key to continue...\n");
17 	(void)getchar();
18 	report_info("Migration complete");
19 }
20 
21 /*
22  * Initiate migration and wait for it to complete.
23  * If this function is called more than once, it is a no-op.
24  */
25 void migrate_once(void)
26 {
27 	static bool migrated;
28 
29 	if (migrated)
30 		return;
31 
32 	migrated = true;
33 	migrate();
34 }
35