This service will be undergoing maintenance at 03:30 UTC, 2016-05-27. It is expected to last about 2 hours
Bug 563450 - list-devices returns devices of different types out of order
list-devices returns devices of different types out of order
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-10 04:43 EST by Matthew Booth
Modified: 2013-12-16 10:24 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-16 10:24:27 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Matthew Booth 2010-02-10 04:43:46 EST
Description of problem:
><fs> add-drive /dev/vg_mbooth_t500_2/RHEL52PV32
><fs> add-cdrom /var/lib/virt-v2v/transfer.iso
><fs> launch
><fs> list-devices 
/dev/sr0
/dev/vda

Note that the cd-rom device was added second, but is listed first.

The code is simply doing an alphanumeric sort, which won't work if the devices have different prefixes.

Version-Release number of selected component (if applicable):
libguestfs-1.0.83-5.fc13.x86_64
Comment 1 Richard W.M. Jones 2010-02-12 06:30:47 EST
Product should be 'Virtualization Tools'.
Comment 2 Pino Toscano 2013-12-13 10:36:25 EST
(In reply to Matthew Booth from comment #0)
> Description of problem:
> ><fs> add-drive /dev/vg_mbooth_t500_2/RHEL52PV32
> ><fs> add-cdrom /var/lib/virt-v2v/transfer.iso
> ><fs> launch
> ><fs> list-devices 
> /dev/sr0
> /dev/vda

This small sequence currently crashes in the device sorting code (sort_device_names).

> Note that the cd-rom device was added second, but is listed first.
> 
> The code is simply doing an alphanumeric sort, which won't work if the
> devices have different prefixes.

This (and the above) gets fixed by making CD-ROM disks as normal drives; patch proposed to the mailing list:
https://www.redhat.com/archives/libguestfs/2013-December/msg00075.html
Comment 3 Pino Toscano 2013-12-16 10:24:27 EST
Fixed upstream with:
https://github.com/libguestfs/libguestfs/commit/2392fae6803b9de4a4761509007c160339d57f50
which is in libguestfs >= 1.25.16.

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