Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
c651e08c
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,发现更多精彩内容 >>
提交
c651e08c
编写于
11月 13, 2014
作者:
M
Martin Kletzander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary curly brackets in src/test/test_driver.c
Signed-off-by:
N
Martin Kletzander
<
mkletzan@redhat.com
>
上级
e7a1da8a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
38 deletion
+19
-38
src/test/test_driver.c
src/test/test_driver.c
+19
-38
未找到文件。
src/test/test_driver.c
浏览文件 @
c651e08c
...
...
@@ -960,9 +960,8 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt)
nodeInfo
->
sockets
*
nodeInfo
->
nodes
);
ret
=
virXPathLong
(
"string(/node/cpu/active[1])"
,
ctxt
,
&
l
);
if
(
ret
==
0
)
{
if
(
l
<
nodeInfo
->
cpus
)
{
if
(
l
<
nodeInfo
->
cpus
)
nodeInfo
->
cpus
=
l
;
}
}
else
if
(
ret
==
-
2
)
{
virReportError
(
VIR_ERR_XML_ERROR
,
"%s"
,
_
(
"invalid node cpu active value"
));
...
...
@@ -1070,9 +1069,8 @@ testParseDomains(testConnPtr privconn,
virDomainObjPtr
obj
;
num
=
virXPathNodeSet
(
"/node/domain"
,
ctxt
,
&
nodes
);
if
(
num
<
0
)
{
if
(
num
<
0
)
goto
error
;
}
for
(
i
=
0
;
i
<
num
;
i
++
)
{
virDomainDefPtr
def
;
...
...
@@ -1137,9 +1135,8 @@ testParseNetworks(testConnPtr privconn,
virNetworkObjPtr
obj
;
num
=
virXPathNodeSet
(
"/node/network"
,
ctxt
,
&
nodes
);
if
(
num
<
0
)
{
if
(
num
<
0
)
goto
error
;
}
for
(
i
=
0
;
i
<
num
;
i
++
)
{
virNetworkDefPtr
def
;
...
...
@@ -1177,9 +1174,8 @@ testParseInterfaces(testConnPtr privconn,
virInterfaceObjPtr
obj
;
num
=
virXPathNodeSet
(
"/node/interface"
,
ctxt
,
&
nodes
);
if
(
num
<
0
)
{
if
(
num
<
0
)
goto
error
;
}
for
(
i
=
0
;
i
<
num
;
i
++
)
{
virInterfaceDefPtr
def
;
...
...
@@ -1225,9 +1221,8 @@ testOpenVolumesForPool(const char *file,
num
=
virXPathNodeSet
(
vol_xpath
,
ctxt
,
&
nodes
);
VIR_FREE
(
vol_xpath
);
if
(
num
<
0
)
{
if
(
num
<
0
)
goto
error
;
}
for
(
i
=
0
;
i
<
num
;
i
++
)
{
xmlNodePtr
node
=
testParseXMLDocFromFile
(
nodes
[
i
],
file
,
...
...
@@ -1275,9 +1270,8 @@ testParseStorage(testConnPtr privconn,
virStoragePoolObjPtr
obj
;
num
=
virXPathNodeSet
(
"/node/pool"
,
ctxt
,
&
nodes
);
if
(
num
<
0
)
{
if
(
num
<
0
)
goto
error
;
}
for
(
i
=
0
;
i
<
num
;
i
++
)
{
virStoragePoolDefPtr
def
;
...
...
@@ -1328,9 +1322,8 @@ testParseNodedevs(testConnPtr privconn,
virNodeDeviceObjPtr
obj
;
num
=
virXPathNodeSet
(
"/node/device"
,
ctxt
,
&
nodes
);
if
(
num
<
0
)
{
if
(
num
<
0
)
goto
error
;
}
for
(
i
=
0
;
i
<
num
;
i
++
)
{
virNodeDeviceDefPtr
def
;
...
...
@@ -1430,9 +1423,8 @@ testOpenFromFile(virConnectPtr conn, const char *file)
if
(
!
(
privconn
->
eventState
=
virObjectEventStateNew
()))
goto
error
;
if
(
!
(
doc
=
virXMLParseFileCtxt
(
file
,
&
ctxt
)))
{
if
(
!
(
doc
=
virXMLParseFileCtxt
(
file
,
&
ctxt
)))
goto
error
;
}
if
(
!
xmlStrEqual
(
ctxt
->
node
->
name
,
BAD_CAST
"node"
))
{
virReportError
(
VIR_ERR_XML_ERROR
,
"%s"
,
...
...
@@ -2713,9 +2705,8 @@ testDomainSetVcpusFlags(virDomainPtr domain, unsigned int nrCpus,
case
VIR_DOMAIN_AFFECT_LIVE
|
VIR_DOMAIN_AFFECT_CONFIG
:
ret
=
testDomainUpdateVCPUs
(
privconn
,
privdom
,
nrCpus
,
0
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
persistentDef
->
vcpus
=
nrCpus
;
}
break
;
}
...
...
@@ -2806,9 +2797,8 @@ static int testDomainGetVcpus(virDomainPtr domain,
unsigned
char
*
cpumap
=
VIR_GET_CPUMAP
(
cpumaps
,
maplen
,
v
);
for
(
i
=
0
;
i
<
maxcpu
;
i
++
)
{
if
(
VIR_CPU_USABLE
(
privdomdata
->
cpumaps
,
privmaplen
,
v
,
i
))
{
if
(
VIR_CPU_USABLE
(
privdomdata
->
cpumaps
,
privmaplen
,
v
,
i
))
VIR_USE_CPU
(
cpumap
,
i
);
}
}
}
}
...
...
@@ -2866,9 +2856,8 @@ static int testDomainPinVcpu(virDomainPtr domain,
memset
(
privcpumap
,
0
,
privmaplen
);
for
(
i
=
0
;
i
<
maxcpu
;
i
++
)
{
if
(
VIR_CPU_USABLE
(
cpumap
,
maplen
,
0
,
i
))
{
if
(
VIR_CPU_USABLE
(
cpumap
,
maplen
,
0
,
i
))
VIR_USE_CPU
(
privcpumap
,
i
);
}
}
ret
=
0
;
...
...
@@ -4064,9 +4053,8 @@ static int testConnectNumOfInterfaces(virConnectPtr conn)
testDriverLock
(
privconn
);
for
(
i
=
0
;
(
i
<
privconn
->
ifaces
.
count
);
i
++
)
{
virInterfaceObjLock
(
privconn
->
ifaces
.
objs
[
i
]);
if
(
virInterfaceObjIsActive
(
privconn
->
ifaces
.
objs
[
i
]))
{
if
(
virInterfaceObjIsActive
(
privconn
->
ifaces
.
objs
[
i
]))
count
++
;
}
virInterfaceObjUnlock
(
privconn
->
ifaces
.
objs
[
i
]);
}
testDriverUnlock
(
privconn
);
...
...
@@ -4111,9 +4099,8 @@ static int testConnectNumOfDefinedInterfaces(virConnectPtr conn)
testDriverLock
(
privconn
);
for
(
i
=
0
;
i
<
privconn
->
ifaces
.
count
;
i
++
)
{
virInterfaceObjLock
(
privconn
->
ifaces
.
objs
[
i
]);
if
(
!
virInterfaceObjIsActive
(
privconn
->
ifaces
.
objs
[
i
]))
{
if
(
!
virInterfaceObjIsActive
(
privconn
->
ifaces
.
objs
[
i
]))
count
++
;
}
virInterfaceObjUnlock
(
privconn
->
ifaces
.
objs
[
i
]);
}
testDriverUnlock
(
privconn
);
...
...
@@ -6058,14 +6045,12 @@ testNodeDeviceCreateXML(virConnectPtr conn,
testDriverLock
(
driver
);
def
=
virNodeDeviceDefParseString
(
xmlDesc
,
CREATE_DEVICE
,
NULL
);
if
(
def
==
NULL
)
{
if
(
def
==
NULL
)
goto
cleanup
;
}
/* We run these next two simply for validation */
if
(
virNodeDeviceGetWWNs
(
def
,
&
wwnn
,
&
wwpn
)
==
-
1
)
{
if
(
virNodeDeviceGetWWNs
(
def
,
&
wwnn
,
&
wwpn
)
==
-
1
)
goto
cleanup
;
}
if
(
virNodeDeviceGetParentHost
(
&
driver
->
devs
,
def
->
name
,
...
...
@@ -6093,9 +6078,8 @@ testNodeDeviceCreateXML(virConnectPtr conn,
}
if
(
!
(
obj
=
virNodeDeviceAssignDef
(
&
driver
->
devs
,
def
)))
{
if
(
!
(
obj
=
virNodeDeviceAssignDef
(
&
driver
->
devs
,
def
)))
goto
cleanup
;
}
virNodeDeviceObjUnlock
(
obj
);
dev
=
virGetNodeDevice
(
conn
,
def
->
name
);
...
...
@@ -6126,9 +6110,8 @@ testNodeDeviceDestroy(virNodeDevicePtr dev)
goto
out
;
}
if
(
virNodeDeviceGetWWNs
(
obj
->
def
,
&
wwnn
,
&
wwpn
)
==
-
1
)
{
if
(
virNodeDeviceGetWWNs
(
obj
->
def
,
&
wwnn
,
&
wwpn
)
==
-
1
)
goto
out
;
}
if
(
VIR_STRDUP
(
parent_name
,
obj
->
def
->
parent
)
<
0
)
goto
out
;
...
...
@@ -7033,9 +7016,8 @@ testDomainSnapshotReparentChildren(void *payload,
virDomainSnapshotObjPtr
snap
=
payload
;
testSnapReparentDataPtr
rep
=
data
;
if
(
rep
->
err
<
0
)
{
if
(
rep
->
err
<
0
)
return
;
}
VIR_FREE
(
snap
->
def
->
parent
);
snap
->
parent
=
rep
->
parent
;
...
...
@@ -7077,9 +7059,8 @@ testDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
testDomainSnapshotDiscardAll
,
&
rem
);
if
(
rem
.
current
)
{
if
(
flags
&
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY
)
{
if
(
flags
&
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY
)
snap
->
def
->
current
=
true
;
}
vm
->
current_snapshot
=
snap
;
}
}
else
if
(
snap
->
nchildren
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录