Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1030301

Summary: qemu-img can not merge live snapshot to backing file(r/w backing file via libiscsi)
Product: Red Hat Enterprise Linux 7 Reporter: Jun Li <juli>
Component: qemu-kvmAssignee: Jeff Cody <jcody>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, areis, famz, hhuang, huding, jcody, juzhang, michen, pbonzini, shu, sluo, tpoitras, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-44.el7 Doc Type: Bug Fix
Doc Text:
Previously, when using libiscsi storage as the base image (backing file), qemu-img was not able to merge live snapshots to the backing file. Now, the issue has been fixed and live snapshots can be merged.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 12:10:30 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1080820    

Description Jun Li 2013-11-14 10:18:38 UTC
Description of problem:
using libiscsi storage as base image(backing file), qemu-img can not merge live snapshot to backing file.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-1.5.3-19.el7.x86_64
3.10.0-48.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest with following cli.
<cli>:
# /usr/libexec/qemu-kvm -S -M pc-i440fx-rhel7.0.0 -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1 -name juli -uuid 355a2475-4e03-4cdd-bf7b-5d6a59edaa68 -rtc base=localtime,clock=host,driftfix=slew \
-device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -drive file=iscsi://10.66.6.82:3260/iqn.2013-11.com.example:storage.disk1.juli.xyz/1,if=none,id=drive-scsi0-0-0,media=disk,cache=none,format=qcow2,werror=stop,rerror=stop,aio=native  -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=juli,bootindex=0 \
-drive file=iscsi://10.66.6.82:3260/iqn.2013-11.com.example:storage.disk1.juli.xyz/3,if=none,id=drive-virtio0-0-0,media=disk,werror=stop,rerror=stop,cache=none,format=qcow2 -device virtio-blk-pci,bus=pci.0,drive=drive-virtio0-0-0,id=virtio0-0-0 \
-drive file=/home/ISO/en_windows_8.1_preview_x86_dvd_2358833.iso,if=none,media=cdrom,format=raw,aio=native,id=drive-ide1-0-0 -device ide-drive,drive=drive-ide1-0-0,id=ide1-0-0,bus=ide.0,unit=0,bootindex=4 \
-device virtio-balloon-pci,id=ballooning \
-global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 \
-net none -k en-us -boot menu=on,reboot-timeout=-1,strict=on \
-qmp tcp:0:4477,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :3 -spice port=5939,disable-ticketing  -vga qxl -global qxl-vga.revision=3 -monitor stdio -monitor tcp:0:7777,server,nowait -monitor unix:/tmp/monitor1,server,nowait \
-netdev tap,id=tap1,vhost=on,queues=4,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown,ifname=tap-juli -device virtio-net-pci,netdev=tap1,id=nic1,mq=on,vectors=17,mac=1a:59:0a:4b:aa:94
2.Create live snapshot after guest log in
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S1.img
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S2.img
3.shutdown guest.
4.commit S1 to base image.
# qemu-img commit -f qcow2 /home/S1.img 

Actual results:
# qemu-img commit -f qcow2 /home/S1.img 
qemu-img: Image is read-only

Expected results:
After step 4, commit S1 to base image is successful.

Additional info:
Also test "Live commit with iSCSI", it works well.

After step 2, do "block-commit" via qmp as followings:
{ "execute": "block-commit", "arguments": { "device": "drive-scsi0-0-0", "base": "iscsi://10.66.6.82:3260/iqn.2013-11.com.example:storage.disk1.juli.xyz/1", "top": "/home/S1.img", "speed": 1000000000 } }
{"return": {}}
{"timestamp": {"seconds": 1384424071, "microseconds": 403388}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "drive-scsi0-0-0", "len": 32212254720, "offset": 32212254720, "speed": 1000000000, "type": "commit"}}

Comment 2 Paolo Bonzini 2013-11-19 10:57:59 UTC
*** Bug 1032001 has been marked as a duplicate of this bug. ***

