From: Jim Fehlig Date: Fri, 26 Aug 2011 18:10:27 +0000 (-0600) Subject: Use max bandwidth from qemuDomainObjPrivate struct when migrating X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0257ba8f9f4bf522a106aa2bbb4756e391a3dd42;p=libvirt.git Use max bandwidth from qemuDomainObjPrivate struct when migrating Adjust qemuMigrationRun() to use migMaxBandwidth in qemuDomainObjPrivate structure when setting qemu migration speed. Caller-specified 'resource' parameter overrides migMaxBandwidth. --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index b882d06cdc..d9f8d9308b 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1437,6 +1437,7 @@ qemuMigrationRun(struct qemud_driver *driver, qemuMigrationCookiePtr mig = NULL; qemuMigrationIOThreadPtr iothread = NULL; int fd = -1; + unsigned long migrate_speed = resource ? resource : priv->migMaxBandwidth; VIR_DEBUG("driver=%p, vm=%p, cookiein=%s, cookieinlen=%d, " "cookieout=%p, cookieoutlen=%p, flags=%lx, resource=%lu, " @@ -1472,8 +1473,7 @@ qemuMigrationRun(struct qemud_driver *driver, QEMU_ASYNC_JOB_MIGRATION_OUT) < 0) goto cleanup; - if (resource > 0 && - qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) { + if (qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) { qemuDomainObjExitMonitorWithDriver(driver, vm); goto cleanup; }