Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
e29990c5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e29990c5
编写于
1月 28, 2016
作者:
N
Nikolay Shirokovskiy
提交者:
Jiri Denemark
2月 04, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu migration: factor out setting migration option
Signed-off-by:
N
Nikolay Shirokovskiy
<
nshirokovskiy@virtuozzo.com
>
上级
41c987b7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
113 deletion
+28
-113
src/qemu/qemu_migration.c
src/qemu/qemu_migration.c
+28
-113
未找到文件。
src/qemu/qemu_migration.c
浏览文件 @
e29990c5
...
...
@@ -2364,97 +2364,10 @@ qemuMigrationSetOffline(virQEMUDriverPtr driver,
return
ret
;
}
static
int
qemuMigrationSetCompression
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
bool
state
,
qemuDomainAsyncJob
job
)
{
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
int
ret
;
if
(
qemuDomainObjEnterMonitorAsync
(
driver
,
vm
,
job
)
<
0
)
return
-
1
;
ret
=
qemuMonitorGetMigrationCapability
(
priv
->
mon
,
QEMU_MONITOR_MIGRATION_CAPS_XBZRLE
);
if
(
ret
<
0
)
{
goto
cleanup
;
}
else
if
(
ret
==
0
&&
!
state
)
{
/* Unsupported but we want it off anyway */
goto
cleanup
;
}
else
if
(
ret
==
0
)
{
if
(
job
==
QEMU_ASYNC_JOB_MIGRATION_IN
)
{
virReportError
(
VIR_ERR_ARGUMENT_UNSUPPORTED
,
"%s"
,
_
(
"Compressed migration is not supported by "
"target QEMU binary"
));
}
else
{
virReportError
(
VIR_ERR_ARGUMENT_UNSUPPORTED
,
"%s"
,
_
(
"Compressed migration is not supported by "
"source QEMU binary"
));
}
ret
=
-
1
;
goto
cleanup
;
}
ret
=
qemuMonitorSetMigrationCapability
(
priv
->
mon
,
QEMU_MONITOR_MIGRATION_CAPS_XBZRLE
,
state
);
cleanup:
if
(
qemuDomainObjExitMonitor
(
driver
,
vm
)
<
0
)
ret
=
-
1
;
return
ret
;
}
static
int
qemuMigrationSetAutoConverge
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
bool
state
,
qemuDomainAsyncJob
job
)
{
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
int
ret
;
if
(
qemuDomainObjEnterMonitorAsync
(
driver
,
vm
,
job
)
<
0
)
return
-
1
;
ret
=
qemuMonitorGetMigrationCapability
(
priv
->
mon
,
QEMU_MONITOR_MIGRATION_CAPS_AUTO_CONVERGE
);
if
(
ret
<
0
)
{
goto
cleanup
;
}
else
if
(
ret
==
0
&&
!
state
)
{
/* Unsupported but we want it off anyway */
goto
cleanup
;
}
else
if
(
ret
==
0
)
{
virReportError
(
VIR_ERR_ARGUMENT_UNSUPPORTED
,
"%s"
,
_
(
"Auto-Converge is not supported by "
"QEMU binary"
));
ret
=
-
1
;
goto
cleanup
;
}
ret
=
qemuMonitorSetMigrationCapability
(
priv
->
mon
,
QEMU_MONITOR_MIGRATION_CAPS_AUTO_CONVERGE
,
state
);
cleanup:
if
(
qemuDomainObjExitMonitor
(
driver
,
vm
)
<
0
)
ret
=
-
1
;
return
ret
;
}
static
int
qemuMigrationSetPinAll
(
virQEMUDriverPtr
driver
,
qemuMigrationSetOption
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
qemuMonitorMigrationCaps
capability
,
bool
state
,
qemuDomainAsyncJob
job
)
{
...
...
@@ -2464,9 +2377,7 @@ qemuMigrationSetPinAll(virQEMUDriverPtr driver,
if
(
qemuDomainObjEnterMonitorAsync
(
driver
,
vm
,
job
)
<
0
)
return
-
1
;
ret
=
qemuMonitorGetMigrationCapability
(
priv
->
mon
,
QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL
);
ret
=
qemuMonitorGetMigrationCapability
(
priv
->
mon
,
capability
);
if
(
ret
<
0
)
{
goto
cleanup
;
...
...
@@ -2475,22 +2386,21 @@ qemuMigrationSetPinAll(virQEMUDriverPtr driver,
goto
cleanup
;
}
else
if
(
ret
==
0
)
{
if
(
job
==
QEMU_ASYNC_JOB_MIGRATION_IN
)
{
virReportError
(
VIR_ERR_ARGUMENT_UNSUPPORTED
,
"%s"
,
_
(
"rdma pinning migration is not supported by "
"target QEMU binary"
));
virReportError
(
VIR_ERR_ARGUMENT_UNSUPPORTED
,
_
(
"Migration option '%s' is not supported by "
"target QEMU binary"
),
qemuMonitorMigrationCapsTypeToString
(
capability
));
}
else
{
virReportError
(
VIR_ERR_ARGUMENT_UNSUPPORTED
,
"%s"
,
_
(
"rdma pinning migration is not supported by "
"source QEMU binary"
));
virReportError
(
VIR_ERR_ARGUMENT_UNSUPPORTED
,
_
(
"Migration option '%s' is not supported by "
"source QEMU binary"
),
qemuMonitorMigrationCapsTypeToString
(
capability
));
}
ret
=
-
1
;
goto
cleanup
;
}
ret
=
qemuMonitorSetMigrationCapability
(
priv
->
mon
,
QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL
,
state
);
ret
=
qemuMonitorSetMigrationCapability
(
priv
->
mon
,
capability
,
state
);
cleanup:
if
(
qemuDomainObjExitMonitor
(
driver
,
vm
)
<
0
)
...
...
@@ -3582,9 +3492,10 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
dataFD
[
1
]
=
-
1
;
/* 'st' owns the FD now & will close it */
}
if
(
qemuMigrationSetCompression
(
driver
,
vm
,
flags
&
VIR_MIGRATE_COMPRESSED
,
QEMU_ASYNC_JOB_MIGRATION_IN
)
<
0
)
if
(
qemuMigrationSetOption
(
driver
,
vm
,
QEMU_MONITOR_MIGRATION_CAPS_XBZRLE
,
flags
&
VIR_MIGRATE_COMPRESSED
,
QEMU_ASYNC_JOB_MIGRATION_IN
)
<
0
)
goto
stopjob
;
if
(
STREQ_NULLABLE
(
protocol
,
"rdma"
)
&&
...
...
@@ -3592,7 +3503,8 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
goto
stopjob
;
}
if
(
qemuMigrationSetPinAll
(
driver
,
vm
,
if
(
qemuMigrationSetOption
(
driver
,
vm
,
QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL
,
flags
&
VIR_MIGRATE_RDMA_PIN_ALL
,
QEMU_ASYNC_JOB_MIGRATION_IN
)
<
0
)
goto
stopjob
;
...
...
@@ -4447,17 +4359,20 @@ qemuMigrationRun(virQEMUDriverPtr driver,
goto
cleanup
;
}
if
(
qemuMigrationSetCompression
(
driver
,
vm
,
flags
&
VIR_MIGRATE_COMPRESSED
,
QEMU_ASYNC_JOB_MIGRATION_OUT
)
<
0
)
if
(
qemuMigrationSetOption
(
driver
,
vm
,
QEMU_MONITOR_MIGRATION_CAPS_XBZRLE
,
flags
&
VIR_MIGRATE_COMPRESSED
,
QEMU_ASYNC_JOB_MIGRATION_OUT
)
<
0
)
goto
cleanup
;
if
(
qemuMigrationSetAutoConverge
(
driver
,
vm
,
flags
&
VIR_MIGRATE_AUTO_CONVERGE
,
QEMU_ASYNC_JOB_MIGRATION_OUT
)
<
0
)
if
(
qemuMigrationSetOption
(
driver
,
vm
,
QEMU_MONITOR_MIGRATION_CAPS_AUTO_CONVERGE
,
flags
&
VIR_MIGRATE_AUTO_CONVERGE
,
QEMU_ASYNC_JOB_MIGRATION_OUT
)
<
0
)
goto
cleanup
;
if
(
qemuMigrationSetPinAll
(
driver
,
vm
,
if
(
qemuMigrationSetOption
(
driver
,
vm
,
QEMU_MONITOR_MIGRATION_CAPS_RDMA_PIN_ALL
,
flags
&
VIR_MIGRATE_RDMA_PIN_ALL
,
QEMU_ASYNC_JOB_MIGRATION_OUT
)
<
0
)
goto
cleanup
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录