cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
958e1b
From e7ea7509ab95b71445d98b7c76cc74e1e1304779 Mon Sep 17 00:00:00 2001
958e1b
From: Amit Shah <amit.shah@redhat.com>
958e1b
Date: Fri, 11 Apr 2014 09:28:47 +0200
958e1b
Subject: [PATCH 02/13] migration: qmp_migrate(): keep working after syntax error
958e1b
958e1b
RH-Author: Amit Shah <amit.shah@redhat.com>
958e1b
Message-id: <717d7d24efbff7fe32d70c506edea41ea00d1edc.1397208304.git.amit.shah@redhat.com>
958e1b
Patchwork-id: 58439
958e1b
O-Subject: [RHEL7.0.z qemu-kvm PATCH 1/1] migration: qmp_migrate(): keep working after syntax error
958e1b
Bugzilla: 1086598
958e1b
RH-Acked-by: Dr. David Alan Gilbert (git) <dgilbert@redhat.com>
958e1b
RH-Acked-by: Amos Kong <akong@redhat.com>
958e1b
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
958e1b
958e1b
From: Luiz Capitulino <lcapitulino@redhat.com>
958e1b
958e1b
If a user or QMP client enter a bad syntax for the migrate
958e1b
command in QMP/HMP, then the migrate command will never succeed
958e1b
from that point on.
958e1b
958e1b
For example, if you enter:
958e1b
958e1b
(qemu) migrate tcp;0:4444
958e1b
migrate: Parameter 'uri' expects a valid migration protocol
958e1b
958e1b
Then the migrate command will always fail from now on:
958e1b
958e1b
(qemu) migrate tcp:0:4444
958e1b
migrate: There's a migration process in progress
958e1b
958e1b
The problem is that qmp_migrate() sets the migration status to
958e1b
MIG_STATE_SETUP and doesn't reset it on syntax error. This bug
958e1b
was introduced by commit 29ae8a4133082e16970c9d4be09f4b6a15034617.
958e1b
958e1b
Bugzilla: 1086598
958e1b
958e1b
Reviewed-by: Michael R. Hines <mrhines@us.ibm.com>
958e1b
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
958e1b
(cherry picked from commit c950114286ea358a93ce632db0421945e1008395)
958e1b
Signed-off-by: Amit Shah <amit.shah@redhat.com>
958e1b
---
958e1b
 migration.c | 1 +
958e1b
 1 file changed, 1 insertion(+)
958e1b
958e1b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
958e1b
---
958e1b
 migration.c |    1 +
958e1b
 1 files changed, 1 insertions(+), 0 deletions(-)
958e1b
958e1b
diff --git a/migration.c b/migration.c
958e1b
index 93de654..7efbd25 100644
958e1b
--- a/migration.c
958e1b
+++ b/migration.c
958e1b
@@ -457,6 +457,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
958e1b
 #endif
958e1b
     } else {
958e1b
         error_set(errp, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol");
958e1b
+        s->state = MIG_STATE_ERROR;
958e1b
         return;
958e1b
     }
958e1b
 
958e1b
-- 
958e1b
1.7.1
958e1b