Bug 1006651

Summary: qemu should give a more friendly prompt when didn't specify read-only for VHDX format disk
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvm-rhevAssignee: Jeff Cody <jcody>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: chayang, hhuang, jcody, juzhang, kwolf, michen, mkenneth, mrezanin, pezhang, qzhang, rbalakri, rpacheco, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu 2.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1006650 Environment:
Last Closed: 2015-12-04 16:13:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 879234, 1006650    
Bug Blocks:    

Comment 1 juzhang 2013-09-11 03:21:17 UTC
Hi Sluo,

Paste your RHEL7.0 host and qemu-kvm infos in the bz.

Comment 2 Sibiao Luo 2013-09-11 03:47:04 UTC
host info:
3.10.0-18.el7.x86_64
qemu-kvm-1.5.3-2.el7.x86_64

e.g:....-drive file=/mnt/sluo-win2012-64bit.vhdx,if=none,format=vhdx,id=drive-data-disk,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x7,drive=drive-data-disk,id=data-disk
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
qemu-kvm: -drive file=/mnt/sluo-win2012-64bit.vhdx,if=none,format=vhdx,id=drive-data-disk,cache=none,werror=stop,rerror=stop: 'vhdx' invalid format
/etc/qemu-ifdown: could not launch network script

Best Regards,
sluo

Comment 4 Sibiao Luo 2014-03-04 06:08:31 UTC
Retried the latest qemu-kvm-rhev-1.5.3-50.el7.x86_64 version that still hit the same issue which did not fix at all.
QEMU will quit and give a more friendly prompt message for users without read-only specified, like: "'vhdx' can be only used as read-only device".

host info:
# uname -r && rpm -q qemu-kvm-rhev
3.10.0-95.el7.x86_64
qemu-kvm-rhev-1.5.3-50.el7.x86_64

e.g:# /usr/libexec/qemu-kvm -M pc...-drive file=/home/my-vhdx-disk.vhdx,if=none,format=vhdx,id=drive-data-disk,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x7,drive=drive-data-disk,id=data-disk
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
qemu-kvm: -drive file=/home/my-vhdx-disk.vhdx,if=none,format=vhdx,id=drive-data-disk,cache=none,werror=stop,rerror=stop: 'vhdx' invalid format

Base on above, re-assign it.

Best Regards,
sluo

Comment 7 Jeff Cody 2014-07-22 18:57:18 UTC
This is fixed in upstream qemu 2.1 in commit 8f94a6e4, which is a (relatively) clean backport for 7.1.

Comment 8 juzhang 2014-07-24 01:44:16 UTC
(In reply to Jeff Cody from comment #7)
> This is fixed in upstream qemu 2.1 in commit 8f94a6e4, which is a
> (relatively) clean backport for 7.1.

Since this bz is fixed in qemu2.1, seems we need to update the bz's component to qemu-kvm-rhev.

Best Regards,
Junyi

Comment 15 Pei Zhang 2015-08-05 00:51:19 UTC
Summary:
I retested this bug, and the actual results below prove that this bug has been fixed.

Details:

Versions:
Host:
Kernel:3.10.0-302.el7.x86_64
qemu-kvm-rhev:qemu-kvm-rhev-2.3.0-14.el7.x86_64

Actual results:
# /usr/libexec/qemu-kvm -name test1 -machine  pc-i440fx-rhel7.2.0,accel=kvm,usb=off -cpu SandyBridge -m 2048M -smp 4,sockets=2,cores=2,threads=1 -uuid 82b1a01e-5f6c-4f5f-8d27-3855a74e6b6b  -drive file=/home/win2012r2.qcow2,if=none,id=drive-virtio-blk-0,format=qcow2 -device virtio-blk-pci,drive=drive-virtio-blk-0,bootindex=2,id=virtio-blk01 -netdev tap,id=hostnet0 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=12:54:00:4c:88:6d -spice port=5900,addr=0.0.0.0,disable-ticketing,image-compression=off,seamless-migration=on -monitor stdio  -drive file=disk1.vhdx,if=none,format=vhdx,id=drive-data-disk,cache=none,werror=stop,rerror=stop -device virtio-blk-pci,bus=pci.0,addr=0x7,drive=drive-data-disk,id=data-disk
qemu-kvm: -drive file=disk1.vhdx,if=none,format=vhdx,id=drive-data-disk,cache=none,werror=stop,rerror=stop: Driver 'vhdx' can only be used for read-only devices

Comment 16 juzhang 2015-08-10 05:47:09 UTC
According to comment15, set this issue as verified.

Comment 18 errata-xmlrpc 2015-12-04 16:13:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2546.html