Bug 1086598

Summary: migrate_cancel wont take effect on previouly wrong migrate -d cmd
Product: Red Hat Enterprise Linux 7 Reporter: Xiaoqing Wei <xwei>
Component: qemu-kvmAssignee: Amit Shah <amit.shah>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: amit.shah, huding, juzhang, knoel, lcapitulino, michen, qzhang, rbalakri, shuang, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-1.5.3-66.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 08:05:42 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 Xiaoqing Wei 2014-04-11 07:37:41 UTC
Description of problem:
migrate_cancel wont take effect on previouly wrong migrate -d cmd

Version-Release number of selected component (if applicable):
kernel-3.10.0-121.el7.x86_64
qemu-kvm-1.5.3-60.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. boot a src vm

SRC: qemu-kvm -S -monitor stdio
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) VNC server running on `::1:5900'

dst vm in incoming mode
DST: qemu-kvm -S -monitor stdio -incoming tcp:0:8100
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) VNC server running on `::1:5901'
info status 
VM status: paused (inmigrate)

send wrong uri on src
SRC: (qemu) migrate -d 0:8100
migrate: Parameter 'uri' expects a valid migration protocol

2. now try mig w/ correct syntax

(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: setup
total time: 0 milliseconds
(qemu) migrate -d tcp:0:8100
migrate: There's a migration process in progress

3. cancel the mig and retry w/ correct syntax

(qemu) migrate_cancel 
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: active
total time: 23569 milliseconds
expected downtime: 0 milliseconds
setup: 0 milliseconds
transferred ram: 0 kbytes
throughput: 0.00 mbps
remaining ram: 0 kbytes
total ram: 148172 kbytes
duplicate: 0 pages
skipped: 0 pages
normal: 0 pages
normal bytes: 0 kbytes
(qemu) migrate -d tcp:0:8100
migrate: There's a migration process in progress


Actual results:
qemu just wont migrate and keep saying a migration process exists

Expected results:
either mig_cancel should take effect
or wrong mig syntax shouldn't create mig process

Additional info:

Comment 2 Amit Shah 2014-04-11 08:55:46 UTC
We need to backport

commit c950114286ea358a93ce632db0421945e1008395
Author: Luiz Capitulino <>
Date:   Sun Dec 29 22:39:58 2013 -0500

    migration: qmp_migrate(): keep working after syntax error
    
    If a user or QMP client enter a bad syntax for the migrate
    command in QMP/HMP, then the migrate command will never succeed
    from that point on.
    
    For example, if you enter:
    
    (qemu) migrate tcp;0:4444
    migrate: Parameter 'uri' expects a valid migration protocol
    
    Then the migrate command will always fail from now on:
    
    (qemu) migrate tcp:0:4444
    migrate: There's a migration process in progress
    
    The problem is that qmp_migrate() sets the migration status to
    MIG_STATE_SETUP and doesn't reset it on syntax error. This bug
    was introduced by commit 29ae8a4133082e16970c9d4be09f4b6a15034617.

Comment 3 Amit Shah 2014-04-14 11:15:41 UTC
*** Bug 1047943 has been marked as a duplicate of this bug. ***

Comment 4 Miroslav Rezanina 2014-07-09 12:17:07 UTC
Fix included in qemu-kvm-1.5.3-66.el7

Comment 5 huiqingding 2014-08-01 02:42:59 UTC
Reproduce this bug using the following version:
qemu-kvm-1.5.3-60.el7.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Reproduce:
1. boot a src vm
#/usr/libexec/qemu-kvm -S -monitor stdio
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) VNC server running on `::1:5900'

dst vm in incoming mode
# /usr/libexec/qemu-kvm -S -monitor stdio -incoming tcp:0:8100
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) VNC server running on `::1:5901'

2. send wrong uri on src
SRC: (qemu) migrate -d 0:8100
migrate: Parameter 'uri' expects a valid migration protocol

3. send correct uri on src
SRC: (qemu) migrate -d tcp:0:8100
migrate: There's a migration process in progress

Results:
after step3, if user or QMP client enter a bad syntax for the migrate command in QMP/HMP, then the migrate command will never succeed from that point on.

Comment 6 huiqingding 2014-08-01 03:08:34 UTC
Test this issue using the following version on an amd host:
qemu-kvm-1.5.3-66.el7.x86_64
kernel-3.10.0-140.el7.x86_64

Steps to Test:
1. boot a src vm
#/usr/libexec/qemu-kvm -S -monitor stdio -qmp tcp:0:4445,server,nowait
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) VNC server running on `::1:5900'

dst vm in incoming mode
# /usr/libexec/qemu-kvm -S -monitor stdio -incoming tcp:0:8100
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) VNC server running on `::1:5901'

2. send wrong HMP migration cmd on src 
SRC: (qemu) migrate -d 0:8100
migrate: Parameter 'uri' expects a valid migration protocol

3. send correct HMP migration cmd on src 
SRC: (qemu) migrate -d tcp:0:8100

4. boot a src vm
#/usr/libexec/qemu-kvm -S -monitor stdio -qmp tcp:0:4445,server,nowait
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) VNC server running on `::1:5900'

dst vm in incoming mode
# /usr/libexec/qemu-kvm -S -monitor stdio -incoming tcp:0:8100
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) VNC server running on `::1:5901'

5. send wrong QMP migration cmd on src 
{"execute":"qmp_capabilities"}
{"return": {}}
{"execute": "migrate","arguments":{"uri": "0:8100"}} 
{"error": {"class": "GenericError", "desc": "Parameter 'uri' expects a valid migration protocol"}}

6. send correct QMP migration cmd on src 
{"execute": "migrate","arguments":{"uri": "tcp:0:8100"}}
{"return": {}}

