Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
6607ae23
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6607ae23
编写于
6月 19, 2012
作者:
I
Isaku Yamahata
提交者:
Juan Quintela
6月 29, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add MigrationParams structure
Signed-off-by:
N
Isaku Yamahata
<
yamahata@valinux.co.jp
>
上级
0ff1f9f5
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
31 addition
and
17 deletion
+31
-17
block-migration.c
block-migration.c
+4
-4
migration.c
migration.c
+8
-5
migration.h
migration.h
+6
-2
qemu-common.h
qemu-common.h
+1
-0
savevm.c
savevm.c
+9
-4
sysemu.h
sysemu.h
+2
-1
vmstate.h
vmstate.h
+1
-1
未找到文件。
block-migration.c
浏览文件 @
6607ae23
...
...
@@ -700,13 +700,13 @@ static int block_load(QEMUFile *f, void *opaque, int version_id)
return
0
;
}
static
void
block_set_params
(
int
blk_enable
,
int
shared_base
,
void
*
opaque
)
static
void
block_set_params
(
const
MigrationParams
*
params
,
void
*
opaque
)
{
block_mig_state
.
blk_enable
=
blk_enable
;
block_mig_state
.
shared_base
=
shared_base
;
block_mig_state
.
blk_enable
=
params
->
blk
;
block_mig_state
.
shared_base
=
params
->
shared
;
/* shared base means that blk_enable = 1 */
block_mig_state
.
blk_enable
|=
shared_base
;
block_mig_state
.
blk_enable
|=
params
->
shared
;
}
void
blk_mig_init
(
void
)
...
...
migration.c
浏览文件 @
6607ae23
...
...
@@ -352,7 +352,7 @@ void migrate_fd_connect(MigrationState *s)
migrate_fd_close
);
DPRINTF
(
"beginning savevm
\n
"
);
ret
=
qemu_savevm_state_begin
(
s
->
file
,
s
->
blk
,
s
->
shared
);
ret
=
qemu_savevm_state_begin
(
s
->
file
,
&
s
->
params
);
if
(
ret
<
0
)
{
DPRINTF
(
"failed, %d
\n
"
,
ret
);
migrate_fd_error
(
s
);
...
...
@@ -361,15 +361,14 @@ void migrate_fd_connect(MigrationState *s)
migrate_fd_put_ready
(
s
);
}
static
MigrationState
*
migrate_init
(
int
blk
,
int
inc
)
static
MigrationState
*
migrate_init
(
const
MigrationParams
*
params
)
{
MigrationState
*
s
=
migrate_get_current
();
int64_t
bandwidth_limit
=
s
->
bandwidth_limit
;
memset
(
s
,
0
,
sizeof
(
*
s
));
s
->
bandwidth_limit
=
bandwidth_limit
;
s
->
blk
=
blk
;
s
->
shared
=
inc
;
s
->
params
=
*
params
;
s
->
bandwidth_limit
=
bandwidth_limit
;
s
->
state
=
MIG_STATE_SETUP
;
...
...
@@ -394,9 +393,13 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
Error
**
errp
)
{
MigrationState
*
s
=
migrate_get_current
();
MigrationParams
params
;
const
char
*
p
;
int
ret
;
params
.
blk
=
blk
;
params
.
shared
=
inc
;
if
(
s
->
state
==
MIG_STATE_ACTIVE
)
{
error_set
(
errp
,
QERR_MIGRATION_ACTIVE
);
return
;
...
...
@@ -411,7 +414,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
return
;
}
s
=
migrate_init
(
blk
,
inc
);
s
=
migrate_init
(
&
params
);
if
(
strstart
(
uri
,
"tcp:"
,
&
p
))
{
ret
=
tcp_start_outgoing_migration
(
s
,
p
,
errp
);
...
...
migration.h
浏览文件 @
6607ae23
...
...
@@ -19,6 +19,11 @@
#include "notify.h"
#include "error.h"
struct
MigrationParams
{
bool
blk
;
bool
shared
;
};
typedef
struct
MigrationState
MigrationState
;
struct
MigrationState
...
...
@@ -31,8 +36,7 @@ struct MigrationState
int
(
*
close
)(
MigrationState
*
s
);
int
(
*
write
)(
MigrationState
*
s
,
const
void
*
buff
,
size_t
size
);
void
*
opaque
;
int
blk
;
int
shared
;
MigrationParams
params
;
};
void
process_incoming_migration
(
QEMUFile
*
f
);
...
...
qemu-common.h
浏览文件 @
6607ae23
...
...
@@ -17,6 +17,7 @@ typedef struct DeviceState DeviceState;
struct
Monitor
;
typedef
struct
Monitor
Monitor
;
typedef
struct
MigrationParams
MigrationParams
;
/* we put basic includes here to avoid repeating them in device drivers */
#include <stdlib.h>
...
...
savevm.c
浏览文件 @
6607ae23
...
...
@@ -1561,7 +1561,8 @@ bool qemu_savevm_state_blocked(Error **errp)
return
false
;
}
int
qemu_savevm_state_begin
(
QEMUFile
*
f
,
int
blk_enable
,
int
shared
)
int
qemu_savevm_state_begin
(
QEMUFile
*
f
,
const
MigrationParams
*
params
)
{
SaveStateEntry
*
se
;
int
ret
;
...
...
@@ -1570,7 +1571,7 @@ int qemu_savevm_state_begin(QEMUFile *f, int blk_enable, int shared)
if
(
se
->
set_params
==
NULL
)
{
continue
;
}
se
->
set_params
(
blk_enable
,
shared
,
se
->
opaque
);
se
->
set_params
(
params
,
se
->
opaque
);
}
qemu_put_be32
(
f
,
QEMU_VM_FILE_MAGIC
);
...
...
@@ -1708,13 +1709,17 @@ void qemu_savevm_state_cancel(QEMUFile *f)
static
int
qemu_savevm_state
(
QEMUFile
*
f
)
{
int
ret
;
MigrationParams
params
=
{
.
blk
=
0
,
.
shared
=
0
};
if
(
qemu_savevm_state_blocked
(
NULL
))
{
ret
=
-
EINVAL
;
goto
out
;
}
ret
=
qemu_savevm_state_begin
(
f
,
0
,
0
);
ret
=
qemu_savevm_state_begin
(
f
,
&
params
);
if
(
ret
<
0
)
goto
out
;
...
...
sysemu.h
浏览文件 @
6607ae23
...
...
@@ -77,7 +77,8 @@ void do_info_snapshots(Monitor *mon);
void
qemu_announce_self
(
void
);
bool
qemu_savevm_state_blocked
(
Error
**
errp
);
int
qemu_savevm_state_begin
(
QEMUFile
*
f
,
int
blk_enable
,
int
shared
);
int
qemu_savevm_state_begin
(
QEMUFile
*
f
,
const
MigrationParams
*
params
);
int
qemu_savevm_state_iterate
(
QEMUFile
*
f
);
int
qemu_savevm_state_complete
(
QEMUFile
*
f
);
void
qemu_savevm_state_cancel
(
QEMUFile
*
f
);
...
...
vmstate.h
浏览文件 @
6607ae23
...
...
@@ -26,7 +26,7 @@
#ifndef QEMU_VMSTATE_H
#define QEMU_VMSTATE_H 1
typedef
void
SaveSetParamsHandler
(
int
blk_enable
,
int
shared
,
void
*
opaque
);
typedef
void
SaveSetParamsHandler
(
const
MigrationParams
*
params
,
void
*
opaque
);
typedef
void
SaveStateHandler
(
QEMUFile
*
f
,
void
*
opaque
);
typedef
int
SaveLiveStateHandler
(
QEMUFile
*
f
,
int
stage
,
void
*
opaque
);
typedef
int
LoadStateHandler
(
QEMUFile
*
f
,
void
*
opaque
,
int
version_id
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录