Top |
#define | OSINFO_ARCHITECTURE_ALL |
#define | OSINFO_MEGAHERTZ |
#define | OSINFO_KIBIBYTES |
#define | OSINFO_MEBIBYTES |
#define | OSINFO_GIBIBYTES |
#define | OSINFO_RESOURCES_PROP_ARCHITECTURE |
#define | OSINFO_RESOURCES_PROP_CPU |
#define | OSINFO_RESOURCES_PROP_N_CPUS |
#define | OSINFO_RESOURCES_PROP_RAM |
#define | OSINFO_RESOURCES_PROP_STORAGE |
OsinfoResources is an entity representing required or recommended resources for an (guest) operating system.
OsinfoResources * osinfo_resources_new (const gchar *id
,const gchar *architecture
);
const gchar *
osinfo_resources_get_architecture (OsinfoResources *resources
);
Retrieves the target hardware architecture to which resources
applies. Some
operating systems specify the same requirements and recommendations for all
architectures. In such cases, the string returned by this call will be
OSINFO_ARCHITECTURE_ALL.
gint
osinfo_resources_get_n_cpus (OsinfoResources *resources
);
Retrieves the number of CPUs.
gint64
osinfo_resources_get_cpu (OsinfoResources *resources
);
Retrieves the CPU frequency in hertz (Hz). Divide the value by OSINFO_MEGAHERTZ if you need this value in megahertz (MHz).
gint64
osinfo_resources_get_ram (OsinfoResources *resources
);
Retrieves the amount of Random Access Memory (RAM) in bytes. Divide the value by OSINFO_MEBIBYTES if you need this value in mebibytes.
gint64
osinfo_resources_get_storage (OsinfoResources *resources
);
Retrieves the amount of storage space in bytes. Divide the value by OSINFO_GIBIBYTES if you need this value in gibibytes.
void osinfo_resources_set_n_cpus (OsinfoResources *resources
,gint n_cpus
);
Sets the number of CPUs.
void osinfo_resources_set_cpu (OsinfoResources *resources
,gint64 cpu
);
Sets the CPU frequency.
void osinfo_resources_set_ram (OsinfoResources *resources
,gint64 ram
);
Sets the amount of RAM in bytes.
void osinfo_resources_set_storage (OsinfoResources *resources
,gint64 storage
);
Sets the amount of storage space.
“architecture”
property“architecture” gchar *
The target hardware architecture to which these resources applies.
Flags: Read / Write / Construct Only
Default value: NULL
“cpu”
property“cpu” gint64
The CPU frequency in hertz (Hz).
Flags: Read / Write
Allowed values: [-1,2147483647]
Default value: -1
“n-cpus”
property“n-cpus” gint
The number of CPUs.
Flags: Read / Write
Allowed values: >= -1
Default value: -1
“ram”
property“ram” gint64
The amount of Random Access Memory (RAM) in bytes.
Flags: Read / Write
Allowed values: >= -1
Default value: -1
“storage”
property“storage” gint64
The amount of storage space in bytes.
Flags: Read / Write
Allowed values: >= -1
Default value: -1