Bug 491112

Summary: QEMU disks show up in anaconda as UNKNOWN
Product: [Fedora] Fedora Reporter: James Laska <jlaska>
Component: partedAssignee: Joel Andres Granados <jgranado>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dwmw2, gcosta, jgranado, jturner, markmc, meyering, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-03-26 14:58:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 480594    
Attachments:
Description Flags
Screenshot
none
Screenshot (shows IDE, SCSI and VirtIO disks) none

Description James Laska 2009-03-19 14:08:54 UTC
Created attachment 335857 [details]
Screenshot

Description of problem:

In F10, when installing in a KVM guest, the guest disks would show up in anaconda as QEMU disks.  In rawhide, they show up as UNKNOWN (see attached screenshot).

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

libvirt.i586                              0.6.1-5.fc11                                            rawhide
qemu.i586                                 2:0.10-0.9.kvm20090310git.fc11                          rawhide
virt-manager.i586                         0.7.0-1.fc11                                            rawhide

How reproducible:
Everytime

Additional info:

    <disk type='block' device='disk'>
      <source dev='/dev/mapper/VolGroup00-vguest1--disk0'/>
      <target dev='vda' bus='virtio'/>
    </disk>

Comment 1 James Laska 2009-03-19 14:33:16 UTC
Created attachment 335858 [details]
Screenshot (shows IDE, SCSI and VirtIO disks)

Attached screenshot shows an install with 3 disks (IDE, SCSI and VirtIO).  Seems like just the virtio disks showing up as UNKNOWN

Comment 2 James Laska 2009-03-19 14:34:02 UTC
The virt host is F10 and included the following packages:
 * kvm-74-10.fc10.x86_64
 * virt-manager-0.6.0-5.fc10.x86_64
 * libvirt-0.5.1-2.fc10.x86_64
 * kernel-2.6.27.19-170.2.35.fc10.x86_64

Comment 3 Glauber Costa 2009-03-20 16:16:12 UTC
Verified this...

QEMU does not get involved.
Anaconda gets this information from sysfs.
virtio devices does not export model information to sysfs.
So this is a kernel problem.

Whenever I get some cycles, I plan on implementing it.
We can leave this bug as-is, to keep track of it.

Comment 4 Mark McLoughlin 2009-03-25 12:43:30 UTC
Looks like these strings are coming from parted

The way it works for Xen is:

        } else if (dev_major == XVD_MAJOR && (dev_minor % 0x10 == 0)) {
                dev->type = PED_DEVICE_XVD;
...
        case PED_DEVICE_XVD:
                if (!init_generic (dev, _("Xen Virtual Block Device")))
                        goto error_free_arch_specific;
                break;
...
        char*           transport[14] = {...
                                         "xvd"};

See e.g.

http://git.debian.org/?p=parted/parted.git;a=blob;f=libparted/arch/linux.c;h=6e47107610c67c787108a865fba9291b3632febc;hb=HEAD#l560

Moving to parted

Comment 5 Mark McLoughlin 2009-03-26 10:39:55 UTC
Just chatting to jgranado on irc - virtio_blk doesn't have an assigned major:

  major = register_blkdev(0, "virtblk");

Comment 6 Joel Andres Granados 2009-03-26 12:58:25 UTC
Only thing I could come up with that would be rather consistent is to use /sys/block/vda/device/modalias and grep for virtio.

any suggestions?

Comment 7 Joel Andres Granados 2009-03-26 13:06:07 UTC
OTOH /proc/devices and grep for virtblk is probably better.  that is what is currently done with device-mapper devs.

Comment 8 Joel Andres Granados 2009-03-26 14:58:17 UTC
this will be fixed in the next version of parted 1.8.8-15.

Comment 9 Joel Andres Granados 2009-03-26 15:00:04 UTC
parted 1.8.8-16 is the next. sorry.

Comment 10 Mark McLoughlin 2009-03-26 15:56:04 UTC
Cool, you went with the /proc/devices option - thanks.

For reference, patch is this one:

http://cvs.fedoraproject.org/viewvc/rpms/parted/devel/parted-1.8.8-virtio.patch?revision=1.1&view=markup

Comment 11 Jim Meyering 2009-03-26 16:15:12 UTC
Hi Joel,
Thanks for doing that.  Patch looks perfect.
If you post upstream, I'll ack/apply it.  Bonus points if you can write or outline a test to exercise either part of the new code ;-)