Bug 1414682 - guestfs_canonical_device_name incorrectly returns /dev/sd0 for MD devices (/dev/md0)
Summary: guestfs_canonical_device_name incorrectly returns /dev/sd0 for MD devices (/d...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1414505
TreeView+ depends on / blocked
 
Reported: 2017-01-19 08:56 UTC by Richard W.M. Jones
Modified: 2017-01-19 12:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-19 12:11:30 UTC


Attachments (Terms of Use)

Description Richard W.M. Jones 2017-01-19 08:56:25 UTC
Description of problem:

><fs> list-md-devices 
/dev/md0
/dev/md127
><fs> canonical-device-name /dev/md0
/dev/sd0
><fs> canonical-device-name /dev/md127
/dev/sd127

libguestfs shouldn't rewrite /dev/mdX to /dev/sdX in
this instance.

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

libguestfs 1.35.14

How reproducible:

100%

Steps to Reproduce:
1. See above.

Comment 1 Richard W.M. Jones 2017-01-19 08:57:03 UTC
A consequence of this bug can be seen in the output
of the virt-filesystems command shown here:

https://bugzilla.redhat.com/show_bug.cgi?id=1414510#c0

Comment 2 Richard W.M. Jones 2017-01-19 08:57:56 UTC
Another consequence is that programs like virt-v2v try to
pass the string /dev/sd0 back to the API which fails:

><fs> vfs-type /dev/sd0
libguestfs: error: vfs_type: vfs_type_stub: /dev/sd0: No such file or directory

Comment 3 Richard W.M. Jones 2017-01-19 09:47:58 UTC
Patches posted:

https://www.redhat.com/archives/libguestfs/2017-January/msg00051.html
https://www.redhat.com/archives/libguestfs/2017-January/msg00052.html

The new output from virt-filesystems looks like:

Name        Type        VFS      Label  MBR  Size  Parent
/dev/sda1   filesystem  unknown  -      -    1.0G  -
/dev/sda2   filesystem  unknown  -      -    1.0G  -
/dev/sda3   filesystem  unknown  -      -    8.0G  -
/dev/sdb1   filesystem  unknown  -      -    1.0G  -
/dev/sdb2   filesystem  unknown  -      -    1.0G  -
/dev/sdb3   filesystem  unknown  -      -    8.0G  -
/dev/md0    filesystem  unknown  -      -    10G   /dev/sda,/dev/sdb
/dev/md127  filesystem  unknown  -      -    0     /dev/sda,/dev/sdb
/dev/sda1   partition   -        -      83   1.0G  /dev/sda
/dev/sda2   partition   -        -      82   1.0G  /dev/sda
/dev/sda3   partition   -        -      83   8.0G  /dev/sda
/dev/sdb1   partition   -        -      83   1.0G  /dev/sdb
/dev/sdb2   partition   -        -      82   1.0G  /dev/sdb
/dev/sdb3   partition   -        -      83   8.0G  /dev/sdb
/dev/sda    device      -        -      -    10G   -
/dev/sdb    device      -        -      -    10G   -


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