aboutsummaryrefslogtreecommitdiff
path: root/migration.c
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2013-07-30 08:39:52 +0900
committerLuiz Capitulino <lcapitulino@redhat.com>2013-08-01 09:40:46 -0400
commit8c0426aed1d2279845e6a2c3355da8b5d9926cb6 (patch)
tree878e23e673cb1e318aaa3249680024c18385cb04 /migration.c
parent00c14997cb95bf3e6c18c2264ef5e10642d89b3a (diff)
migration: don't use uninitialized variables
The qmp_migrate method uses the 'blk' and 'inc' parameter without checking if they're valid or not (they may be uninitialized if command is received via QMP) Signed-off-by: Pawit Pornkitprasan <p.pawit@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'migration.c')
-rw-r--r--migration.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/migration.c b/migration.c
index 3f682cdc7f..1402fa7680 100644
--- a/migration.c
+++ b/migration.c
@@ -400,8 +400,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
MigrationParams params;
const char *p;
- params.blk = blk;
- params.shared = inc;
+ params.blk = has_blk && blk;
+ params.shared = has_inc && inc;
if (s->state == MIG_STATE_ACTIVE || s->state == MIG_STATE_SETUP) {
error_set(errp, QERR_MIGRATION_ACTIVE);