OsinfoPlatform: Libosinfo Reference Manual

## OsinfoPlatform OsinfoPlatform — An virtualization platform |

## Functions

OsinfoPlatform * | osinfo_platform_new ()
OsinfoDeviceList * | osinfo_platform_get_devices ()
OsinfoDeviceList * | osinfo_platform_get_all_devices ()
OsinfoDeviceLinkList * | osinfo_platform_get_device_links ()
OsinfoDeviceLink * | osinfo_platform_add_device ()

## Object Hierarchy

        GObject
        ╰── OsinfoEntity
            ╰── OsinfoProduct
                ╰── OsinfoPlatform

## Description

OsinfoPlatform is an entity representing an virtualization platform. Platforms have a list of supported devices

## Functions

### osinfo_platform_new ()

    OsinfoPlatform *
    osinfo_platform_new (const gchar *id);

Create a new platform entity

#### Parameters

id | a unique identifier |

#### Returns

A platform entity.

[transfer full]

### osinfo_platform_get_devices ()

    OsinfoDeviceList *
    osinfo_platform_get_devices (OsinfoPlatform *platform,
                                 OsinfoFilter *filter);

Retrieve all the associated devices matching the filter. The filter matches against the device, not the link.

#### Parameters

platform | a platform entity |
filter | an optional filter. | [transfer none][allow-none]

#### Returns

a list of OsinfoDevice entities.

[transfer full]

### osinfo_platform_get_all_devices ()

    OsinfoDeviceList *
    osinfo_platform_get_all_devices (OsinfoPlatform *platform,
                                     OsinfoFilter *filter);

Get all platforms matching a given filter but unlike osinfo_platform_get_devices this function also retrieves devices from all derived and upgraded platforms.

#### Parameters

platform | a platform |
filter | an optional device property filter. | [allow-none][transfer none]

#### Returns

A list of devices.

[transfer full]

Since: 0.2.7

### osinfo_platform_get_device_links ()

    OsinfoDeviceLinkList *
    osinfo_platform_get_device_links (OsinfoPlatform *platform,
                                      OsinfoFilter *filter);

Retrieve all the associated devices matching the filter. The filter matches against the link, not the device.

#### Parameters

platform | a platform entity |
filter | an optional filter. | [transfer none][allow-none]

#### Returns

a list of OsinfoDevice entities.

[transfer full]

### osinfo_platform_add_device ()

    OsinfoDeviceLink *
    osinfo_platform_add_device (OsinfoPlatform *platform,
                                OsinfoDevice *dev);

Associate a device with a platform. The returned OsinfoDeviceLink can be used to record extra metadata against the link

#### Parameters

platform | a platform entity |
dev | the device to associate. | [transfer none]

#### Returns

the device association.

[transfer none]

## See Also

OsinfoOs, OsinfoPlatform