[libvirt] [libvirt-glib 11/37] Implement gvir_config_os_set_os_type

Christophe Fergeau cfergeau at redhat.com
Mon Nov 21 18:01:46 UTC 2011


Hey,

On Tue, Nov 15, 2011 at 03:33:45PM +0100, Marc-André Lureau wrote:
> However, thinking a bit more about it, genum_get_nick() shouldn't warn
> if given a value that has no associated nick, because enums shouldn't
> be limited to their associated name, and those value would be
> perfectly valid, but should return NULL and that's it.

For now I have added a warning to genum_get_nick since we shouldn't get an
enum with no associated strings. If this happens, this means something
unexpected happened, so it's better to warn about it. We can change this
when we have a valid use case for this.

> 
> However, siliently not doing anything is misleading. So instead of
> 
> if (type_str != NULL)
>   xmlNodeSetContent(node, (xmlChar*)type_str);
> 
> I would do (or similar):
> 
> g_return_if_fail (type_str != NULL);
> xmlNodeSetContent(node, (xmlChar*)type_str);

And I did that change too.

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/20111121/7ee8fb81/attachment-0001.sig>


More information about the libvir-list mailing list