Bug 894253 - Missing error message in bdrv_commit to read-only backing file
Missing error message in bdrv_commit to read-only backing file
Status: CLOSED UPSTREAM
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Jeff Cody
Virtualization Bugs
:
: 894250 894251 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-11 03:19 EST by Sibiao Luo
Modified: 2013-08-27 17:41 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 856505
Environment:
Last Closed: 2013-08-27 17:41:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Comment 1 Sibiao Luo 2013-01-11 03:25:07 EST
host info:
# uname -r && rpm -q qemu-kvm
3.6.0-0.29.el7.x86_64
qemu-kvm-1.3.0-3.el7.x86_64
guest info
# uname -r
3.6.0-0.29.el7.x86_64

Steps:
1. boot up guest with a readonly=on data image with snapshot=on.
e.g:...-drive file=/home/my-data-disk.qcow2,if=none,format=qcow2,id=drive-virtio0-0-0,media=disk,cache=none,readonly=on,snapshot=on -device virtio-blk-pci,bus=pci.0,addr=0x8,drive=drive-virtio0-0-0,id=virtio0-0-0
2. dd a file in the guest to the data disk.
3. do commit in monitor.
(qemu) info block
drive-system-disk: removable=0 io-status=ok file=/home/RHEL-7-Server-x86_64.qcow2 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
drive-virtio0-0-0: removable=0 io-status=ok file=/tmp/vl.jpdcow backing_file=/home/my-data-disk.qcow2 backing_file_depth=1 ro=0 drv=qcow2 encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
ide1-cd0: removable=1 locked=0 tray-open=0 io-status=ok [not inserted]
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]
(qemu) ? commit 
commit device|all -- commit changes to the disk images (if -snapshot is used) or backing files
(qemu) commit drive-virtio0-0-0

Expected result:
should fail to commit to a read-only disk with an error message prompts mentioned that backing image is read-only.
Comment 2 Sibiao Luo 2013-01-11 03:32:52 EST
(In reply to comment #1)
> 
> Expected result:
> should fail to commit to a read-only disk with an error message prompts
> mentioned that backing image is read-only.

check the data disk size and modify time in host, but there is no any changes before and after commit.
- before step 1:
# ls -l /home/my-data-disk.qcow2
-rw-r--r--. 1 root root 8725790720 Jan 10 11:09 /home/my-data-disk.qcow2
- after step 3:
# ls -l /home/my-data-disk.qcow2
-rw-r--r--. 1 root root 8725790720 Jan 10 11:09 /home/my-data-disk.qcow2
Comment 3 Sibiao Luo 2013-01-11 04:51:00 EST
*** Bug 894251 has been marked as a duplicate of this bug. ***
Comment 4 Sibiao Luo 2013-01-11 04:51:20 EST
*** Bug 894250 has been marked as a duplicate of this bug. ***
Comment 5 Jeff Cody 2013-01-15 17:32:31 EST
For completeness, from BZ #856505:

In bdrv_commit(), we are (appropriately) refusing to write to the backing file (in this case, the top-level snapshot, as the active layer is a temp image).  The function bdrv_reopen() returns an error, and bdrv_commit() returns -EACCES.

However, do_commit(), which is the message handler that calls bdrv_commit(), only checks for -EBUSY when it comes to returning an error message.
Comment 6 Jeff Cody 2013-01-18 14:40:03 EST
Patch submitted upstream:
https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg03456.html

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