Add a way to access the object which represents the <os/> element from the <domainCapabilities/>. Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx> --- .../libvirt-gconfig-domain-capabilities.c | 23 +++++++++++++++++++ .../libvirt-gconfig-domain-capabilities.h | 1 + libvirt-gconfig/libvirt-gconfig.sym | 1 + 3 files changed, 25 insertions(+) diff --git a/libvirt-gconfig/libvirt-gconfig-domain-capabilities.c b/libvirt-gconfig/libvirt-gconfig-domain-capabilities.c index 3377889..906e7f0 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-capabilities.c +++ b/libvirt-gconfig/libvirt-gconfig-domain-capabilities.c @@ -69,3 +69,26 @@ gvir_config_domain_capabilities_new_from_xml(const gchar *xml, xml, error); return GVIR_CONFIG_DOMAIN_CAPABILITIES(object); } + +/** + * gvir_config_domain_capabilities_get_os: + * @domain_caps: a #GVirConfigDomainCapabilities + * + * Gets the @os associated with the @domain_caps. + * + * Returns: (transfer full): a new #GVirConfigDomainCapabilitiesOs. + */ +GVirConfigDomainCapabilitiesOs * +gvir_config_domain_capabilities_get_os(GVirConfigDomainCapabilities *domain_caps) +{ + GVirConfigObject *object; + + g_return_val_if_fail(GVIR_CONFIG_IS_DOMAIN_CAPABILITIES(domain_caps), NULL); + + object = gvir_config_object_get_child_with_type + (GVIR_CONFIG_OBJECT(domain_caps), + "os", + GVIR_CONFIG_TYPE_DOMAIN_CAPABILITIES_OS); + + return GVIR_CONFIG_DOMAIN_CAPABILITIES_OS(object); +} diff --git a/libvirt-gconfig/libvirt-gconfig-domain-capabilities.h b/libvirt-gconfig/libvirt-gconfig-domain-capabilities.h index 965d2a4..cbe7540 100644 --- a/libvirt-gconfig/libvirt-gconfig-domain-capabilities.h +++ b/libvirt-gconfig/libvirt-gconfig-domain-capabilities.h @@ -61,6 +61,7 @@ GType gvir_config_domain_capabilities_get_type(void); GVirConfigDomainCapabilities *gvir_config_domain_capabilities_new(void); GVirConfigDomainCapabilities *gvir_config_domain_capabilities_new_from_xml(const gchar *xml, GError **error); +GVirConfigDomainCapabilitiesOs *gvir_config_domain_capabilities_get_os(GVirConfigDomainCapabilities *domain_caps); G_END_DECLS diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym index 0e5c06b..783b0d7 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -774,6 +774,7 @@ global: LIBVIRT_GCONFIG_2.0.1 { global: + gvir_config_domain_capabilities_get_os; gvir_config_domain_capabilities_get_type; gvir_config_domain_capabilities_new; gvir_config_domain_capabilities_new_from_xml; -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list