Bug 1002012

Summary: QMP BLOCK_IO_ERROR event after offline migration from scsi=on to scsi=off
Product: Red Hat Enterprise Linux 7 Reporter: Jun Li <juli>
Component: qemu-kvmAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED WORKSFORME QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, hhuang, juli, juzhang, michen, qzhang, sluo, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-17 14:51:29 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:

Description Jun Li 2013-08-28 10:39:45 UTC
Description of problem:
On src host, do migration with scsi=on. After migration boot guest with scsi=off on dst host, QMP will print BLOCK_IO_ERROR event. At the same time, can not use mouse inside guest.

Version-Release number of selected component (if applicable):
win8-64
qemu-kvm-1.5.2-4.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.On src host, boot guest with scsi=off and do migration.
# /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-5d6a59edaa61 -rtc base=localtime,clock=host,driftfix=slew -drive file=/home/win8-64.raw,if=none,cache=none,aio=native,format=raw,id=drive0 -device virtio-blk-pci,bus=pci.0,drive=drive0,scsi=on,bootindex=0 -netdev tap,id=hostnet0,vhost=off,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=24:be:05:14:0d:52,bootindex=1 -k en-us -boot menu=on -qmp tcp:0:4445,server,nowait -vnc :1 -monitor stdio

(QMP)  { "execute": "stop"}
(qemu)  migrate "exec:cat > saved_image_win8_64"
(QMP)  {"execute": "query-migrate"}
                Migration status: completed
(QMP) {"execute": "quit"}

2.On dst host, boot guest with scsi=off.
# /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-5d6a59edaa61 -rtc base=localtime,clock=host,driftfix=slew -drive file=/root/saved_image_win8_64,if=none,cache=none,aio=native,format=raw,id=drive0 -device virtio-blk-pci,bus=pci.0,drive=drive0,scsi=off,config-wce=off,bootindex=0 -netdev tap,id=hostnet0,vhost=off,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=24:be:05:14:0d:52,bootindex=1 -k en-us -boot menu=on -qmp tcp:0:4445,server,nowait -vnc :1 -monitor stdio  -incoming "exec:cat saved_image_win8_64"

3. Check the mouse in guest and output of QMP. 

Actual results:
Can not use mouse inside guest.
QMP outputs:
{"timestamp": {"seconds": 1377679844, "microseconds": 390919}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 391251}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 391615}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 391994}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 640932}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 765953}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 766330}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 766689}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 767059}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 767401}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 767743}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 768068}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 768280}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 859688}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 860114}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 953413}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "write", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 984663}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
{"timestamp": {"seconds": 1377679844, "microseconds": 984959}, "event": "BLOCK_IO_ERROR", "data": {"device": "drive0", "operation": "read", "action": "report"}}
: "report"}}
........


Expected results:
The mouse can use as normal inside guest.
qmp output as normal.

Additional info:
For rhel7 guest. qemu-kvm quit directly when booting guest with commmand line above.  I amn't sure if it is a new issue.  Do I need to file a new bug to track it for RHEL7 guest.


QEMU 1.5.2 monitor - type 'help' for more information
(qemu) qemu-kvm: Features 0x30000ed4 unsupported. All
qemu: warning: error while loading state for instance 0x0 of device '0000:00:03.0/virtio-blk'
load of migration failed

Comment 3 Ademar Reis 2014-06-16 21:56:00 UTC
Let me try to clarify, since there's some contradiction in the bug description:

You're

 - Booting src with scsi=on
 - Booting dst with scsi=off
 - migrating from src to dst

Looks like a regression from 800536, fixed by Paolo back in 2012 on RHEL6 and upstream:

RHEL6:

commit 55e1449419ead75ba6cdd482a4f340bdaf41a73a
Author: Paolo Bonzini <pbonzini>
Date:   Tue Mar 13 15:39:10 2012 +0100

    force-enable VIRTIO_BLK_F_SCSI if present on migration source
[...]


Upstream:

commit a6c5c84ae25bc68f22725f77d6d77c98af5c4f9e
Author: Paolo Bonzini <pbonzini>
Date:   Wed May 16 12:54:06 2012 +0200

    virtio-blk: always enable VIRTIO_BLK_F_SCSI
[...]


Jun Li: Please validate my observation above and test it on RHEL6.6. Thanks.

Comment 4 Jun Li 2014-06-17 03:28:18 UTC
Retest this issue with following version of components:

2.6.32-477.el6.x86_64
qemu-kvm-0.12.1.2-2.427.el6.x86_64

Steps as comment #0, after step 3, all works well, no any error.

==================================
Also retest with rhel 7 host.

Components version:
qemu-kvm-rhev-1.5.3-60.el7ev_0.2.x86_64
3.10.0-123.el7.x86_64

cli:
src:
---
# /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-5d6a59edaa61 -rtc base=localtime,clock=host,driftfix=slew -drive file=/home/win8-64-virtio.raw,if=none,cache=none,aio=native,format=raw,id=drive0 -device virtio-blk-pci,bus=pci.0,drive=drive0,scsi=on,bootindex=0 -k en-us -boot menu=on -qmp tcp:0:4445,server,nowait -vnc :1 -monitor stdio
dst:
---
# /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-5d6a59edaa61 -rtc base=localtime,clock=host,driftfix=slew -drive file=/home/win8-64-virtio.raw,if=none,cache=none,aio=native,format=raw,id=drive0 -device virtio-blk-pci,bus=pci.0,drive=drive0,scsi=off,bootindex=0 -k en-us -boot menu=on -qmp tcp:0:4445,server,nowait -vnc :1 -monitor stdio -incoming "exec:cat saved_image_win8_64"

Steps as comment #0, after step 3, guest and qemu-kvm works, no any error. Can not reproduce this bz currently.


As above testing, any issue, free to update it in the bz. 


Best Regards,
Jun Li

Comment 5 Ademar Reis 2014-06-17 14:51:29 UTC
OK, closing then. Thanks for the update.