yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From 2fb2657213334c34748f1353767654208f76ef94 Mon Sep 17 00:00:00 2001
9ae3a8
From: Orit Wasserman <owasserm@redhat.com>
9ae3a8
Date: Wed, 9 Oct 2013 10:09:14 +0200
9ae3a8
Subject: [PATCH 19/25] migration: don't use uninitialized variables
9ae3a8
9ae3a8
RH-Author: Orit Wasserman <owasserm@redhat.com>
9ae3a8
Message-id: <1381313355-15641-10-git-send-email-owasserm@redhat.com>
9ae3a8
Patchwork-id: 54805
9ae3a8
O-Subject: [RHEL7.0 qemu-kvm v2 09/10] migration: don't use uninitialized variables
9ae3a8
Bugzilla: 921465
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Juan Quintela <quintela@redhat.com>
9ae3a8
9ae3a8
From: Pawit Pornkitprasan <p.pawit@gmail.com>
9ae3a8
9ae3a8
The qmp_migrate method uses the 'blk' and 'inc' parameter without
9ae3a8
checking if they're valid or not (they may be uninitialized if
9ae3a8
command is received via QMP)
9ae3a8
9ae3a8
Signed-off-by: Pawit Pornkitprasan <p.pawit@gmail.com>
9ae3a8
Reviewed-by: Eric Blake <eblake@redhat.com>
9ae3a8
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
9ae3a8
(cherry picked from commit 8c0426aed1d2279845e6a2c3355da8b5d9926cb6)
9ae3a8
---
9ae3a8
 migration.c | 4 ++--
9ae3a8
 1 file changed, 2 insertions(+), 2 deletions(-)
9ae3a8
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 migration.c |    4 ++--
9ae3a8
 1 files changed, 2 insertions(+), 2 deletions(-)
9ae3a8
9ae3a8
diff --git a/migration.c b/migration.c
9ae3a8
index d69ac97..6b87272 100644
9ae3a8
--- a/migration.c
9ae3a8
+++ b/migration.c
9ae3a8
@@ -385,8 +385,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
9ae3a8
     MigrationParams params;
9ae3a8
     const char *p;
9ae3a8
 
9ae3a8
-    params.blk = blk;
9ae3a8
-    params.shared = inc;
9ae3a8
+    params.blk = has_blk && blk;
9ae3a8
+    params.shared = has_inc && inc;
9ae3a8
 
9ae3a8
     if (s->state == MIG_STATE_ACTIVE) {
9ae3a8
         error_set(errp, QERR_MIGRATION_ACTIVE);
9ae3a8
-- 
9ae3a8
1.7.1
9ae3a8