Results:
after step3, no error info, and use "info migrate" to check the migration is completed as following
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: completed
total time: 32 milliseconds
downtime: 3 milliseconds
setup: 0 milliseconds
transferred ram: 565 kbytes
throughput: 0.00 mbps
remaining ram: 0 kbytes
total ram: 148172 kbytes
duplicate: 36983 pages
skipped: 0 pages
normal: 60 pages
normal bytes: 240 kbytes

after step6, migration is completed through checking:
{"execute":"query-migrate"} 
{"return": {"status": "completed", "setup-time": 0, "downtime": 3, "total-time": 32, "ram": {"total": 151728128, "remaining": 0, "mbps": 0, "transferred": 579220, "duplicate": 36983, "dirty-pages-rate": 0, "skipped": 0, "normal-bytes": 245760, "normal": 60}}}

Comment 7 huiqingding 2014-08-01 03:13:49 UTC
Test this bug using the following version on an amd host:
qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64
kernel-3.10.0-140.el7.x86_64

The steps are same as comment 6, the results are as following:
after step3, no error info, and use "info migrate" to check the migration is completed as following
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: completed
total time: 32 milliseconds
downtime: 3 milliseconds
setup: 0 milliseconds
transferred ram: 565 kbytes
throughput: 0.00 mbps
remaining ram: 0 kbytes
total ram: 148172 kbytes
duplicate: 36983 pages
skipped: 0 pages
normal: 60 pages
normal bytes: 240 kbytes

after step6, migration is completed through checking:
{"execute":"query-migrate"} 
{"return": {"status": "completed", "setup-time": 0, "downtime": 3, "total-time": 32, "ram": {"total": 151728128, "remaining": 0, "mbps": 0, "transferred": 579220, "duplicate": 36983, "dirty-pages-rate": 0, "skipped": 0, "normal-bytes": 245760, "normal": 60}}}

Comment 8 huiqingding 2014-08-01 05:35:32 UTC
Test this bug using the following version on an amd host:
qemu-kvm-1.5.3-66.el7.x86_64
kernel-3.10.0-140.el7.x86_64

The steps are same as comment 6, the results are as following:
after step3, no error info, and use "info migrate" to check the migration is completed as following
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: completed
total time: 32 milliseconds
downtime: 3 milliseconds
setup: 0 milliseconds
transferred ram: 565 kbytes
throughput: 0.00 mbps
remaining ram: 0 kbytes
total ram: 148172 kbytes
duplicate: 36983 pages
skipped: 0 pages
normal: 60 pages
normal bytes: 240 kbytes

after step6, migration is completed through checking:
{"execute":"query-migrate"} 
{"return": {"status": "completed", "setup-time": 0, "downtime": 3, "total-time": 32, "ram": {"total": 151728128, "remaining": 0, "mbps": 0, "transferred": 579220, "duplicate": 36983, "dirty-pages-rate": 0, "skipped": 0, "normal-bytes": 245760, "normal": 60}}}

Comment 9 huiqingding 2014-08-01 05:38:06 UTC
(In reply to huiqingding from comment #8)
> Test this bug using the following version on an amd host:

Correction: this test is on an intel host

> qemu-kvm-1.5.3-66.el7.x86_64
> kernel-3.10.0-140.el7.x86_64
> 
> The steps are same as comment 6, the results are as following:
> after step3, no error info, and use "info migrate" to check the migration is
> completed as following
> (qemu) info migrate
> capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off
> zero-blocks: off 
> Migration status: completed
> total time: 32 milliseconds
> downtime: 3 milliseconds
> setup: 0 milliseconds
> transferred ram: 565 kbytes
> throughput: 0.00 mbps
> remaining ram: 0 kbytes
> total ram: 148172 kbytes
> duplicate: 36983 pages
> skipped: 0 pages
> normal: 60 pages
> normal bytes: 240 kbytes
> 
> after step6, migration is completed through checking:
> {"execute":"query-migrate"} 
> {"return": {"status": "completed", "setup-time": 0, "downtime": 3,
> "total-time": 32, "ram": {"total": 151728128, "remaining": 0, "mbps": 0,
> "transferred": 579220, "duplicate": 36983, "dirty-pages-rate": 0, "skipped":
> 0, "normal-bytes": 245760, "normal": 60}}}

Comment 10 huiqingding 2014-08-01 05:39:12 UTC
Test this bug using the following version on an intel host:
qemu-kvm-rhev-2.1.0-3.el7ev.preview.x86_64
kernel-3.10.0-140.el7.x86_64

The steps are same as comment 6, the results are as following:
after step3, no error info, and use "info migrate" to check the migration is completed as following
(qemu) info migrate
capabilities: xbzrle: off x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: completed
total time: 32 milliseconds
downtime: 3 milliseconds
setup: 0 milliseconds
transferred ram: 565 kbytes
throughput: 0.00 mbps
remaining ram: 0 kbytes
total ram: 148172 kbytes
duplicate: 36983 pages
skipped: 0 pages
normal: 60 pages
normal bytes: 240 kbytes

after step6, migration is completed through checking:
{"execute":"query-migrate"} 
{"return": {"status": "completed", "setup-time": 0, "downtime": 3, "total-time": 32, "ram": {"total": 151728128, "remaining": 0, "mbps": 0, "transferred": 579220, "duplicate": 36983, "dirty-pages-rate": 0, "skipped": 0, "normal-bytes": 245760, "normal": 60}}}

Comment 11 Luiz Capitulino 2014-08-01 13:35:21 UTC
The CPU vendor makes no difference for this issue, and your test is good.

Comment 15 errata-xmlrpc 2015-03-05 08:05:42 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/RHSA-2015-0349.html