Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
35820ad5
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
35820ad5
编写于
6月 12, 2013
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adapt virDomainMigratePeer2Peer for extensible migration APIs
上级
fa8b7c6a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
56 addition
and
52 deletion
+56
-52
src/libvirt.c
src/libvirt.c
+56
-52
未找到文件。
src/libvirt.c
浏览文件 @
35820ad5
...
...
@@ -5075,73 +5075,69 @@ virDomainMigrateVersion3(virDomainPtr domain,
* only talks to the source libvirtd instance. The source libvirtd
* then opens its own connection to the destination and co-ordinates
* migration itself.
*
* If useParams is true, params and nparams contain migration parameters and
* we know it's safe to call the API which supports extensible parameters.
* Otherwise, we have to use xmlin, dname, uri, and bandwidth and pass them
* to the old-style APIs.
*/
static int
virDomainMigratePeer2Peer(virDomainPtr domain,
const char *xmlin,
unsigned long flags,
const char *dname,
const char *dconnuri,
const char *uri,
unsigned long bandwidth)
virDomainMigratePeer2PeerFull(virDomainPtr domain,
const char *dconnuri,
const char *xmlin,
const char *dname,
const char *uri,
unsigned long long bandwidth,
virTypedParameterPtr params,
int nparams,
bool useParams,
unsigned int flags)
{
virURIPtr tempuri = NULL;
VIR_DOMAIN_DEBUG(domain, "xmlin=%s, flags=%lx, dname=%s, "
"dconnuri=%s, uri=%s, bandwidth=%lu",
NULLSTR(xmlin), flags, NULLSTR(dname),
NULLSTR(dconnuri), NULLSTR(uri), bandwidth);
if (!domain->conn->driver->domainMigratePerform) {
virLibConnError(VIR_ERR_NO_SUPPORT, __FUNCTION__);
virDispatchError(domain->conn);
return -1;
}
VIR_DOMAIN_DEBUG(domain,
"dconnuri=%s, xmlin=%s, dname=%s, uri=%s, bandwidth=%llu "
"params=%p, nparams=%d, useParams=%d, flags=%x",
dconnuri, NULLSTR(xmlin), NULLSTR(dname), NULLSTR(uri),
bandwidth, params, nparams, useParams, flags);
VIR_TYPED_PARAMS_DEBUG(params, nparams);
if (!(tempuri = virURIParse(dconnuri))) {
virDispatchError(domain->conn);
if ((useParams && !domain->conn->driver->domainMigratePerform3Params) ||
(!useParams &&
!domain->conn->driver->domainMigratePerform &&
!domain->conn->driver->domainMigratePerform3)) {
virLibConnError(VIR_ERR_INTERNAL_ERROR, __FUNCTION__);
return -1;
}
if (!tempuri->server) {
virReportInvalidArg(dconnuri,
_("unable to parse server from dconnuri in %s"),
__FUNCTION__);
virDispatchError(domain->conn);
virURIFree(tempuri);
if (!(tempuri = virURIParse(dconnuri)))
return -1;
}
if (STRPREFIX(tempuri->server, "localhost")) {
if (!tempuri->server || STRPREFIX(tempuri->server, "localhost")) {
virReportInvalidArg(dconnuri,
_("unable to parse server from dconnuri in %s"),
__FUNCTION__);
virDispatchError(domain->conn);
virURIFree(tempuri);
return -1;
}
virURIFree(tempuri);
/* Perform the migration. The driver isn't supposed to return
* until the migration is complete.
*/
if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
VIR_DRV_FEATURE_MIGRATION_V3)) {
if (useParams) {
VIR_DEBUG("Using migration protocol 3 with extensible parameters");
return domain->conn->driver->domainMigratePerform3Params
(domain, dconnuri, params, nparams,
NULL, 0, NULL, NULL, flags);
} else if (VIR_DRV_SUPPORTS_FEATURE(domain->conn->driver, domain->conn,
VIR_DRV_FEATURE_MIGRATION_V3)) {
VIR_DEBUG("Using migration protocol 3");
return domain->conn->driver->domainMigratePerform3(domain,
xmlin,
NULL, /* cookiein */
0, /* cookieinlen */
NULL, /* cookieoutlen */
NULL, /* cookieoutlen */
dconnuri,
uri,
flags,
dname,
bandwidth);
return domain->conn->driver->domainMigratePerform3
(domain, xmlin, NULL, 0, NULL, NULL, dconnuri,
uri, flags, dname, bandwidth);
} else {
VIR_DEBUG("Using migration protocol 2");
if (xmlin) {
virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to change target guest XML during migration"));
virLibConnError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
_("Unable to change target guest XML "
"during migration"));
return -1;
}
if (uri) {
...
...
@@ -5149,16 +5145,24 @@ virDomainMigratePeer2Peer(virDomainPtr domain,
_("Unable to override peer2peer migration URI"));
return -1;
}
return domain->conn->driver->domainMigratePerform(domain,
NULL, /* cookie */
0, /* cookielen */
dconnuri,
flags,
dname,
bandwidth);
return domain->conn->driver->domainMigratePerform
(domain, NULL, 0, dconnuri, flags, dname, bandwidth);
}
}
static int
virDomainMigratePeer2Peer(virDomainPtr domain,
const char *xmlin,
unsigned long flags,
const char *dname,
const char *dconnuri,
const char *uri,
unsigned long bandwidth)
{
return virDomainMigratePeer2PeerFull(domain, dconnuri, xmlin, dname, uri,
bandwidth, NULL, 0, false, flags);
}
/*
* In normal migration, the libvirt client co-ordinates communication
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录