[libvirt] [libvirt-designer][PATCH v2 1/4] Load osinfo DB on init

Christophe Fergeau cfergeau at redhat.com
Wed Sep 12 10:01:44 UTC 2012


On Wed, Sep 12, 2012 at 11:48:31AM +0200, Michal Privoznik wrote:
> > 
> > 
> >> +    osinfo_loader = osinfo_loader_new();
> >> +    osinfo_loader_process_default_path(osinfo_loader, err);
> >> +    if (err)
> >> +        return FALSE;
> > 
> > I'm not sure we want to error out there, see
> > http://git.fedorahosted.org/cgit/libosinfo.git/commit/?id=dbde512c3a64640d61fa5e7f801050e248f60c98
> > for my reasoning (and you can try a "mkdir -p ~/.config/libosinfo/db &&
> > echo '<bad' >~/.config/libosinfo/db/broken.xml" to get into a 'bad'
> > situation).
> 
> IIUC, malformed XML doesn't affect loading of other well-formed XMLs,
> right? If this is the case, then yes - we should not report error.
> However, if malformed XML results in empty libosinfo DB, then we must
> report error here as non-empty DB is crucial for libvirt-designer.

Malformed XML will not prevent other database files from being loaded, but
libosinfo still reports an error in this case. However, osinfo-detect will
still be working as expected, you can test it with the example I provided.
Maybe it should be up to libosinfo not to error out on invalid XML files,
but to have additional API for users who want to be informed about anything
going wrong in the loading process.

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/20120912/4d093e63/attachment-0001.sig>


More information about the libvir-list mailing list