xref: /kvmtool/include/kvm/kvm-config.h (revision 9b46ebc561d3cc3bb54a350e4eed94d24562f347)
1 #ifndef KVM_CONFIG_H_
2 #define KVM_CONFIG_H_
3 
4 #include "kvm/disk-image.h"
5 #include "kvm/vfio.h"
6 #include "kvm/kvm-config-arch.h"
7 
8 #include <linux/sizes.h>
9 
10 #define DEFAULT_KVM_DEV		"/dev/kvm"
11 #define DEFAULT_CONSOLE		"serial"
12 #define DEFAULT_NETWORK		"user"
13 #define DEFAULT_HOST_ADDR	"192.168.33.1"
14 #define DEFAULT_GUEST_ADDR	"192.168.33.15"
15 #define DEFAULT_GUEST_MAC	"02:15:15:15:15:15"
16 #define DEFAULT_HOST_MAC	"02:01:01:01:01:01"
17 #define DEFAULT_SCRIPT		"none"
18 #define DEFAULT_SANDBOX_FILENAME "guest/sandbox.sh"
19 
20 #define MIN_RAM_SIZE		SZ_64M
21 
22 struct kvm_config {
23 	struct kvm_config_arch arch;
24 	struct disk_image_params disk_image[MAX_DISK_IMAGES];
25 	struct vfio_device_params *vfio_devices;
26 	u64 ram_addr;		/* Guest memory physical base address, in bytes */
27 	u64 ram_size;		/* Guest memory size, in bytes */
28 	u8 num_net_devices;
29 	u8 num_vfio_devices;
30 	u64 vsock_cid;
31 	bool virtio_rng;
32 	bool nodefaults;
33 	int active_console;
34 	int debug_iodelay;
35 	int nrcpus;
36 	const char *kernel_cmdline;
37 	const char *kernel_filename;
38 	const char *vmlinux_filename;
39 	const char *initrd_filename;
40 	const char *firmware_filename;
41 	const char *flash_filename;
42 	const char *console;
43 	const char *dev;
44 	const char *network;
45 	const char *host_ip;
46 	const char *guest_ip;
47 	const char *guest_mac;
48 	const char *host_mac;
49 	const char *script;
50 	const char *guest_name;
51 	const char *sandbox;
52 	const char *hugetlbfs_path;
53 	const char *custom_rootfs_name;
54 	const char *real_cmdline;
55 	struct virtio_net_params *net_params;
56 	bool single_step;
57 	bool vnc;
58 	bool gtk;
59 	bool sdl;
60 	bool balloon;
61 	bool using_rootfs;
62 	bool custom_rootfs;
63 	bool no_net;
64 	bool no_dhcp;
65 	bool ioport_debug;
66 	bool mmio_debug;
67 	int virtio_transport;
68 };
69 
70 #endif
71