Bug 733023

Summary: info qtree can't show the drive name of usb-storage
Product: Red Hat Enterprise Linux 6 Reporter: Chao Yang <chayang>
Component: qemu-kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 6.2CC: chayang, juzhang, michen, mkenneth, qzhou, shuang, tburke, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-09-12 07:55:09 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:

Description Chao Yang 2011-08-24 13:30:55 UTC
Description of problem:
Boot a guest with usb-storage, and specify device drive in cli, say "-drive file=/home/image/usb-storage.qcow2,if=none,id=drive-usb-0-0,media=disk, ..."
, then info qtree in monitor

Version-Release number of selected component (if applicable):
# rpm -q qemu-kvm
qemu-kvm-0.12.1.2-2.184.el6.x86_64
# uname -r
2.6.32-191.el6.x86_64


How reproducible:
100%

Steps to Reproduce:
1.
2.
3.
  
Actual results:
(qemu) info qtree 
  dev: usb-storage, id "usb-0-0"
            dev-prop: drive = <null>  <------------ note here
            dev-prop: logical_block_size = 512
            dev-prop: physical_block_size = 512
            dev-prop: min_io_size = 0
            dev-prop: opt_io_size = 0
            dev-prop: bootindex = -1
            dev-prop: discard_granularity = 0
            dev-prop: serial = <null>
            dev-prop: removable = on
            bus-prop: port = "1"
            addr 1.1, port 1, speed 480, name QEMU USB MSD, attached


Expected results:

Better output info like:
dev: virtio-blk-pci, id "virt0-0-0"
        dev-prop: class = 0x100
        dev-prop: drive = drive-virtio-0-0 <---------it outputs drive name here
        dev-prop: logical_block_size = 512
        dev-prop: physical_block_size = 512
        dev-prop: min_io_size = 0
        dev-prop: opt_io_size = 0
        dev-prop: bootindex = 1
        dev-prop: discard_granularity = 0
        dev-prop: ioeventfd = on
        dev-prop: vectors = 2
        dev-prop: indirect_desc = on
        dev-prop: event_idx = on
        dev-prop: scsi = on
        bus-prop: addr = 03.0
        bus-prop: romfile = <null>
        bus-prop: rombar = 1
        bus-prop: multifunction = off


Additional info:

CLI:
# /usr/libexec/qemu-kvm -M rhel6.2.0 -enable-kvm -m 4096 -smp 4,sockets=1,cores=4,threads=1 -name RHEL6.1_32 ... -boot order=dc,menu=on -drive file=/home/RHEL6.1-32-copy.qcow2,if=none,id=drive-virtio-0-0,media=disk,format=qcow2,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,drive=drive-virtio-0-0,id=virt0-0-0,bootindex=1 -usb -device usb-tablet,id=input1,bus=usb.0,port=1 -device usb-ehci,id=ehci -device usb-storage,drive=drive-usb-0-0,id=usb-0-0,removable=on,bus=ehci.0,port=1 -drive file=/home/image/usb-storage.qcow2,if=none,id=drive-usb-0-0,media=disk,format=qcow2,cache=none,werror=stop,rerror=stop,aio=native

Comment 2 Gerd Hoffmann 2011-09-12 07:55:09 UTC
It is there, but you have to check the scsi disk connected to the scsi bus liked to usb-storage.

          dev: usb-storage, id "ehci1-stick"
            dev-prop: drive = <null>
            dev-prop: logical_block_size = 512
            dev-prop: physical_block_size = 512
            dev-prop: min_io_size = 0
            dev-prop: opt_io_size = 0
            dev-prop: bootindex = -1
            dev-prop: discard_granularity = 0
            dev-prop: serial = "usb-12345"
            dev-prop: removable = on
            bus-prop: port = "1"
            addr 1.1, port 1, speed 480, name QEMU USB MSD, attached
            bus: ehci1-stick.0
              type SCSI
              dev: scsi-disk, id ""
                dev-prop: drive = usbstick           <== LOOK HERE
                dev-prop: logical_block_size = 512
                dev-prop: physical_block_size = 512
                dev-prop: min_io_size = 0
                dev-prop: opt_io_size = 0
                dev-prop: bootindex = -1
                dev-prop: discard_granularity = 0
                dev-prop: ver = "0.15.50"
                dev-prop: serial = <null>
                dev-prop: removable = on
                bus-prop: scsi-id = 0
                bus-prop: lun = 0