Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1086598 - migrate_cancel wont take effect on previouly wrong migrate -d cmd
migrate_cancel wont take effect on previouly wrong migrate -d cmd
Status: CLOSED ERRATA
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: Amit Shah
Virtualization Bugs
:
: 1047943 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-11 03:37 EDT by Xiaoqing Wei
Modified: 2015-03-05 03:05 EST (History)
10 users (show)

See Also:
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 03:05:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0349 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2015-03-05 07:27:34 EST

  None (edit)
Description Xiaoqing Wei 2014-04-11 03:37:41 EDT
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 04:55:46 EDT
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 07:15:41 EDT
*** Bug 1047943 has been marked as a duplicate of this bug. ***
Comment 4 Miroslav Rezanina 2014-07-09 08:17:07 EDT
Fix included in qemu-kvm-1.5.3-66.el7
Comment 5 huiqingding 2014-07-31 22:42:59 EDT
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-07-31 23:08:34 EDT
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-07-31 23:13:49 EDT
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 01:35:32 EDT
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 01:38:06 EDT
(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 01:39:12 EDT
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 09:35:21 EDT
The CPU vendor makes no difference for this issue, and your test is good.
Comment 15 errata-xmlrpc 2015-03-05 03:05:42 EST
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

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