提交 dba5a604 编写于 作者: D Daniel P. Berrange

Make tunnelled migration honour resource restriction

The doTunnelMigrate method forgot to set the bandwidth
resource restriction

* src/qemu/qemu_migration.c: Set resource restriction
上级 792a5a61
......@@ -1299,7 +1299,6 @@ static int doTunnelSendAll(virStreamPtr st,
return -1;
}
/* XXX should honour the 'resource' parameter here */
for (;;) {
nbytes = saferead(sock, buffer, nbytes);
if (nbytes < 0) {
......@@ -1339,7 +1338,7 @@ static int doTunnelMigrate(struct qemud_driver *driver,
char **cookieout,
int *cookieoutlen,
unsigned long flags,
unsigned long resource ATTRIBUTE_UNUSED)
unsigned long resource)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
int client_sock = -1;
......@@ -1421,6 +1420,11 @@ static int doTunnelMigrate(struct qemud_driver *driver,
/* 3. start migration on source */
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (resource > 0 &&
qemuMonitorSetMigrationSpeed(priv->mon, resource) < 0) {
qemuDomainObjExitMonitorWithDriver(driver, vm);
goto cleanup;
}
if (flags & VIR_MIGRATE_NON_SHARED_DISK)
background_flags |= QEMU_MONITOR_MIGRATE_NON_SHARED_DISK;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册