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 1259229 - drive-mirror blocks QEMU due to lseek64() on raw image files
Summary: drive-mirror blocks QEMU due to lseek64() on raw image files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Fam Zheng
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 1249883 1263046 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-02 09:08 UTC by Stefan Hajnoczi
Modified: 2015-12-04 16:55 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-rhev-2.3.0-23.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-04 16:55:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2546 0 normal SHIPPED_LIVE qemu-kvm-rhev bug fix and enhancement update 2015-12-04 21:11:56 UTC

Description Stefan Hajnoczi 2015-09-02 09:08:00 UTC
Description of problem:

I thought Fam had backported fixes to qemu-kvm-rhev 7.2 but I just hit the following problem with qemu-kvm-rhev-2.3.0-21.el7.

The drive-mirror block job checks which sectors are allocated in the source image before starting copy iterations.  Unfortunately the allocation checking is performed in blocking fashion so QEMU and the monitor hang until the entire image has been checked.

How reproducible:
100%

Steps to Reproduce:
Prerequisites: raw image file on ext4

1. x86_64-softmmu/qemu-system-x86_64 -enable-kvm -drive if=none,id=drive0,file=test.img,format=raw,cache=none
2. (qemu) drive_mirror drive0 /var/tmp/foo.img 

Actual results:

QEMU is blocked and the monitor hangs

Expected results:

QEMU should be responsive and the monitor should work while the drive-mirror block job is running.

Comment 4 Fam Zheng 2015-09-07 09:17:44 UTC
*** Bug 1249883 has been marked as a duplicate of this bug. ***

Comment 5 Miroslav Rezanina 2015-09-15 10:50:54 UTC
Fix included in qemu-kvm-rhev-2.3.0-23.el7

Comment 6 Pei Zhang 2015-09-16 03:01:38 UTC
Summary: When I tested with qemu-kvm-rhev-2.3.0-21.el7.x86_64, the qemu is responsive, qmp monitor works well, just guest hang. Then I also tried lower version, qemu-kvm-rhev-2.3.0-12.el7.x86_64, and this bug is reproduced.
I verified this bug with qemu-kvm-rhev-2.3.0-23.el7, the results below can prove that this bug has been fixed well.


Reproduced:
1 guest hang, qemu works well
Host:
Kernel:3.10.0-315.el7.x86_64
qemu-kvm-rhev:qemu-kvm-rhev-2.3.0-21.el7.x86_64

Steps:
1.1 boot guest
/usr/libexec/qemu-kvm -name rhel6.7z -machine pc-i440fx-rhel7.2.0,accel=kvm \
-cpu SandyBridge -m 4G,slots=256,maxmem=40G -numa node \
-smp 4,sockets=2,cores=2,threads=1 \
-uuid 82b1a01e-5f6c-4f5f-8d27-3855a74e6b61 \
-netdev tap,id=hostnet0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=12:54:00:5c:88:61 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16 \
-vnc 0.0.0.0:1 \
-monitor stdio \
-qmp tcp:0:5555,server,nowait \
-serial unix:/tmp/monitor,server,nowait \
-drive file=/mnt/disk4/rhel6.7_virtio.raw,format=raw,if=none,id=drive-virtio-blk0,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-blk0,id=virtio-blk0 \

1.2 do drive-mirror, guest hang.
QEMU 2.3.0 monitor - type 'help' for more information
(qemu) drive_mirror drive-virtio-blk0 /mnt/disk4/mirror.raw
Formatting '/mnt/disk4/mirror.raw', fmt=raw size=21474836480
(qemu) 
(qemu) 
(qemu) 
(qemu) 
(qemu) info status
VM status: running
(qemu) 
(qemu) 
(qemu) 
(qemu) info status
VM status: running
(qemu)

1.3 query mirror job, no data is written to the target image.
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": []}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"io-status": "ok", "device": "drive-virtio-blk0", "busy": false, "len": 0, "offset": 0, "paused": false, "speed": 0, "ready": false, "type": "mirror"}]}
{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"io-status": "ok", "device": "drive-virtio-blk0", "busy": false, "len": 0, "offset": 0, "paused": false, "speed": 0, "ready": false, "type": "mirror"}]}


2 guest hang, qemu hang
Host:
Kernel:3.10.0-315.el7.x86_64
qemu-kvm-rhev:qemu-kvm-rhev-2.3.0-12.el7.x86_64

Steps:
2.1 boot guest
Same command with step 1.1 

2.2 do drive-mirror, qemu hang. And guest hang.
(qemu) drive_mirror drive-virtio-blk0 /mnt/disk4/mirror.raw
Formatting '/mnt/disk4/mirror.raw', fmt=raw size=21474836480

2.3 query mirror job, qmp not return, qmp monitor hang.
{ "execute" : "query-block-jobs", "arguments" : {} }



Verified:
Host:
Kernel:3.10.0-315.el7.x86_64
qemu-kvm-rhev:qemu-kvm-rhev-2.3.0-23.el7.x86_64

Prerequisites: 
raw image file on ext4.

Steps:
1. boot guest
# /usr/libexec/qemu-kvm -name rhel6.7z -machine pc-i440fx-rhel7.2.0,accel=kvm \
-cpu SandyBridge -m 4G,slots=256,maxmem=40G -numa node \
-smp 4,sockets=2,cores=2,threads=1 \
-uuid 82b1a01e-5f6c-4f5f-8d27-3855a74e6b61 \
-netdev tap,id=hostnet0 \
-device virtio-net-pci,netdev=hostnet0,id=net0,mac=12:54:00:5c:88:61 \
-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16 \
-vnc 0.0.0.0:1 \
-monitor stdio \
-qmp tcp:0:5555,server,nowait \
-serial unix:/tmp/monitor,server,nowait \
-drive file=/mnt/disk4/rhel6.7_virtio.raw,format=raw,if=none,id=drive-virtio-blk0,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-blk0,id=virtio-blk0 \

2. drive-mirror
(1) drive-mirror in qemu monitor, and query mirror job
(qemu) drive_mirror drive-virtio-blk0 /mnt/disk4/mirror.raw
Formatting '/mnt/disk4/mirror.raw', fmt=raw size=21474836480

{ "execute" : "query-block-jobs", "arguments" : {} }
{"return": [{"io-status": "ok", "device": "drive-virtio-blk0", "busy": true, "len": 21474967552, "offset": 11681136640, "paused": false, "speed": 0, "ready": false, "type": "mirror"}]}

{"timestamp": {"seconds": 1442368656, "microseconds": 681306}, "event": "BLOCK_JOB_READY", "data": {"device": "drive-virtio-blk0", "len": 21475360768, "offset": 21475360768, "speed": 0, "type": "mirror"}}

(2)reopen 
{"execute": "block-job-complete", "arguments": { "device": "drive-virtio-blk0"} }
{"return": {}}
{"timestamp": {"seconds": 1442368751, "microseconds": 886669}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "drive-virtio-blk0", "len": 21477588992, "offset": 21477588992, "speed": 0, "type": "mirror"}}

(qemu) info block
drive-virtio-blk0: /mnt/disk4/mirror.raw (raw)
    Cache mode:       writeback
...

3. qemu and guest both work well. After reboot guest sever times, they still work well.


I also tried xfs, it works well. So this bug is fixed.

Comment 7 Fam Zheng 2015-09-17 06:46:50 UTC
*** Bug 1263046 has been marked as a duplicate of this bug. ***

Comment 8 juzhang 2015-09-18 01:25:32 UTC
According to comment6, set this issue as verified.

Comment 10 errata-xmlrpc 2015-12-04 16:55:11 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


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