On Tue, Mar 19, 2013 at 10:46:36AM +0100, Christophe Fergeau wrote:
virtxml was doing its own loading of the libosinfo database,
and gvir_designer_init() was loading it a second time.
By adding a gvir_designer_get_osinfo_db() method, virtxml can use
the same libosinfo database as the rest of libvirt-designer.
---
examples/virtxml.c | 51 ++++++++++++----------------
libvirt-designer/libvirt-designer-domain.c | 9 ++++-
libvirt-designer/libvirt-designer-internal.h | 3 --
libvirt-designer/libvirt-designer-main.c | 39 ++++++++++++++++-----
libvirt-designer/libvirt-designer-main.h | 3 ++
libvirt-designer/libvirt-designer.sym | 1 +
6 files changed, 64 insertions(+), 42 deletions(-)
I don't think we should be using a global variable for the
osinfo database in libvirt-designer code at all. The libvirt
designer APIs should allow the database to be passed by the
caller where needed. This allows the app to have separate
DBs for different scenarios if they so need, which could be
useful in multi-threaded apps that want to avoid the need
todo mutex locking on the DBs.
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 :|