Bug 1211996 - virt-inspector gives incorrect arch (ppc64) for ppc64le guest
Summary: virt-inspector gives incorrect arch (ppc64) for ppc64le guest
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Maros Zatko
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 1264835
TreeView+ depends on / blocked
 
Reported: 2015-04-15 11:34 UTC by Richard W.M. Jones
Modified: 2015-09-21 10:57 UTC (History)
3 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2015-05-28 12:01:09 UTC


Attachments (Terms of Use)

Description Richard W.M. Jones 2015-04-15 11:34:04 UTC
Description of problem:

$ virt-builder --arch ppc64le fedora-21 --output fedora-21-ppc64le
$ virt-inspector -a fedora-21-ppc64le
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/sda5</root>
    <name>linux</name>
    <arch>ppc64</arch>     # incorrect, should be ppc64le

The root cause seems to be because guestfs_file_architecture
gives the wrong output:

$ guestfish --ro -a fedora-21-ppc64le -i

><fs> file-architecture /boot/vmlinuz-3.17.4-301.fc21.ppc64le 
ppc64
><fs> file-architecture /bin/ls
ppc64

The output of 'file /bin/ls' on ppc64le is:

ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=bf32a7e5068074a54e91a65b2110a34bd0e9aea4, stripped

Note 'LSB' indicating little endian.

For comparison, on ppc64 (big endian):

ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.1, for GNU/Linux 2.6.32, BuildID[sha1]=20d03ec87b2e8a3073bcc9e1427f1598ee8e2821, stripped

Version-Release number of selected component (if applicable):

libguestfs-1.29.34-1.fc23.x86_64

Comment 1 Richard W.M. Jones 2015-05-28 12:01:09 UTC
Upstream commit:
https://github.com/libguestfs/libguestfs/commit/33d2b4a7341830efeddb1f258ac77f67a8004d30

$ virt-builder --arch ppc64le fedora-21 --output fedora-21-ppc64le
$ virt-inspector -a fedora-21-ppc64le | grep arch | head -1
    <arch>ppc64le</arch>

Fixed in libguestfs >= 1.29.45.


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