[libvirt] [libvirt-glib 07/37] Implement gvir_config_clock_set_offset

Christophe Fergeau cfergeau at redhat.com
Tue Nov 15 13:58:39 UTC 2011


On Fri, Nov 11, 2011 at 03:47:36PM +0100, Marc-André Lureau wrote:
> 
> On Thu, Nov 10, 2011 at 9:33 PM, Christophe Fergeau <cfergeau at redhat.com> wrote:
> > ---
> >  libvirt-gconfig/libvirt-gconfig-clock.c |   19 +++++++++++++++++++
> >  libvirt-gconfig/libvirt-gconfig-clock.h |    8 ++++++++
> >  libvirt-gconfig/libvirt-gconfig.sym     |    2 ++
> >  3 files changed, 29 insertions(+), 0 deletions(-)
> >
> > diff --git a/libvirt-gconfig/libvirt-gconfig-clock.c b/libvirt-gconfig/libvirt-gconfig-clock.c
> > index 120d3a6..dc7932d 100644
> > --- a/libvirt-gconfig/libvirt-gconfig-clock.c
> > +++ b/libvirt-gconfig/libvirt-gconfig-clock.c
> > @@ -81,6 +81,25 @@ GVirConfigClock *gvir_config_clock_new_from_xml(const gchar *xml,
> >     return GVIR_CONFIG_CLOCK(object);
> >  }
> >
> > +void gvir_config_clock_set_offset(GVirConfigClock *klock,
> > +                                  GVirConfigClockOffset offset)
> > +{
> > +    GEnumClass *enum_class;
> > +    GEnumValue *enum_value;
> > +    xmlNodePtr node;
> > +
> > +    node = gvir_config_object_get_xml_node(GVIR_CONFIG_OBJECT(klock));
> > +    if (node == NULL)
> > +        return;
> > +    enum_class = g_type_class_ref(GVIR_TYPE_CONFIG_CLOCK_OFFSET);
> > +    enum_value = g_enum_get_value(enum_class, offset);
> > +    if (enum_value != NULL)
> > +        xmlNewProp(node, (xmlChar*)"offset", (xmlChar*)enum_value->value_nick);
> > +
> > +    g_type_class_unref(enum_class);
> > +
> > +}
> 
> There is an extra ending line.
> 
> You could rebase so that gvir_config_genum_get_nick() helper is added
> before this function.

Good point, I did this, and this got rid of the extra white line at the
same time.

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


More information about the libvir-list mailing list