Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
acca9134
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,发现更多精彩内容 >>
提交
acca9134
编写于
3月 12, 2014
作者:
L
Laine Stump
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: eliminate hardcoded indent from migration cookie xml
This is also never seen by a human.
上级
64bb9024
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
20 deletion
+29
-20
src/qemu/qemu_migration.c
src/qemu/qemu_migration.c
+29
-20
未找到文件。
src/qemu/qemu_migration.c
浏览文件 @
acca9134
...
...
@@ -535,15 +535,17 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig,
static
void
qemuMigrationCookieGraphicsXMLFormat
(
virBufferPtr
buf
,
qemuMigrationCookieGraphicsPtr
grap
)
{
virBufferAsprintf
(
buf
,
"
<graphics type='%s' port='%d' listen='%s'"
,
virBufferAsprintf
(
buf
,
"<graphics type='%s' port='%d' listen='%s'"
,
virDomainGraphicsTypeToString
(
grap
->
type
),
grap
->
port
,
grap
->
listen
);
if
(
grap
->
type
==
VIR_DOMAIN_GRAPHICS_TYPE_SPICE
)
virBufferAsprintf
(
buf
,
" tlsPort='%d'"
,
grap
->
tlsPort
);
if
(
grap
->
tlsSubject
)
{
virBufferAddLit
(
buf
,
">
\n
"
);
virBufferEscapeString
(
buf
,
" <cert info='subject' value='%s'/>
\n
"
,
grap
->
tlsSubject
);
virBufferAddLit
(
buf
,
" </graphics>
\n
"
);
virBufferAdjustIndent
(
buf
,
2
);
virBufferEscapeString
(
buf
,
"<cert info='subject' value='%s'/>
\n
"
,
grap
->
tlsSubject
);
virBufferAdjustIndent
(
buf
,
-
2
);
virBufferAddLit
(
buf
,
"</graphics>
\n
"
);
}
else
{
virBufferAddLit
(
buf
,
"/>
\n
"
);
}
...
...
@@ -561,23 +563,28 @@ qemuMigrationCookieNetworkXMLFormat(virBufferPtr buf,
/* If optr->net[i].vporttype is not set, there is nothing to transfer */
if
(
optr
->
net
[
i
].
vporttype
!=
VIR_NETDEV_VPORT_PROFILE_NONE
)
{
if
(
empty
)
{
virBufferAddLit
(
buf
,
" <network>
\n
"
);
virBufferAddLit
(
buf
,
"<network>
\n
"
);
virBufferAdjustIndent
(
buf
,
2
);
empty
=
false
;
}
virBufferAsprintf
(
buf
,
"
<interface index='%zu' vporttype='%s'"
,
virBufferAsprintf
(
buf
,
"<interface index='%zu' vporttype='%s'"
,
i
,
virNetDevVPortTypeToString
(
optr
->
net
[
i
].
vporttype
));
if
(
optr
->
net
[
i
].
portdata
)
{
virBufferAddLit
(
buf
,
">
\n
"
);
virBufferEscapeString
(
buf
,
" <portdata>%s</portdata>
\n
"
,
virBufferAdjustIndent
(
buf
,
2
);
virBufferEscapeString
(
buf
,
"<portdata>%s</portdata>
\n
"
,
optr
->
net
[
i
].
portdata
);
virBufferAddLit
(
buf
,
" </interface>
\n
"
);
virBufferAdjustIndent
(
buf
,
-
2
);
virBufferAddLit
(
buf
,
"</interface>
\n
"
);
}
else
{
virBufferAddLit
(
buf
,
"/>
\n
"
);
}
}
}
if
(
!
empty
)
virBufferAddLit
(
buf
,
" </network>
\n
"
);
if
(
!
empty
)
{
virBufferAdjustIndent
(
buf
,
-
2
);
virBufferAddLit
(
buf
,
"</network>
\n
"
);
}
}
...
...
@@ -594,14 +601,15 @@ qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver,
virUUIDFormat
(
mig
->
localHostuuid
,
hostuuidstr
);
virBufferAddLit
(
buf
,
"<qemu-migration>
\n
"
);
virBufferEscapeString
(
buf
,
" <name>%s</name>
\n
"
,
mig
->
name
);
virBufferAsprintf
(
buf
,
" <uuid>%s</uuid>
\n
"
,
uuidstr
);
virBufferEscapeString
(
buf
,
" <hostname>%s</hostname>
\n
"
,
mig
->
localHostname
);
virBufferAsprintf
(
buf
,
" <hostuuid>%s</hostuuid>
\n
"
,
hostuuidstr
);
virBufferAdjustIndent
(
buf
,
2
);
virBufferEscapeString
(
buf
,
"<name>%s</name>
\n
"
,
mig
->
name
);
virBufferAsprintf
(
buf
,
"<uuid>%s</uuid>
\n
"
,
uuidstr
);
virBufferEscapeString
(
buf
,
"<hostname>%s</hostname>
\n
"
,
mig
->
localHostname
);
virBufferAsprintf
(
buf
,
"<hostuuid>%s</hostuuid>
\n
"
,
hostuuidstr
);
for
(
i
=
0
;
i
<
QEMU_MIGRATION_COOKIE_FLAG_LAST
;
i
++
)
{
if
(
mig
->
flagsMandatory
&
(
1
<<
i
))
virBufferAsprintf
(
buf
,
"
<feature name='%s'/>
\n
"
,
virBufferAsprintf
(
buf
,
"<feature name='%s'/>
\n
"
,
qemuMigrationCookieFlagTypeToString
(
i
));
}
...
...
@@ -611,16 +619,17 @@ qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver,
if
((
mig
->
flags
&
QEMU_MIGRATION_COOKIE_LOCKSTATE
)
&&
mig
->
lockState
)
{
virBufferAsprintf
(
buf
,
"
<lockstate driver='%s'>
\n
"
,
virBufferAsprintf
(
buf
,
"<lockstate driver='%s'>
\n
"
,
mig
->
lockDriver
);
virBufferAsprintf
(
buf
,
" <leases>%s</leases>
\n
"
,
virBufferAdjustIndent
(
buf
,
2
);
virBufferAsprintf
(
buf
,
"<leases>%s</leases>
\n
"
,
mig
->
lockState
);
virBufferAddLit
(
buf
,
" </lockstate>
\n
"
);
virBufferAdjustIndent
(
buf
,
-
2
);
virBufferAddLit
(
buf
,
"</lockstate>
\n
"
);
}
if
((
mig
->
flags
&
QEMU_MIGRATION_COOKIE_PERSISTENT
)
&&
mig
->
persistent
)
{
virBufferAdjustIndent
(
buf
,
2
);
if
(
qemuDomainDefFormatBuf
(
driver
,
mig
->
persistent
,
VIR_DOMAIN_XML_INACTIVE
|
...
...
@@ -628,19 +637,19 @@ qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver,
VIR_DOMAIN_XML_MIGRATABLE
,
buf
)
<
0
)
return
-
1
;
virBufferAdjustIndent
(
buf
,
-
2
);
}
if
((
mig
->
flags
&
QEMU_MIGRATION_COOKIE_NETWORK
)
&&
mig
->
network
)
qemuMigrationCookieNetworkXMLFormat
(
buf
,
mig
->
network
);
if
((
mig
->
flags
&
QEMU_MIGRATION_COOKIE_NBD
)
&&
mig
->
nbd
)
{
virBufferAddLit
(
buf
,
"
<nbd"
);
virBufferAddLit
(
buf
,
"<nbd"
);
if
(
mig
->
nbd
->
port
)
virBufferAsprintf
(
buf
,
" port='%d'"
,
mig
->
nbd
->
port
);
virBufferAddLit
(
buf
,
"/>
\n
"
);
}
virBufferAdjustIndent
(
buf
,
-
2
);
virBufferAddLit
(
buf
,
"</qemu-migration>
\n
"
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录