Virtualization and emulation info

Virtualization and emulation info — Information about virtualization, hypervisors and emulation

Functions

Properties

SrtMachineType host-machine Read / Write / Construct Only
SrtOsInfo * host-os-info Read / Write / Construct Only
char * host-path Read / Write / Construct Only
char * interpreter-root Read / Write / Construct Only
SrtVirtualizationType type Read / Write / Construct Only

Types and Values

Object Hierarchy

    GEnum
    ╰── SrtVirtualizationType
    GObject
    ╰── SrtVirtualizationInfo

Includes

#include <steam-runtime-tools/steam-runtime-tools.h>

Description

Functions

srt_virtualization_info_get_virtualization_type ()

SrtVirtualizationType
srt_virtualization_info_get_virtualization_type
                               (SrtVirtualizationInfo *self);

If the program appears to be running in a hypervisor or emulator, return what type it is.

Parameters

self

A SrtVirtualizationInfo object

 

Returns

A recognised virtualization type, or SRT_VIRTUALIZATION_TYPE_NONE if a hypervisor cannot be detected, or SRT_VIRTUALIZATION_TYPE_UNKNOWN if unsure.


srt_virtualization_info_get_host_machine ()

SrtMachineType
srt_virtualization_info_get_host_machine
                               (SrtVirtualizationInfo *self);

If the program appears to be running in an emulator, try to return the machine architecture of the host on which the emulator is running. Otherwise return SRT_MACHINE_TYPE_UNKNOWN.

Parameters

self

A SrtVirtualizationInfo object

 

Returns

A machine type, or SRT_MACHINE_TYPE_UNKNOWN if the machine type cannot be detected or is not applicable


srt_virtualization_info_get_host_os_info ()

SrtOsInfo *
srt_virtualization_info_get_host_os_info
                               (SrtVirtualizationInfo *self);

If the program appears to be running in an emulator, try to return information about the host operating system. Otherwise return NULL.

Parameters

self

A SrtVirtualizationInfo object

 

Returns

An object or NULL.

[transfer none]


srt_virtualization_info_get_host_path ()

const char *
srt_virtualization_info_get_host_path (SrtVirtualizationInfo *self);

If the program appears to be running in an emulator, try to return a path through which important files from the host machine can be read. Otherwise return NULL.

Parameters

self

A SrtVirtualizationInfo object

 

Returns

An absolute path or NULL


srt_virtualization_info_get_interpreter_root ()

const gchar *
srt_virtualization_info_get_interpreter_root
                               (SrtVirtualizationInfo *self);

If the program appears to be running under user-space emulation with an interpreter like FEX-Emu, which behaves as though emulated libraries from a sysroot for the emulated architecture had been overlaid onto the real root filesystem, then return the root directory of that sysroot. Otherwise return NULL.

Parameters

self

A SrtVirtualizationInfo object

 

Returns

A path from which libraries for the emulated architecture can be loaded, or NULL if unknown or unavailable.

[type filename][nullable]

Types and Values

enum SrtVirtualizationType

A type of virtualization.

The vocabulary used here is chosen to be approximately compatible with systemd's ConditionVirtualization.

Members

SRT_VIRTUALIZATION_TYPE_NONE

No virtualization detected

 

SRT_VIRTUALIZATION_TYPE_XEN

Xen hypervisor

 

SRT_VIRTUALIZATION_TYPE_KVM

Linux KVM hypervisor (possibly via qemu)

 

SRT_VIRTUALIZATION_TYPE_QEMU

qemu emulation without KVM, and perhaps older versions of qemu with KVM

 

SRT_VIRTUALIZATION_TYPE_VMWARE

VMware virtual machine

 

SRT_VIRTUALIZATION_TYPE_MICROSOFT

Microsoft Hyper-V virtual machine

 

SRT_VIRTUALIZATION_TYPE_BHYVE

FreeBSD BHYVE

 

SRT_VIRTUALIZATION_TYPE_QNX

QNX hypervisor

 

SRT_VIRTUALIZATION_TYPE_ACRN

ACRN hypervisor

 

SRT_VIRTUALIZATION_TYPE_AMAZON

Amazon EC2

 

SRT_VIRTUALIZATION_TYPE_ORACLE

Oracle VirtualBox

 

SRT_VIRTUALIZATION_TYPE_BOCHS

Bochs

 

SRT_VIRTUALIZATION_TYPE_PARALLELS

Parallels

 

SRT_VIRTUALIZATION_TYPE_FEX_EMU

FEX-Emu x86 emulation

 

SRT_VIRTUALIZATION_TYPE_UNKNOWN

Unknown virtualization type

 

Property Details

The “host-machine” property

  “host-machine”             SrtMachineType

What machine the emulator is running on, if any.

Owner: SrtVirtualizationInfo

Flags: Read / Write / Construct Only

Default value: SRT_MACHINE_TYPE_UNKNOWN


The “host-os-info” property

  “host-os-info”             SrtOsInfo *

Information about the OS being used to run the emulator.

Owner: SrtVirtualizationInfo

Flags: Read / Write / Construct Only


The “host-path” property

  “host-path”                char *

Path through which un-emulated OS files can be accessed.

Owner: SrtVirtualizationInfo

Flags: Read / Write / Construct Only

Default value: NULL


The “interpreter-root” property

  “interpreter-root”         char *

Absolute path where libraries for the emulatedarchitecture can be found.

Owner: SrtVirtualizationInfo

Flags: Read / Write / Construct Only

Default value: NULL


The “type” property

  “type”                     SrtVirtualizationType

Which virtualization type is currently in use.

Owner: SrtVirtualizationInfo

Flags: Read / Write / Construct Only

Default value: SRT_VIRTUALIZATION_TYPE_UNKNOWN