mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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.
This commit is contained in:
parent
ef1065cf5a
commit
0257ba8f9f
@ -1437,6 +1437,7 @@ qemuMigrationRun(struct qemud_driver *driver,
|
|||||||
qemuMigrationCookiePtr mig = NULL;
|
qemuMigrationCookiePtr mig = NULL;
|
||||||
qemuMigrationIOThreadPtr iothread = NULL;
|
qemuMigrationIOThreadPtr iothread = NULL;
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
|
unsigned long migrate_speed = resource ? resource : priv->migMaxBandwidth;
|
||||||
|
|
||||||
VIR_DEBUG("driver=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
|
VIR_DEBUG("driver=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
|
||||||
"cookieout=%p, cookieoutlen=%p, flags=%lx, resource=%lu, "
|
"cookieout=%p, cookieoutlen=%p, flags=%lx, resource=%lu, "
|
||||||
@ -1472,8 +1473,7 @@ qemuMigrationRun(struct qemud_driver *driver,
|
|||||||
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
|
QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (resource > 0 &&
|
if (qemuMonitorSetMigrationSpeed(priv->mon, migrate_speed) < 0) {
|
||||||
qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) {
|
|
||||||
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
qemuDomainObjExitMonitorWithDriver(driver, vm);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user