Red Hat Bugzilla – Bug 1086598
migrate_cancel wont take effect on previouly wrong migrate -d cmd
Last modified: 2015-03-05 03:05:42 EST
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:
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.
*** Bug 1047943 has been marked as a duplicate of this bug. ***
Fix included in qemu-kvm-1.5.3-66.el7
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.
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}}}
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}}}
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}}}
(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}}}
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}}}
The CPU vendor makes no difference for this issue, and your test is good.
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