]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration: Fix migrate_set_parameter
authorJuan Quintela <quintela@redhat.com>
Wed, 3 Apr 2019 11:49:51 +0000 (13:49 +0200)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 5 Apr 2019 14:32:13 +0000 (15:32 +0100)
Otherwise we are setting err twice, what is wrong and causes an abort.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20190403114958.3705-2-quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
hmp.c

diff --git a/hmp.c b/hmp.c
index 92941142af042e42ba4a574276be263b3577f08d..8eec7680882f065d5d2ced621bc95c6c085a9548 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -1825,8 +1825,10 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
     case MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE:
         p->has_xbzrle_cache_size = true;
         visit_type_size(v, param, &cache_size, &err);
-        if (err || cache_size > INT64_MAX
-            || (size_t)cache_size != cache_size) {
+        if (err) {
+            break;
+        }
+        if (cache_size > INT64_MAX || (size_t)cache_size != cache_size) {
             error_setg(&err, "Invalid size %s", valuestr);
             break;
         }