]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/vmspawn/vmspawn-util.h
1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
7 #if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__aarch64__)
8 #define ARCHITECTURE_SUPPORTS_SMBIOS 1
10 #define ARCHITECTURE_SUPPORTS_SMBIOS 0
13 #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
14 #define ARCHITECTURE_SUPPORTS_TPM 1
16 #define ARCHITECTURE_SUPPORTS_TPM 0
19 #if defined(__arm__) || defined(__aarch64__)
20 #define DEFAULT_SERIAL_TTY "ttyAMA0"
21 #elif defined(__s390__) || defined(__s390x__)
22 #define DEFAULT_SERIAL_TTY "ttysclp0"
23 #elif defined(__powerpc__) || defined(__powerpc64__)
24 #define DEFAULT_SERIAL_TTY "hvc0"
26 #define DEFAULT_SERIAL_TTY "ttyS0"
29 typedef struct OvmfConfig
{
37 static inline const char *ovmf_config_format(const OvmfConfig
*c
) {
38 return ASSERT_PTR(c
)->format
?: "raw";
41 static inline const char *ovmf_config_vars_format(const OvmfConfig
*c
) {
42 return ASSERT_PTR(c
)->vars_format
?: "raw";
45 OvmfConfig
* ovmf_config_free(OvmfConfig
*ovmf_config
);
46 DEFINE_TRIVIAL_CLEANUP_FUNC(OvmfConfig
*, ovmf_config_free
);
48 int qemu_check_kvm_support(void);
49 int qemu_check_vsock_support(void);
50 int list_ovmf_config(char ***ret
);
51 int load_ovmf_config(const char *path
, OvmfConfig
**ret
);
52 int find_ovmf_config(int search_sb
, OvmfConfig
**ret
);
53 int find_qemu_binary(char **ret_qemu_binary
);
54 int vsock_fix_child_cid(unsigned *machine_cid
, const char *machine
, int *ret_child_sock
);