Comment 3 Paolo Bonzini 2013-11-22 14:31:23 UTC
Probably just a missing bdrv_reopen implementation.  Jeff, please write here if there's anything else and you'd like me to take a look.

Comment 4 Jeff Cody 2013-11-27 21:20:08 UTC
(In reply to Paolo Bonzini from comment #3)
> Probably just a missing bdrv_reopen implementation.  Jeff, please write here
> if there's anything else and you'd like me to take a look.

I think you are right, and I believe this is the same root cause as BZ 1031526.  I'll look at putting together a reopen implementation for gluster.

Comment 5 Jeff Cody 2014-01-27 23:12:19 UTC
patch posted.

Comment 6 Miroslav Rezanina 2014-01-29 07:01:55 UTC
Fix included in qemu-kvm-1.5.3-44.el7

Comment 8 huiqingding 2014-02-11 03:25:30 UTC
Reproduce this bug using the following version:
qemu-kvm-rhev-1.5.3-43.el7.x86_64
kernel-3.10.0-84.el7.x86_64

Steps to Reproduce:
1.boot guest with following cli.
# /usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1 -name juli -uuid 355a2475-4e03-4cdd-bf7b-5d6a59edaa68 -rtc base=localtime,clock=host,driftfix=slew -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -drive file=iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-6aa1f7d03-60ff49b423b52f87-s2-huding-277437-1/0,if=none,id=drive-scsi0-0-0,media=disk,format=raw,werror=stop,rerror=stop,aio=native  -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=juli,bootindex=1 -device virtio-balloon-pci,id=ballooning -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -net none -k en-us -boot menu=on,reboot-timeout=-1,strict=on -qmp tcp:0:4477,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :3 -spice port=5939,disable-ticketing  -vga qxl -global qxl-vga.revision=3 -monitor stdio -monitor tcp:0:7777,server,nowait -monitor unix:/tmp/monitor1,server,nowait -netdev tap,id=tap1,vhost=on,queues=4,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown,ifname=tap-juli -device virtio-net-pci,netdev=tap1,id=nic1,mq=on,vectors=17,mac=1a:59:0a:4b:aa:94
2.Create live snapshot after guest log in
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S1.img
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S2.img
3.shutdown guest.
4.commit S1 to base image.
# qemu-img commit -f qcow2 /home/S1.img 

Actual results:
# qemu-img commit -f qcow2 /home/S1.img 
qemu-img: Image is read-only

Verify this bug using the following version:
qemu-kvm-rhev-1.5.3-45.el7.x86_64
kernel-3.10.0-84.el7.x86_64

Steps to Verification:
1.boot guest with following cli.
# /usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1 -name juli -uuid 355a2475-4e03-4cdd-bf7b-5d6a59edaa68 -rtc base=localtime,clock=host,driftfix=slew -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -drive file=iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-6aa1f7d03-60ff49b423b52f87-s2-huding-277437-1/0,if=none,id=drive-scsi0-0-0,media=disk,format=raw,werror=stop,rerror=stop,aio=native  -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=juli,bootindex=1 -device virtio-balloon-pci,id=ballooning -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -net none -k en-us -boot menu=on,reboot-timeout=-1,strict=on -qmp tcp:0:4477,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :3 -spice port=5939,disable-ticketing  -vga qxl -global qxl-vga.revision=3 -monitor stdio -monitor tcp:0:7777,server,nowait -monitor unix:/tmp/monitor1,server,nowait -netdev tap,id=tap1,vhost=on,queues=4,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown,ifname=tap-juli -device virtio-net-pci,netdev=tap1,id=nic1,mq=on,vectors=17,mac=1a:59:0a:4b:aa:94
2.Create live snapshot after guest log in
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S1.img
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S2.img
3.shutdown guest.
4.commit S1 to base image.
# qemu-img commit -f qcow2 /home/S1.img 

Actual results:
# qemu-img commit -f qcow2 /home/S1.img 
Image committed.

Based on the above result, I think this bug has been fixed.

Comment 11 Ludek Smid 2014-06-13 12:10:30 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.