]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Make qemuMonitorSetMigrationCompression saner
authorJiri Denemark <jdenemar@redhat.com>
Mon, 20 Jun 2016 13:51:13 +0000 (15:51 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 22 Jun 2016 13:54:21 +0000 (15:54 +0200)
Checking whether the function has anything to do is better done in the
function rather then requiring callers to do that.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_migration.c
src/qemu/qemu_monitor.c

index a1ce84e442c411ddb2b5daa53a5977bdc2dd704f..575d367f36cfa20ffbebcfb17c93d242e487cf56 100644 (file)
@@ -3455,8 +3455,7 @@ qemuMigrationSetCompression(virQEMUDriverPtr driver,
     if (qemuDomainObjEnterMonitorAsync(driver, vm, job) < 0)
         return -1;
 
-    if ((params->level_set || params->threads_set || params->dthreads_set) &&
-        qemuMonitorSetMigrationCompression(priv->mon, params) < 0)
+    if (qemuMonitorSetMigrationCompression(priv->mon, params) < 0)
         goto cleanup;
 
     if (compression->xbzrle_cache_set &&
index d8e33a98afec86f5c4441d14205c0c08b13cb132..f7609e97f744466ceb32c804cf52193ac3cd3541 100644 (file)
@@ -2177,6 +2177,11 @@ qemuMonitorSetMigrationCompression(qemuMonitorPtr mon,
 
     QEMU_CHECK_MONITOR_JSON(mon);
 
+    if (!compress->level_set &&
+        !compress->threads_set &&
+        !compress->dthreads_set)
+        return 0;
+
     return qemuMonitorJSONSetMigrationCompression(mon, compress);
 }