提交 2354266a 编写于 作者: P Pavel Glushchak 提交者: Maxim Nestratov

vz: added VIR_MIGRATE_PARAM_BANDWIDTH param handling

libvirt-python passes parameter bandwidth = 0
by default. This means that bandwidth is unlimited.
VZ driver doesn't support bandwidth rate limiting,
but we still need to handle it and fail if bandwidth > 0.
Signed-off-by: NPavel Glushchak <pglushchak@virtuozzo.com>
上级 d7af2218
......@@ -2897,6 +2897,7 @@ vzEatCookie(const char *cookiein, int cookieinlen, unsigned int flags)
VIR_MIGRATE_PARAM_DEST_XML, VIR_TYPED_PARAM_STRING, \
VIR_MIGRATE_PARAM_URI, VIR_TYPED_PARAM_STRING, \
VIR_MIGRATE_PARAM_DEST_NAME, VIR_TYPED_PARAM_STRING, \
VIR_MIGRATE_PARAM_BANDWIDTH, VIR_TYPED_PARAM_ULLONG, \
NULL
static char *
......@@ -2938,12 +2939,23 @@ vzDomainMigrateBegin3Params(virDomainPtr domain,
char *xml = NULL;
virDomainObjPtr dom = NULL;
vzConnPtr privconn = domain->conn->privateData;
unsigned long long bandwidth = 0;
virCheckFlags(VZ_MIGRATION_FLAGS, NULL);
if (virTypedParamsValidate(params, nparams, VZ_MIGRATION_PARAMETERS) < 0)
goto cleanup;
if (virTypedParamsGetULLong(params, nparams, VIR_MIGRATE_PARAM_BANDWIDTH,
&bandwidth) < 0)
goto cleanup;
if (bandwidth > 0) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("Bandwidth rate limiting is not supported"));
goto cleanup;
}
if (!(dom = vzDomObjFromDomain(domain)))
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册