GVirConfigDomainCapabilitiesOs object has been introduced in order to represent the <os/> element under <domainCapabilities/>. For now it's not used anywhere, but it's addition allows us to start building the needed machinery for: - Returning a representation os <os/> element; - Having the most basic machinery to start adding functions to return any child element we may need to query from <os/> element; Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx> --- libvirt-gconfig/Makefile.am | 2 + .../libvirt-gconfig-domain-capabilities-os.c | 43 +++++++++++++ .../libvirt-gconfig-domain-capabilities-os.h | 61 +++++++++++++++++++ libvirt-gconfig/libvirt-gconfig.h | 1 + libvirt-gconfig/libvirt-gconfig.sym | 1 + 5 files changed, 108 insertions(+) create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.c create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.h diff --git a/libvirt-gconfig/Makefile.am b/libvirt-gconfig/Makefile.am index db2fa79..089b42a 100644 --- a/libvirt-gconfig/Makefile.am +++ b/libvirt-gconfig/Makefile.am @@ -27,6 +27,7 @@ GCONFIG_HEADER_FILES = \ libvirt-gconfig-domain-address-pci.h \ libvirt-gconfig-domain-address-usb.h \ libvirt-gconfig-domain-capabilities.h \ + libvirt-gconfig-domain-capabilities-os.h \ libvirt-gconfig-domain-channel.h \ libvirt-gconfig-domain-chardev.h \ libvirt-gconfig-domain-chardev-source.h \ @@ -121,6 +122,7 @@ GCONFIG_SOURCE_FILES = \ libvirt-gconfig-domain-address-pci.c \ libvirt-gconfig-domain-address-usb.c \ libvirt-gconfig-domain-capabilities.c \ + libvirt-gconfig-domain-capabilities-os.c \ libvirt-gconfig-domain-channel.c \ libvirt-gconfig-domain-chardev.c \ libvirt-gconfig-domain-chardev-source.c \ diff --git a/libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.c b/libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.c new file mode 100644 index 0000000..d3b6e3c --- /dev/null +++ b/libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.c @@ -0,0 +1,43 @@ +/* + * libvirt-gconfig-domain-capabilities-os.c: libvirt OS domain capabilities + * + * Copyright (C) 2019 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#include <config.h> + +#include "libvirt-gconfig/libvirt-gconfig.h" +#include "libvirt-gconfig/libvirt-gconfig-private.h" + +#define GVIR_CONFIG_DOMAIN_CAPABILITIES_OS_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_CONFIG_TYPE_DOMAIN_CAPABILITIES_OS, GVirConfigDomainCapabilitiesOsPrivate)) + +struct _GVirConfigDomainCapabilitiesOsPrivate +{ + gboolean unused; +}; + +G_DEFINE_TYPE_WITH_PRIVATE(GVirConfigDomainCapabilitiesOs, gvir_config_domain_capabilities_os, GVIR_CONFIG_TYPE_OBJECT); + +static void gvir_config_domain_capabilities_os_class_init(GVirConfigDomainCapabilitiesOsClass *klass G_GNUC_UNUSED) +{ +} + +static void gvir_config_domain_capabilities_os_init(GVirConfigDomainCapabilitiesOs *os) +{ + os->priv = GVIR_CONFIG_DOMAIN_CAPABILITIES_OS_GET_PRIVATE(os); +} diff --git a/libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.h b/libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.h new file mode 100644 index 0000000..dba8572 --- /dev/null +++ b/libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.h @@ -0,0 +1,61 @@ +/* + * libvirt-gconfig-domain-capabilities-os.h: libvirt domain capabilities OS + * + * Copyright (C) 2019 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * <http://www.gnu.org/licenses/>. + */ + +#if !defined(__LIBVIRT_GCONFIG_H__) && !defined(LIBVIRT_GCONFIG_BUILD) +#error "Only <libvirt-gconfig/libvirt-gconfig.h> can be included directly." +#endif + +#ifndef __LIBVIRT_GCONFIG_DOMAIN_CAPABILITIES_OS_H__ +#define __LIBVIRT_GCONFIG_DOMAIN_CAPABILITIES_OS_H__ + +G_BEGIN_DECLS + +#define GVIR_CONFIG_TYPE_DOMAIN_CAPABILITIES_OS (gvir_config_domain_capabilities_os_get_type ()) +#define GVIR_CONFIG_DOMAIN_CAPABILITIES_OS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_CONFIG_TYPE_DOMAIN_CAPABILITIES_OS, GVirConfigDomainCapabilitiesOs)) +#define GVIR_CONFIG_DOMAIN_CAPABILITIES_OS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_CONFIG_TYPE_DOMAIN_CAPABILITIES_OS, GVirConfigDomainCapabilitiesOsClass)) +#define GVIR_CONFIG_IS_DOMAIN_CAPABILITIES_OS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_CONFIG_TYPE_DOMAIN_CAPABILITIES_OS)) +#define GVIR_CONFIG_IS_DOMAIN_CAPABILITIES_OS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_CONFIG_TYPE_DOMAIN_CAPABILITIES_OS)) +#define GVIR_CONFIG_DOMAIN_CAPABILITIES_OS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_CONFIG_TYPE_DOMAIN_CAPABILITIES_OS, GVirConfigDomainCapabilitiesOsClass)) + +typedef struct _GVirConfigDomainCapabilitiesOs GVirConfigDomainCapabilitiesOs; +typedef struct _GVirConfigDomainCapabilitiesOsPrivate GVirConfigDomainCapabilitiesOsPrivate; +typedef struct _GVirConfigDomainCapabilitiesOsClass GVirConfigDomainCapabilitiesOsClass; + +struct _GVirConfigDomainCapabilitiesOs +{ + GVirConfigObject parent; + + GVirConfigDomainCapabilitiesOsPrivate *priv; + + /* Do not add fields to this struct */ +}; + +struct _GVirConfigDomainCapabilitiesOsClass +{ + GVirConfigObjectClass parent_class; + + gpointer padding[20]; +}; + +GType gvir_config_domain_capabilities_os_get_type(void); + +G_END_DECLS + +#endif /* __LIBVIRT_GCONFIG_DOMAIN_CAPABILITIES_OS_H__ */ diff --git a/libvirt-gconfig/libvirt-gconfig.h b/libvirt-gconfig/libvirt-gconfig.h index 9fde05a..896b4f1 100644 --- a/libvirt-gconfig/libvirt-gconfig.h +++ b/libvirt-gconfig/libvirt-gconfig.h @@ -44,6 +44,7 @@ #include <libvirt-gconfig/libvirt-gconfig-domain-address-pci.h> #include <libvirt-gconfig/libvirt-gconfig-domain-address-usb.h> #include <libvirt-gconfig/libvirt-gconfig-domain-capabilities.h> +#include <libvirt-gconfig/libvirt-gconfig-domain-capabilities-os.h> #include <libvirt-gconfig/libvirt-gconfig-domain-chardev.h> #include <libvirt-gconfig/libvirt-gconfig-domain-chardev-source.h> #include <libvirt-gconfig/libvirt-gconfig-domain-chardev-source-pty.h> diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym index 4a13635..0e5c06b 100644 --- a/libvirt-gconfig/libvirt-gconfig.sym +++ b/libvirt-gconfig/libvirt-gconfig.sym @@ -777,6 +777,7 @@ global: gvir_config_domain_capabilities_get_type; gvir_config_domain_capabilities_new; gvir_config_domain_capabilities_new_from_xml; + gvir_config_domain_capabilities_os_get_type; gvir_config_domain_os_firmware_get_type; gvir_config_domain_os_set_firmware; gvir_config_storage_vol_target_features_get_type; -- 2.21.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list