Bug 563450 - list-devices returns devices of different types out of order
Summary: list-devices returns devices of different types out of order
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-02-10 09:43 UTC by Matthew Booth
Modified: 2013-12-16 15:24 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-16 15:24:27 UTC
Embargoed:


Attachments (Terms of Use)

Description Matthew Booth 2010-02-10 09:43:46 UTC
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 11:30:47 UTC
Product should be 'Virtualization Tools'.

Comment 2 Pino Toscano 2013-12-13 15:36:25 UTC
(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 15:24:27 UTC
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.