Bug 1212680

Summary: RFE: virt-inspector xpath query should output a neat format of the query element
Product: [Fedora] Fedora Reporter: Hu Zhang <huzhan>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: leiwang, mbooth, ptoscano, rjones, virt-maint
Target Milestone: ---Keywords: Improvement
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-04-30 08:23:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hu Zhang 2015-04-17 05:09:06 UTC
Description of problem:
virt-inspector xpath query should output a neat format of the query element.

This problem also exist in RHEL6.7 and RHEL7.1. 


Version-Release number of selected component (if applicable):
libguestfs-tools-c-1.29.33-1.fc22.x86_64


How reproducible:
100%


Steps to Reproduce:
1. Prepare a guest image, such as Fedora20
2. Run the following command: 
# virt-inspector -a Fedora-20.raw |virt-inspector --xpath '//mountpoints'
<mountpoints>
          <mountpoint dev="/dev/fedora_dhcp-66-103-65/root">/</mountpoint>
          <mountpoint dev="/dev/sda1">/boot</mountpoint>
        </mountpoints>


Actual results:
As above


Expected results:
<mountpoints>
          <mountpoint dev="/dev/fedora_dhcp-66-103-65/root">/</mountpoint>
          <mountpoint dev="/dev/sda1">/boot</mountpoint>
</mountpoints>


Additional info:
The output format is also not neat when query other elements, such as: filesystem, operatingsystem, etc.

Comment 1 Richard W.M. Jones 2015-04-17 09:15:34 UTC
There's probably a libxml2 flag we can use to format the output better.
However the current output is correct.