[libvirt] [[libvirt-glib PATCHv3] 2/3] Don't use g_error in xxx_get_name

Daniel P. Berrange berrange at redhat.com
Tue Jan 31 14:44:32 UTC 2012


On Tue, Jan 31, 2012 at 03:34:10PM +0100, Christophe Fergeau wrote:
> g_error will trigger an abort of the running process so it's not
> desirable to call it in a library. This commit uses g_warning when
> this occurs and returns NULL. libvirt will only return NULL for these
> strings if some kind of memory corruption is going on, or if we are
> using an invalid pointer.
> ---
>  libvirt-gobject/libvirt-gobject-connection.c      |    6 ++++++
>  libvirt-gobject/libvirt-gobject-domain-snapshot.c |    3 ++-
>  libvirt-gobject/libvirt-gobject-domain.c          |    3 ++-
>  libvirt-gobject/libvirt-gobject-interface.c       |    3 ++-
>  libvirt-gobject/libvirt-gobject-network-filter.c  |    3 ++-
>  libvirt-gobject/libvirt-gobject-network.c         |    3 ++-
>  libvirt-gobject/libvirt-gobject-node-device.c     |    3 ++-
>  libvirt-gobject/libvirt-gobject-storage-pool.c    |   13 +++++++++----
>  libvirt-gobject/libvirt-gobject-storage-vol.c     |    3 ++-
>  9 files changed, 29 insertions(+), 11 deletions(-)

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list