Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
eda9fa64
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(gitcode.net)2024年7月9日维护升级公告
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
eda9fa64
编写于
5月 21, 2013
作者:
O
Osier Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
src/test: Remove the whitespace before ';'
上级
89806134
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
40 addition
and
40 deletion
+40
-40
src/test/test_driver.c
src/test/test_driver.c
+40
-40
未找到文件。
src/test/test_driver.c
浏览文件 @
eda9fa64
...
...
@@ -192,7 +192,7 @@ testBuildCapabilities(virConnectPtr conn) {
goto
no_memory
;
}
for
(
i
=
0
;
i
<
ARRAY_CARDINALITY
(
guest_types
)
;
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_CARDINALITY
(
guest_types
);
i
++
)
{
if
((
guest
=
virCapabilitiesAddGuest
(
caps
,
guest_types
[
i
],
VIR_ARCH_I686
,
...
...
@@ -343,7 +343,7 @@ testDomainGenerateIfname(virDomainDefPtr domdef) {
}
/* Generate network interface names */
for
(
i
=
0
;
i
<
domdef
->
nnets
;
i
++
)
{
for
(
i
=
0
;
i
<
domdef
->
nnets
;
i
++
)
{
if
(
domdef
->
nets
[
i
]
->
ifname
&&
STREQ
(
domdef
->
nets
[
i
]
->
ifname
,
ifname
))
{
found
=
1
;
...
...
@@ -559,7 +559,7 @@ static int testOpenDefault(virConnectPtr conn) {
privconn
->
cells
[
u
].
numCpus
=
8
;
privconn
->
cells
[
u
].
mem
=
(
u
+
1
)
*
2048
*
1024
;
}
for
(
u
=
0
;
u
<
16
;
u
++
)
{
for
(
u
=
0
;
u
<
16
;
u
++
)
{
virBitmapPtr
siblings
=
virBitmapNew
(
16
);
if
(
!
siblings
)
{
virReportOOMError
();
...
...
@@ -721,7 +721,7 @@ static int testOpenVolumesForPool(xmlDocPtr xml,
goto
error
;
}
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
char
*
relFile
=
virXMLPropString
(
vols
[
i
],
"file"
);
if
(
relFile
!=
NULL
)
{
char
*
absFile
=
testBuildFilename
(
file
,
relFile
);
...
...
@@ -911,7 +911,7 @@ static int testOpenFromFile(virConnectPtr conn,
goto
error
;
}
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
virDomainDefPtr
def
;
char
*
relFile
=
virXMLPropString
(
domains
[
i
],
"file"
);
if
(
relFile
!=
NULL
)
{
...
...
@@ -960,7 +960,7 @@ static int testOpenFromFile(virConnectPtr conn,
if
(
ret
<
0
)
{
goto
error
;
}
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
virNetworkDefPtr
def
;
char
*
relFile
=
virXMLPropString
(
networks
[
i
],
"file"
);
if
(
relFile
!=
NULL
)
{
...
...
@@ -995,7 +995,7 @@ static int testOpenFromFile(virConnectPtr conn,
if
(
ret
<
0
)
{
goto
error
;
}
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
virInterfaceDefPtr
def
;
char
*
relFile
=
virXMLPropString
(
ifaces
[
i
],
"file"
);
if
(
relFile
!=
NULL
)
{
...
...
@@ -1031,7 +1031,7 @@ static int testOpenFromFile(virConnectPtr conn,
if
(
ret
<
0
)
{
goto
error
;
}
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
virStoragePoolDefPtr
def
;
virStoragePoolObjPtr
pool
;
char
*
relFile
=
virXMLPropString
(
pools
[
i
],
"file"
);
...
...
@@ -1081,7 +1081,7 @@ static int testOpenFromFile(virConnectPtr conn,
if
(
ret
<
0
)
{
goto
error
;
}
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
virNodeDeviceDefPtr
def
;
virNodeDeviceObjPtr
dev
;
char
*
relFile
=
virXMLPropString
(
devs
[
i
],
"file"
);
...
...
@@ -1408,7 +1408,7 @@ static virDomainPtr testDomainLookupByUUID(virConnectPtr conn,
{
testConnPtr
privconn
=
conn
->
privateData
;
virDomainPtr
ret
=
NULL
;
virDomainObjPtr
dom
;
virDomainObjPtr
dom
;
testDriverLock
(
privconn
);
dom
=
virDomainObjListFindByUUID
(
privconn
->
domains
,
uuid
);
...
...
@@ -2347,7 +2347,7 @@ static int testDomainGetVcpus(virDomainPtr domain,
if
(
info
!=
NULL
)
{
memset
(
info
,
0
,
sizeof
(
*
info
)
*
maxinfo
);
for
(
i
=
0
;
i
<
maxinfo
;
i
++
)
{
for
(
i
=
0
;
i
<
maxinfo
;
i
++
)
{
virVcpuInfo
privinfo
=
privdomdata
->
vcpu_infos
[
i
];
info
[
i
].
number
=
privinfo
.
number
;
...
...
@@ -2364,10 +2364,10 @@ static int testDomainGetVcpus(virDomainPtr domain,
int
privmaplen
=
VIR_CPU_MAPLEN
(
hostcpus
);
memset
(
cpumaps
,
0
,
maplen
*
maxinfo
);
for
(
v
=
0
;
v
<
maxinfo
;
v
++
)
{
for
(
v
=
0
;
v
<
maxinfo
;
v
++
)
{
unsigned
char
*
cpumap
=
VIR_GET_CPUMAP
(
cpumaps
,
maplen
,
v
);
for
(
i
=
0
;
i
<
maxcpu
;
i
++
)
{
for
(
i
=
0
;
i
<
maxcpu
;
i
++
)
{
if
(
VIR_CPU_USABLE
(
privdomdata
->
cpumaps
,
privmaplen
,
v
,
i
))
{
VIR_USE_CPU
(
cpumap
,
i
);
}
...
...
@@ -2426,7 +2426,7 @@ static int testDomainPinVcpu(virDomainPtr domain,
privcpumap
=
VIR_GET_CPUMAP
(
privdomdata
->
cpumaps
,
privmaplen
,
vcpu
);
memset
(
privcpumap
,
0
,
privmaplen
);
for
(
i
=
0
;
i
<
maxcpu
;
i
++
)
{
for
(
i
=
0
;
i
<
maxcpu
;
i
++
)
{
if
(
VIR_CPU_USABLE
(
cpumap
,
maplen
,
0
,
i
))
{
VIR_USE_CPU
(
privcpumap
,
i
);
}
...
...
@@ -2558,7 +2558,7 @@ static int testNodeGetCellsFreeMemory(virConnectPtr conn,
}
for
(
i
=
startCell
,
j
=
0
;
(
i
<
privconn
->
numCells
&&
j
<
maxCells
)
;
(
i
<
privconn
->
numCells
&&
j
<
maxCells
);
++
i
,
++
j
)
{
freemems
[
j
]
=
privconn
->
cells
[
i
].
mem
;
}
...
...
@@ -2890,7 +2890,7 @@ static int testDomainInterfaceStats(virDomainPtr domain,
goto
error
;
}
for
(
i
=
0
;
i
<
privdom
->
def
->
nnets
;
i
++
)
{
for
(
i
=
0
;
i
<
privdom
->
def
->
nnets
;
i
++
)
{
if
(
privdom
->
def
->
nets
[
i
]
->
ifname
&&
STREQ
(
privdom
->
def
->
nets
[
i
]
->
ifname
,
path
))
{
found
=
1
;
...
...
@@ -3001,7 +3001,7 @@ static int testConnectNumOfNetworks(virConnectPtr conn) {
int
numActive
=
0
,
i
;
testDriverLock
(
privconn
);
for
(
i
=
0
;
i
<
privconn
->
networks
.
count
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
networks
.
count
;
i
++
)
{
virNetworkObjLock
(
privconn
->
networks
.
objs
[
i
]);
if
(
virNetworkObjIsActive
(
privconn
->
networks
.
objs
[
i
]))
numActive
++
;
...
...
@@ -3018,7 +3018,7 @@ static int testConnectListNetworks(virConnectPtr conn, char **const names, int n
testDriverLock
(
privconn
);
memset
(
names
,
0
,
sizeof
(
*
names
)
*
nnames
);
for
(
i
=
0
;
i
<
privconn
->
networks
.
count
&&
n
<
nnames
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
networks
.
count
&&
n
<
nnames
;
i
++
)
{
virNetworkObjLock
(
privconn
->
networks
.
objs
[
i
]);
if
(
virNetworkObjIsActive
(
privconn
->
networks
.
objs
[
i
])
&&
VIR_STRDUP
(
names
[
n
++
],
privconn
->
networks
.
objs
[
i
]
->
def
->
name
)
<
0
)
{
...
...
@@ -3032,7 +3032,7 @@ static int testConnectListNetworks(virConnectPtr conn, char **const names, int n
return
n
;
error:
for
(
n
=
0
;
n
<
nnames
;
n
++
)
for
(
n
=
0
;
n
<
nnames
;
n
++
)
VIR_FREE
(
names
[
n
]);
testDriverUnlock
(
privconn
);
return
-
1
;
...
...
@@ -3043,7 +3043,7 @@ static int testConnectNumOfDefinedNetworks(virConnectPtr conn) {
int
numInactive
=
0
,
i
;
testDriverLock
(
privconn
);
for
(
i
=
0
;
i
<
privconn
->
networks
.
count
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
networks
.
count
;
i
++
)
{
virNetworkObjLock
(
privconn
->
networks
.
objs
[
i
]);
if
(
!
virNetworkObjIsActive
(
privconn
->
networks
.
objs
[
i
]))
numInactive
++
;
...
...
@@ -3060,7 +3060,7 @@ static int testConnectListDefinedNetworks(virConnectPtr conn, char **const names
testDriverLock
(
privconn
);
memset
(
names
,
0
,
sizeof
(
*
names
)
*
nnames
);
for
(
i
=
0
;
i
<
privconn
->
networks
.
count
&&
n
<
nnames
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
networks
.
count
&&
n
<
nnames
;
i
++
)
{
virNetworkObjLock
(
privconn
->
networks
.
objs
[
i
]);
if
(
!
virNetworkObjIsActive
(
privconn
->
networks
.
objs
[
i
])
&&
VIR_STRDUP
(
names
[
n
++
],
privconn
->
networks
.
objs
[
i
]
->
def
->
name
)
<
0
)
{
...
...
@@ -3074,7 +3074,7 @@ static int testConnectListDefinedNetworks(virConnectPtr conn, char **const names
return
n
;
error:
for
(
n
=
0
;
n
<
nnames
;
n
++
)
for
(
n
=
0
;
n
<
nnames
;
n
++
)
VIR_FREE
(
names
[
n
]);
testDriverUnlock
(
privconn
);
return
-
1
;
...
...
@@ -3469,7 +3469,7 @@ static int testConnectNumOfInterfaces(virConnectPtr conn)
int
i
,
count
=
0
;
testDriverLock
(
privconn
);
for
(
i
=
0
;
(
i
<
privconn
->
ifaces
.
count
);
i
++
)
{
for
(
i
=
0
;
(
i
<
privconn
->
ifaces
.
count
);
i
++
)
{
virInterfaceObjLock
(
privconn
->
ifaces
.
objs
[
i
]);
if
(
virInterfaceObjIsActive
(
privconn
->
ifaces
.
objs
[
i
]))
{
count
++
;
...
...
@@ -3487,7 +3487,7 @@ static int testConnectListInterfaces(virConnectPtr conn, char **const names, int
testDriverLock
(
privconn
);
memset
(
names
,
0
,
sizeof
(
*
names
)
*
nnames
);
for
(
i
=
0
;
(
i
<
privconn
->
ifaces
.
count
)
&&
(
n
<
nnames
);
i
++
)
{
for
(
i
=
0
;
(
i
<
privconn
->
ifaces
.
count
)
&&
(
n
<
nnames
);
i
++
)
{
virInterfaceObjLock
(
privconn
->
ifaces
.
objs
[
i
]);
if
(
virInterfaceObjIsActive
(
privconn
->
ifaces
.
objs
[
i
]))
{
if
(
VIR_STRDUP
(
names
[
n
++
],
privconn
->
ifaces
.
objs
[
i
]
->
def
->
name
)
<
0
)
{
...
...
@@ -3502,7 +3502,7 @@ static int testConnectListInterfaces(virConnectPtr conn, char **const names, int
return
n
;
error:
for
(
n
=
0
;
n
<
nnames
;
n
++
)
for
(
n
=
0
;
n
<
nnames
;
n
++
)
VIR_FREE
(
names
[
n
]);
testDriverUnlock
(
privconn
);
return
-
1
;
...
...
@@ -3514,7 +3514,7 @@ static int testConnectNumOfDefinedInterfaces(virConnectPtr conn)
int
i
,
count
=
0
;
testDriverLock
(
privconn
);
for
(
i
=
0
;
i
<
privconn
->
ifaces
.
count
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
ifaces
.
count
;
i
++
)
{
virInterfaceObjLock
(
privconn
->
ifaces
.
objs
[
i
]);
if
(
!
virInterfaceObjIsActive
(
privconn
->
ifaces
.
objs
[
i
]))
{
count
++
;
...
...
@@ -3532,7 +3532,7 @@ static int testConnectListDefinedInterfaces(virConnectPtr conn, char **const nam
testDriverLock
(
privconn
);
memset
(
names
,
0
,
sizeof
(
*
names
)
*
nnames
);
for
(
i
=
0
;
(
i
<
privconn
->
ifaces
.
count
)
&&
(
n
<
nnames
);
i
++
)
{
for
(
i
=
0
;
(
i
<
privconn
->
ifaces
.
count
)
&&
(
n
<
nnames
);
i
++
)
{
virInterfaceObjLock
(
privconn
->
ifaces
.
objs
[
i
]);
if
(
!
virInterfaceObjIsActive
(
privconn
->
ifaces
.
objs
[
i
]))
{
if
(
VIR_STRDUP
(
names
[
n
++
],
privconn
->
ifaces
.
objs
[
i
]
->
def
->
name
)
<
0
)
{
...
...
@@ -3547,7 +3547,7 @@ static int testConnectListDefinedInterfaces(virConnectPtr conn, char **const nam
return
n
;
error:
for
(
n
=
0
;
n
<
nnames
;
n
++
)
for
(
n
=
0
;
n
<
nnames
;
n
++
)
VIR_FREE
(
names
[
n
]);
testDriverUnlock
(
privconn
);
return
-
1
;
...
...
@@ -3957,7 +3957,7 @@ testConnectNumOfStoragePools(virConnectPtr conn) {
int
numActive
=
0
,
i
;
testDriverLock
(
privconn
);
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
;
i
++
)
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
;
i
++
)
if
(
virStoragePoolObjIsActive
(
privconn
->
pools
.
objs
[
i
]))
numActive
++
;
testDriverUnlock
(
privconn
);
...
...
@@ -3974,7 +3974,7 @@ testConnectListStoragePools(virConnectPtr conn,
testDriverLock
(
privconn
);
memset
(
names
,
0
,
sizeof
(
*
names
)
*
nnames
);
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
&&
n
<
nnames
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
&&
n
<
nnames
;
i
++
)
{
virStoragePoolObjLock
(
privconn
->
pools
.
objs
[
i
]);
if
(
virStoragePoolObjIsActive
(
privconn
->
pools
.
objs
[
i
])
&&
VIR_STRDUP
(
names
[
n
++
],
privconn
->
pools
.
objs
[
i
]
->
def
->
name
)
<
0
)
{
...
...
@@ -3988,7 +3988,7 @@ testConnectListStoragePools(virConnectPtr conn,
return
n
;
error:
for
(
n
=
0
;
n
<
nnames
;
n
++
)
for
(
n
=
0
;
n
<
nnames
;
n
++
)
VIR_FREE
(
names
[
n
]);
testDriverUnlock
(
privconn
);
return
-
1
;
...
...
@@ -4000,7 +4000,7 @@ testConnectNumOfDefinedStoragePools(virConnectPtr conn) {
int
numInactive
=
0
,
i
;
testDriverLock
(
privconn
);
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
;
i
++
)
{
virStoragePoolObjLock
(
privconn
->
pools
.
objs
[
i
]);
if
(
!
virStoragePoolObjIsActive
(
privconn
->
pools
.
objs
[
i
]))
numInactive
++
;
...
...
@@ -4020,7 +4020,7 @@ testConnectListDefinedStoragePools(virConnectPtr conn,
testDriverLock
(
privconn
);
memset
(
names
,
0
,
sizeof
(
*
names
)
*
nnames
);
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
&&
n
<
nnames
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
&&
n
<
nnames
;
i
++
)
{
virStoragePoolObjLock
(
privconn
->
pools
.
objs
[
i
]);
if
(
!
virStoragePoolObjIsActive
(
privconn
->
pools
.
objs
[
i
])
&&
VIR_STRDUP
(
names
[
n
++
],
privconn
->
pools
.
objs
[
i
]
->
def
->
name
)
<
0
)
{
...
...
@@ -4034,7 +4034,7 @@ testConnectListDefinedStoragePools(virConnectPtr conn,
return
n
;
error:
for
(
n
=
0
;
n
<
nnames
;
n
++
)
for
(
n
=
0
;
n
<
nnames
;
n
++
)
VIR_FREE
(
names
[
n
]);
testDriverUnlock
(
privconn
);
return
-
1
;
...
...
@@ -4631,7 +4631,7 @@ testStoragePoolListVolumes(virStoragePoolPtr pool,
goto
cleanup
;
}
for
(
i
=
0
;
i
<
privpool
->
volumes
.
count
&&
n
<
maxnames
;
i
++
)
{
for
(
i
=
0
;
i
<
privpool
->
volumes
.
count
&&
n
<
maxnames
;
i
++
)
{
if
(
VIR_STRDUP
(
names
[
n
++
],
privpool
->
volumes
.
objs
[
i
]
->
name
)
<
0
)
goto
cleanup
;
}
...
...
@@ -4640,7 +4640,7 @@ testStoragePoolListVolumes(virStoragePoolPtr pool,
return
n
;
cleanup:
for
(
n
=
0
;
n
<
maxnames
;
n
++
)
for
(
n
=
0
;
n
<
maxnames
;
n
++
)
VIR_FREE
(
names
[
i
]);
memset
(
names
,
0
,
maxnames
*
sizeof
(
*
names
));
...
...
@@ -4690,7 +4690,7 @@ testStoragePoolListAllVolumes(virStoragePoolPtr obj,
goto
cleanup
;
}
for
(
i
=
0
;
i
<
pool
->
volumes
.
count
;
i
++
)
{
for
(
i
=
0
;
i
<
pool
->
volumes
.
count
;
i
++
)
{
if
(
!
(
vol
=
virGetStorageVol
(
obj
->
conn
,
pool
->
def
->
name
,
pool
->
volumes
.
objs
[
i
]
->
name
,
pool
->
volumes
.
objs
[
i
]
->
key
,
...
...
@@ -4770,7 +4770,7 @@ testStorageVolLookupByKey(virConnectPtr conn,
virStorageVolPtr
ret
=
NULL
;
testDriverLock
(
privconn
);
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
;
i
++
)
{
virStoragePoolObjLock
(
privconn
->
pools
.
objs
[
i
]);
if
(
virStoragePoolObjIsActive
(
privconn
->
pools
.
objs
[
i
]))
{
virStorageVolDefPtr
privvol
=
...
...
@@ -4805,7 +4805,7 @@ testStorageVolLookupByPath(virConnectPtr conn,
virStorageVolPtr
ret
=
NULL
;
testDriverLock
(
privconn
);
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
;
i
++
)
{
for
(
i
=
0
;
i
<
privconn
->
pools
.
count
;
i
++
)
{
virStoragePoolObjLock
(
privconn
->
pools
.
objs
[
i
]);
if
(
virStoragePoolObjIsActive
(
privconn
->
pools
.
objs
[
i
]))
{
virStorageVolDefPtr
privvol
=
...
...
@@ -5048,7 +5048,7 @@ testStorageVolDelete(virStorageVolPtr vol,
privpool
->
def
->
available
=
(
privpool
->
def
->
capacity
-
privpool
->
def
->
allocation
);
for
(
i
=
0
;
i
<
privpool
->
volumes
.
count
;
i
++
)
{
for
(
i
=
0
;
i
<
privpool
->
volumes
.
count
;
i
++
)
{
if
(
privpool
->
volumes
.
objs
[
i
]
==
privvol
)
{
virStorageVolDefFree
(
privvol
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录