This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 552718 - virt-inspector has non-standard/non-complete format for applications
virt-inspector has non-standard/non-complete format for applications
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: libguestfs (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Richard W.M. Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-05 17:45 EST by James Antill
Modified: 2010-01-06 04:43 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-01-06 04:43:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description James Antill 2010-01-05 17:45:19 EST
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 17:48:51 EST
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 18:10:12 EST
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 18:55:12 EST
Looks great, thanks.
Comment 4 Richard W.M. Jones 2010-01-06 04:43:51 EST
Fixed upstream.

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