[libvirt] [gconfig v2 1/4] Introduce libvirt-domain-graphics-listen

Christophe Fergeau cfergeau at redhat.com
Wed Aug 3 14:11:28 UTC 2016


Hey,

On Mon, Aug 01, 2016 at 11:52:37PM +0300, Visarion Alexandru wrote:
> From: Visarion Alexandru <viorel.visarion at gmail.com>
> 
> Abstract class which represents a listen child node
> of the graphics device.
> ---
>  libvirt-gconfig/Makefile.am                        |  2 +
>  .../libvirt-gconfig-domain-graphics-listen.c       | 48 ++++++++++++++++
>  .../libvirt-gconfig-domain-graphics-listen.h       | 64 ++++++++++++++++++++++
>  libvirt-gconfig/libvirt-gconfig.h                  |  1 +
>  libvirt-gconfig/libvirt-gconfig.sym                |  1 +
>  5 files changed, 116 insertions(+)
>  create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-graphics-listen.c
>  create mode 100644 libvirt-gconfig/libvirt-gconfig-domain-graphics-listen.h
> 
> diff --git a/libvirt-gconfig/Makefile.am b/libvirt-gconfig/Makefile.am
> index 0400343..27c6df1 100644
> --- a/libvirt-gconfig/Makefile.am
> +++ b/libvirt-gconfig/Makefile.am
> @@ -45,6 +45,7 @@ GCONFIG_HEADER_FILES = \
>  			libvirt-gconfig-domain-disk-driver.h \
>  			libvirt-gconfig-domain-filesys.h \
>  			libvirt-gconfig-domain-graphics.h \
> +			libvirt-gconfig-domain-graphics-listen.h\
>  			libvirt-gconfig-domain-graphics-desktop.h \
>  			libvirt-gconfig-domain-graphics-rdp.h \
>  			libvirt-gconfig-domain-graphics-sdl.h \
> @@ -138,6 +139,7 @@ GCONFIG_SOURCE_FILES = \
>  			libvirt-gconfig-domain-disk-driver.c \
>  			libvirt-gconfig-domain-filesys.c \
>  			libvirt-gconfig-domain-graphics.c \
> +			libvirt-gconfig-domain-graphics-listen.c\
>  			libvirt-gconfig-domain-graphics-desktop.c \
>  			libvirt-gconfig-domain-graphics-rdp.c \
>  			libvirt-gconfig-domain-graphics-sdl.c \
> diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-listen.c b/libvirt-gconfig/libvirt-gconfig-domain-graphics-listen.c
> new file mode 100644
> index 0000000..c89f126
> --- /dev/null
> +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-listen.c
> @@ -0,0 +1,48 @@
> +/*
> + * libvirt-gconfig-domain-graphics-listen.c: libvirt domain graphics listen base class
> + *


Since you write this code and not Red Hat, this should read:

> + * Copyright (C) 2016 Visarion Alexandru <viorel.visarion at gmail.com>

If you copied the code from another file and want to keep the copyright
history, just keep the previous (C) line, and add another one with your
name on it.


> + *
> + * 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/>.
> + *
> + * Author: Visarion Alexandru <viorel.visarion at gmail.com>
> + */
> +
> +#include <config.h>
> +
> +#include "libvirt-gconfig/libvirt-gconfig.h"
> +#include "libvirt-gconfig/libvirt-gconfig-private.h"
> +
> +#define GVIR_CONFIG_DOMAIN_GRAPHICS_LISTEN_GET_PRIVATE(obj)                         \
> +        (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_LISTEN, GVirConfigDomainGraphicsListenPrivate))
> +
> +struct _GVirConfigDomainGraphicsListenPrivate
> +{
> +    gboolean unused;
> +};
> +
> +G_DEFINE_ABSTRACT_TYPE(GVirConfigDomainGraphicsListen, gvir_config_domain_graphics_listen, GVIR_CONFIG_TYPE_OBJECT);
> +
> +
> +static void gvir_config_domain_graphics_listen_class_init(GVirConfigDomainGraphicsListenClass *klass)
> +{
> +    g_type_class_add_private(klass, sizeof(GVirConfigDomainGraphicsListenPrivate));
> +}
> +
> +
> +static void gvir_config_domain_graphics_listen_init(GVirConfigDomainGraphicsListen *listen)
> +{
> +    listen->priv = GVIR_CONFIG_DOMAIN_GRAPHICS_LISTEN_GET_PRIVATE(listen);
> +}
> diff --git a/libvirt-gconfig/libvirt-gconfig-domain-graphics-listen.h b/libvirt-gconfig/libvirt-gconfig-domain-graphics-listen.h
> new file mode 100644
> index 0000000..dba3811
> --- /dev/null
> +++ b/libvirt-gconfig/libvirt-gconfig-domain-graphics-listen.h
> @@ -0,0 +1,64 @@
> +/*
> + * libvirt-gconfig-domain-graphics-listen.h: libvirt domain graphics listen base class
> + *
> + * Copyright (C) 2016 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/>.
> + *
> + * Author: Visarion Alexandru <viorel.visarion at gmail.com>
> + */
> +
> +#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_GRAPHICS_LISTEN_H__
> +#define __LIBVIRT_GCONFIG_DOMAIN_GRAPHICS_LISTEN_H__
> +
> +G_BEGIN_DECLS
> +
> +#define GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_LISTEN            (gvir_config_domain_graphics_listen_get_type ())
> +#define GVIR_CONFIG_DOMAIN_GRAPHICS_LISTEN(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_LISTEN, GVirConfigDomainGraphicsListen))
> +#define GVIR_CONFIG_DOMAIN_GRAPHICS_LISTEN_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_LISTEN, GVirConfigDomainGraphicsListenClass))
> +#define GVIR_CONFIG_IS_DOMAIN_GRAPHICS_LISTEN(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_LISTEN))
> +#define GVIR_CONFIG_IS_DOMAIN_GRAPHICS_LISTEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_LISTEN))
> +#define GVIR_CONFIG_DOMAIN_GRAPHICS_LISTEN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GVIR_CONFIG_TYPE_DOMAIN_GRAPHICS_LISTEN, GVirConfigDomainGraphicsListenClass))
> +
> +typedef struct _GVirConfigDomainGraphicsListen GVirConfigDomainGraphicsListen;
> +typedef struct _GVirConfigDomainGraphicsListenPrivate GVirConfigDomainGraphicsListenPrivate;
> +typedef struct _GVirConfigDomainGraphicsListenClass GVirConfigDomainGraphicsListenClass;
> +
> +struct _GVirConfigDomainGraphicsListen
> +{
> +    GVirConfigObject parent;
> +
> +    GVirConfigDomainGraphicsListenPrivate *priv;
> +
> +    /* Do not add fields to this struct */
> +};
> +
> +struct _GVirConfigDomainGraphicsListenClass
> +{
> +    GVirConfigObjectClass parent_class;
> +
> +    gpointer padding[20];
> +};
> +
> +
> +GType gvir_config_domain_graphics_listen_get_type(void);
> +
> +G_END_DECLS
> +
> +#endif /* __LIBVIRT_GCONFIG_DOMAIN_GRAPHICS_LISTEN_H__ */
> diff --git a/libvirt-gconfig/libvirt-gconfig.h b/libvirt-gconfig/libvirt-gconfig.h
> index 6462154..ecf1322 100644
> --- a/libvirt-gconfig/libvirt-gconfig.h
> +++ b/libvirt-gconfig/libvirt-gconfig.h
> @@ -62,6 +62,7 @@
>  #include <libvirt-gconfig/libvirt-gconfig-domain-disk-driver.h>
>  #include <libvirt-gconfig/libvirt-gconfig-domain-filesys.h>
>  #include <libvirt-gconfig/libvirt-gconfig-domain-graphics.h>
> +#include <libvirt-gconfig/libvirt-gconfig-domain-graphics-listen.h>
>  #include <libvirt-gconfig/libvirt-gconfig-domain-graphics-desktop.h>
>  #include <libvirt-gconfig/libvirt-gconfig-domain-graphics-rdp.h>
>  #include <libvirt-gconfig/libvirt-gconfig-domain-graphics-sdl.h>
> diff --git a/libvirt-gconfig/libvirt-gconfig.sym b/libvirt-gconfig/libvirt-gconfig.sym
> index 4ef4bf7..b112399 100644
> --- a/libvirt-gconfig/libvirt-gconfig.sym
> +++ b/libvirt-gconfig/libvirt-gconfig.sym
> @@ -764,6 +764,7 @@ global:
>  
>  	gvir_config_domain_video_get_model;
>  	gvir_config_domain_video_set_accel3d;
> +	gvir_config_domain_graphics_listen_get_type;

This needs to be alphabetically ordered or 'make check'/'make
syntax-check' will fail.

Looks good otherwise,

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160803/05244300/attachment-0001.sig>


More information about the libvir-list mailing list