Bug 593544 - The default value of "if" in -drive should set to be "none"
The default value of "if" in -drive should set to be "none"
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Gerd Hoffmann
Virtualization Bugs
:
Depends On:
Blocks: 580953
  Show dependency treegraph
 
Reported: 2010-05-19 01:37 EDT by Mike Cao
Modified: 2013-01-09 17:35 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-05-25 11:34:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike Cao 2010-05-19 01:37:19 EDT
Description of problem:

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

How reproducible:
100%

Steps to Reproduce:
1.start a vm with virtio blocks and without "if" param in -drive by using:
 /usr/libexec/qemu-kvm -rtc-td-hack -no-hpet -usbdevice tablet -drive file=/RHEL-Server-6.0-64-virtio.raw,media=disk,cache=none,id=test -device virtio-blk-pci,drive=test,physical_block_size=1024,min_io_size=2048,opt_io_size=4096 -net nic,macaddr=20:10:43:23:33:42,model=e1000,vlan=0 -net tap,script=/etc/qemu-ifup,vlan=0 -uuid `uuidgen` -vnc :6 -boot dc -cpu qemu64,+sse2 -smp 2 -m 2G -balloon none -startdate now
2.check disk by using "fdisk -l"
3.start a vm with virtio blocks and without "if" param in -drive by using:
/usr/libexec/qemu-kvm -rtc-td-hack -no-hpet -usbdevice tablet -drive file=/RHEL-Server-6.0-64.raw,media=disk,cache=none,id=test -device ide-block,drive=test,physical_block_size=1024,min_io_size=2048,opt_io_size=4096 -net nic,macaddr=20:10:43:23:33:42,model=e1000,vlan=0 -net tap,script=/etc/qemu-ifup,vlan=0 -uuid `uuidgen` -vnc :6 -boot dc -cpu qemu64,+sse2 -smp 2 -m 2G -balloon none -startdate now
4 check disk by using "fdisk -l"
  
Actual results:
after step2, It shows 2 disks info ,/dev/vda and /dev/sda
after step3, It shows 2 disks info ,/dev/sda and /dev/sdb

Expected results:
After step2, It shows only 1 disk info:/dev/vda
After step4, It shows only 1 disk info:/dev/sda

Additional info:
start a vm with "if=none‘ in -drive:
/usr/libexec/qemu-kvm -rtc-td-hack -no-hpet -usbdevice tablet -drive file=/RHEL-Server-6.0-64-virtio.raw,if=none, media=disk,cache=none,id=test -device virtio-blk-pci,drive=test,physical_block_size=1024,min_io_size=2048,opt_io_size=4096 -net nic,macaddr=20:10:43:23:33:42,model=e1000,vlan=0 -net tap,script=/etc/qemu-ifup,vlan=0 -uuid `uuidgen` -vnc :6 -boot dc -cpu qemu64,+sse2 -smp 2 -m 2G -balloon none -startdate now

In the guest can only find 1 disk info:/dev/vda.and it should be this.

I think the resason is there're 2 parts can decide blocks type,the one is the value of "if" in -drive,the other is -device's first parameter,when using -drive ,We should always set 'if=none' in -drive .Since now the default value of "if" is "ide",I think change it "none" may be better.
Comment 2 Gerd Hoffmann 2010-05-25 11:34:26 EDT
if=ide is the default for historical reasons and this will most likely
not be changed upstream to maintain backward compatibility with older
versions.  It can be a bit annoying at times but this doesn't justify
diverging from upstream here.

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