[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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

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.


Attachment: pgpozzcXMpRSf.pgp
Description: PGP signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]