提交 abf50874 编写于 作者: R Rudy Zhang 提交者: Ján Tomko

migration: convert speed from MiB/sec to bytes/sec in drive-mirror jobs

Commit 08cc14f7 moved the conversion of MiB/s to B/s out of the
qemuMonitor APIs, but forgot to adjust the qemuMigrationDriveMirror
caller.

This patch will convert the migrate_speed value from MiB/s to its
mirror_speed equivalent in bytes/s.
Signed-off-by: NRudy Zhang <rudyflyzhang@gmail.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 1d8351a9
......@@ -2061,7 +2061,7 @@ qemuMigrationCancelDriveMirror(virQEMUDriverPtr driver,
* @vm: domain
* @mig: migration cookie
* @host: where are we migrating to
* @speed: how much should the copying be limited
* @speed: bandwidth limit in MiB/s
* @migrate_flags: migrate monitor command flags
*
* Run drive-mirror to feed NBD server running on dst and wait
......@@ -2093,12 +2093,21 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
char *diskAlias = NULL;
char *nbd_dest = NULL;
char *hoststr = NULL;
unsigned long long mirror_speed = speed;
unsigned int mirror_flags = VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT;
int rv;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
VIR_DEBUG("Starting drive mirrors for domain %s", vm->def->name);
if (mirror_speed > LLONG_MAX >> 20) {
virReportError(VIR_ERR_OVERFLOW,
_("bandwidth must be less than %llu"),
LLONG_MAX >> 20);
goto cleanup;
}
mirror_speed <<= 20;
/* steal NBD port and thus prevent its propagation back to destination */
port = mig->nbd->port;
mig->nbd->port = 0;
......@@ -2136,7 +2145,7 @@ qemuMigrationDriveMirror(virQEMUDriverPtr driver,
qemuBlockJobSyncBegin(disk);
/* Force "raw" format for NBD export */
mon_ret = qemuMonitorDriveMirror(priv->mon, diskAlias, nbd_dest,
"raw", speed, 0, 0, mirror_flags);
"raw", mirror_speed, 0, 0, mirror_flags);
VIR_FREE(diskAlias);
VIR_FREE(nbd_dest);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册