Bug 552718 - virt-inspector has non-standard/non-complete format for applications
Summary: virt-inspector has non-standard/non-complete format for applications
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libguestfs
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-05 22:45 UTC by James Antill
Modified: 2010-01-06 09:43 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-01-06 09:43:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
virt-inspector description from a CentOS 5.4 guest (401.46 KB, application/xml)
2010-01-05 23:10 UTC, Richard W.M. Jones
no flags Details

Description James Antill 2010-01-05 22:45:19 UTC
Description of problem:
 For the applications part of the virt-inspector dump, you print data like (from example2.xml):

1770       <application>
1771         <name>libguestfs</name>
1772         <version>1.0.68</version>
1773       </application>

...but this isn't enough information to specify which package of libguestfs you have. You need at least something like:

    $xml->startTag("applications");
    my @apps =  @{$os->{apps}};
    foreach (@apps) {
        $xml->startTag("application");
        $xml->dataElement("name", $_->{name});
        $xml->dataElement("epoch", $_->{epoch});
        $xml->dataElement("version", $_->{version});
        $xml->dataElement("release", $_->{release});
        $xml->dataElement("arch", $_->{arch});
        $xml->endTag("application");
    }
    $xml->endTag("applications");

...to be 100% you also want the checksums (and the yum version for the system would be nice), but you have a slight problem there in that you'd need to get it in _check_for_applications() first.
 Also: *cough* Calling rpm -qa --qf and using regexps to get the package list *cough*

Comment 1 James Antill 2010-01-05 22:48:51 UTC
Also storing epoch internally as '' instead of '0' is a bad idea IMO, but for sure you want to either dump:

<name>blah</name>
<epoch>0</epoch>
<version>1</version>
<release>2</release>
<arch>2</arch>

...or:

<name>blah</name>
<version>1</version>
<release>2</release>
<arch>2</arch>

Comment 2 Richard W.M. Jones 2010-01-05 23:10:12 UTC
Created attachment 381874 [details]
virt-inspector description from a CentOS 5.4 guest

James, can you check if the follow patch fixes this bug?

http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=a59dcdbd1b0a28c960e3792165a13f2daf4f6c35

Attached is an example of the virt-inspector XML output with
this patch applied.

Comment 3 James Antill 2010-01-05 23:55:12 UTC
Looks great, thanks.

Comment 4 Richard W.M. Jones 2010-01-06 09:43:51 UTC
Fixed upstream.


Note You need to log in before you can comment on or make changes to this bug.