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