xref: /linux/tools/testing/selftests/kvm/include/guest_modes.h (revision 06d07429858317ded2db7986113a9e0129cd599b)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2020, Red Hat, Inc.
4  */
5 #include "kvm_util.h"
6 
7 struct guest_mode {
8 	bool supported;
9 	bool enabled;
10 };
11 
12 extern struct guest_mode guest_modes[NUM_VM_MODES];
13 
14 #define guest_mode_append(mode, enabled) ({ \
15 	guest_modes[mode] = (struct guest_mode){ (enabled), (enabled) }; \
16 })
17 
18 void guest_modes_append_default(void);
19 void for_each_guest_mode(void (*func)(enum vm_guest_mode, void *), void *arg);
20 void guest_modes_help(void);
21 void guest_modes_cmdline(const char *arg);
22