[libvirt] [glib PATCH V5] Add bindings for virDomainRestore*()

Christophe Fergeau cfergeau at redhat.com
Thu Aug 2 12:05:38 UTC 2012


On Tue, Jul 31, 2012 at 12:41:11PM +0200, Zeeshan Ali (Khattak) wrote:
> > +static void restore_domain_from_file_data_free(RestoreDomainFromFileData *data)
> > +{
> > +    g_free(data->filename);
> > +    if (data->custom_conf != NULL)
> > +        g_object_unref(data->custom_conf);
> 
> Actually you can make use of g_clear_object here as you did in
> gvir_domain_save_to_file() patch.

Imo this is a matter of preferences, iirc g_clear_object is a very hammer
performance-wise, so I'm fine with code using g_object_unref directly.

> > +
> > +    if (!gvir_connection_restore_domain_from_file(conn, data->filename,
> > +                                                  data->custom_conf,
> > +                                                  data->flags, &err))
> 
> Each argument on a newline when breaking function call on multiple lines.

I generally favour more balanced blocks, even if this means several
arguments on a break-up line. Just a cosmetic detail, no strong feeling
either, but imo this is more a matter of preference than a hard rule we
should enforce.

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/20120802/9b34b896/attachment-0001.sig>


More information about the libvir-list mailing list