[virt-tools-list] [libosinfo 3/5] Fix OsinfoMedia::installer-reboots default value

Christophe Fergeau cfergeau at redhat.com
Wed Nov 28 14:17:22 UTC 2012


On Wed, Nov 28, 2012 at 03:47:38PM +0200, Zeeshan Ali (Khattak) wrote:
> On Wed, Nov 28, 2012 at 10:58 AM, Christophe Fergeau
> <cfergeau at redhat.com> wrote:
> > On Wed, Nov 28, 2012 at 01:29:54AM +0200, Zeeshan Ali (Khattak) wrote:
> >> On Wed, Nov 28, 2012 at 12:39 AM, Christophe Fergeau
> >> <cfergeau at redhat.com> wrote:
> >> > In other words,
> >> > am I introducing a regression,
> >>
> >> Well its not really causing a regression but its not fixing anything either.
> >
> > Definitely not, it just makes the code more consistent (same value for the
> > gobject default property value and in the
> > osinfo_entity_get_value_with_default).
> 
> Not sure how can still state this as a fact while I already told you
> how its not.

gint osinfo_media_get_installer_reboots(OsinfoMedia *media)
{
    g_return_val_if_fail(OSINFO_IS_MEDIA(media), -1);
    g_return_val_if_fail(osinfo_media_get_installer (media), -1);

    return (gint) osinfo_entity_get_param_value_int64_with_default
            (OSINFO_ENTITY(media), OSINFO_MEDIA_PROP_INSTALLER_REBOOTS, 1);
}

'1' *is* the default value, -1 is only returned in case of invalid input
(ie programming error).

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/virt-tools-list/attachments/20121128/57efddd7/attachment.sig>


More information about the virt-tools-list mailing list