Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
f5e65e4b
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,发现更多精彩内容 >>
提交
f5e65e4b
编写于
11月 13, 2014
作者:
M
Martin Kletzander
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary curly brackets in tests/
Signed-off-by:
N
Martin Kletzander
<
mkletzan@redhat.com
>
上级
91cc3d95
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
38 addition
and
76 deletion
+38
-76
tests/commandhelper.c
tests/commandhelper.c
+1
-2
tests/esxutilstest.c
tests/esxutilstest.c
+4
-8
tests/eventtest.c
tests/eventtest.c
+1
-2
tests/openvzutilstest.c
tests/openvzutilstest.c
+2
-4
tests/securityselinuxlabeltest.c
tests/securityselinuxlabeltest.c
+2
-4
tests/shunloadtest.c
tests/shunloadtest.c
+2
-4
tests/utiltest.c
tests/utiltest.c
+1
-2
tests/virbuftest.c
tests/virbuftest.c
+1
-2
tests/virhashtest.c
tests/virhashtest.c
+10
-20
tests/virtimetest.c
tests/virtimetest.c
+1
-2
tests/vmx2xmltest.c
tests/vmx2xmltest.c
+4
-8
tests/xml2vmxtest.c
tests/xml2vmxtest.c
+9
-18
未找到文件。
tests/commandhelper.c
浏览文件 @
f5e65e4b
...
@@ -70,9 +70,8 @@ int main(int argc, char **argv) {
...
@@ -70,9 +70,8 @@ int main(int argc, char **argv) {
if
(
!
log
)
if
(
!
log
)
goto
cleanup
;
goto
cleanup
;
for
(
i
=
1
;
i
<
argc
;
i
++
)
{
for
(
i
=
1
;
i
<
argc
;
i
++
)
fprintf
(
log
,
"ARG:%s
\n
"
,
argv
[
i
]);
fprintf
(
log
,
"ARG:%s
\n
"
,
argv
[
i
]);
}
origenv
=
environ
;
origenv
=
environ
;
n
=
0
;
n
=
0
;
...
...
tests/esxutilstest.c
浏览文件 @
f5e65e4b
...
@@ -54,9 +54,8 @@ testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
...
@@ -54,9 +54,8 @@ testParseDatastorePath(const void *data ATTRIBUTE_UNUSED)
goto
failure
;
goto
failure
;
}
}
if
(
paths
[
i
].
result
<
0
)
{
if
(
paths
[
i
].
result
<
0
)
continue
;
continue
;
}
if
(
STRNEQ
(
paths
[
i
].
datastoreName
,
datastoreName
))
{
if
(
STRNEQ
(
paths
[
i
].
datastoreName
,
datastoreName
))
{
virtTestDifference
(
stderr
,
paths
[
i
].
datastoreName
,
datastoreName
);
virtTestDifference
(
stderr
,
paths
[
i
].
datastoreName
,
datastoreName
);
...
@@ -138,10 +137,9 @@ testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED)
...
@@ -138,10 +137,9 @@ testConvertDateTimeToCalendarTime(const void *data ATTRIBUTE_UNUSED)
return
-
1
;
return
-
1
;
}
}
if
(
times
[
i
].
calendarTime
!=
calendarTime
)
{
if
(
times
[
i
].
calendarTime
!=
calendarTime
)
return
-
1
;
return
-
1
;
}
}
}
return
0
;
return
0
;
}
}
...
@@ -186,9 +184,8 @@ testEscapeDatastoreItem(const void *data ATTRIBUTE_UNUSED)
...
@@ -186,9 +184,8 @@ testEscapeDatastoreItem(const void *data ATTRIBUTE_UNUSED)
escaped
=
esxUtil_EscapeDatastoreItem
(
datastoreItems
[
i
].
string
);
escaped
=
esxUtil_EscapeDatastoreItem
(
datastoreItems
[
i
].
string
);
if
(
escaped
==
NULL
)
{
if
(
escaped
==
NULL
)
return
-
1
;
return
-
1
;
}
if
(
STRNEQ
(
datastoreItems
[
i
].
escaped
,
escaped
))
{
if
(
STRNEQ
(
datastoreItems
[
i
].
escaped
,
escaped
))
{
VIR_FREE
(
escaped
);
VIR_FREE
(
escaped
);
...
@@ -228,9 +225,8 @@ testConvertWindows1252ToUTF8(const void *data ATTRIBUTE_UNUSED)
...
@@ -228,9 +225,8 @@ testConvertWindows1252ToUTF8(const void *data ATTRIBUTE_UNUSED)
utf8
=
virVMXConvertToUTF8
(
"Windows-1252"
,
utf8
=
virVMXConvertToUTF8
(
"Windows-1252"
,
windows1252ToUTF8
[
i
].
windows1252
);
windows1252ToUTF8
[
i
].
windows1252
);
if
(
utf8
==
NULL
)
{
if
(
utf8
==
NULL
)
return
-
1
;
return
-
1
;
}
if
(
STRNEQ
(
windows1252ToUTF8
[
i
].
utf8
,
utf8
))
{
if
(
STRNEQ
(
windows1252ToUTF8
[
i
].
utf8
,
utf8
))
{
VIR_FREE
(
utf8
);
VIR_FREE
(
utf8
);
...
...
tests/eventtest.c
浏览文件 @
f5e65e4b
...
@@ -124,9 +124,8 @@ static int eventThreadJobDone;
...
@@ -124,9 +124,8 @@ static int eventThreadJobDone;
ATTRIBUTE_NORETURN
static
void
*
eventThreadLoop
(
void
*
data
ATTRIBUTE_UNUSED
)
{
ATTRIBUTE_NORETURN
static
void
*
eventThreadLoop
(
void
*
data
ATTRIBUTE_UNUSED
)
{
while
(
1
)
{
while
(
1
)
{
pthread_mutex_lock
(
&
eventThreadMutex
);
pthread_mutex_lock
(
&
eventThreadMutex
);
while
(
!
eventThreadRunOnce
)
{
while
(
!
eventThreadRunOnce
)
pthread_cond_wait
(
&
eventThreadRunCond
,
&
eventThreadMutex
);
pthread_cond_wait
(
&
eventThreadRunCond
,
&
eventThreadMutex
);
}
eventThreadRunOnce
=
0
;
eventThreadRunOnce
=
0
;
pthread_mutex_unlock
(
&
eventThreadMutex
);
pthread_mutex_unlock
(
&
eventThreadMutex
);
...
...
tests/openvzutilstest.c
浏览文件 @
f5e65e4b
...
@@ -42,9 +42,8 @@ testReadConfigParam(const void *data ATTRIBUTE_UNUSED)
...
@@ -42,9 +42,8 @@ testReadConfigParam(const void *data ATTRIBUTE_UNUSED)
char
*
conf
=
NULL
;
char
*
conf
=
NULL
;
char
*
value
=
NULL
;
char
*
value
=
NULL
;
if
(
virAsprintf
(
&
conf
,
"%s/openvzutilstest.conf"
,
abs_srcdir
)
<
0
)
{
if
(
virAsprintf
(
&
conf
,
"%s/openvzutilstest.conf"
,
abs_srcdir
)
<
0
)
return
-
1
;
return
-
1
;
}
for
(
i
=
0
;
i
<
ARRAY_CARDINALITY
(
configParams
);
++
i
)
{
for
(
i
=
0
;
i
<
ARRAY_CARDINALITY
(
configParams
);
++
i
)
{
if
(
openvzReadConfigParam
(
conf
,
configParams
[
i
].
param
,
if
(
openvzReadConfigParam
(
conf
,
configParams
[
i
].
param
,
...
@@ -52,9 +51,8 @@ testReadConfigParam(const void *data ATTRIBUTE_UNUSED)
...
@@ -52,9 +51,8 @@ testReadConfigParam(const void *data ATTRIBUTE_UNUSED)
goto
cleanup
;
goto
cleanup
;
}
}
if
(
configParams
[
i
].
ret
!=
1
)
{
if
(
configParams
[
i
].
ret
!=
1
)
continue
;
continue
;
}
if
(
STRNEQ
(
configParams
[
i
].
value
,
value
))
{
if
(
STRNEQ
(
configParams
[
i
].
value
,
value
))
{
virtTestDifference
(
stderr
,
configParams
[
i
].
value
,
value
);
virtTestDifference
(
stderr
,
configParams
[
i
].
value
,
value
);
...
...
tests/securityselinuxlabeltest.c
浏览文件 @
f5e65e4b
...
@@ -120,9 +120,8 @@ testSELinuxLoadFileList(const char *testname,
...
@@ -120,9 +120,8 @@ testSELinuxLoadFileList(const char *testname,
abs_srcdir
,
testname
)
<
0
)
abs_srcdir
,
testname
)
<
0
)
goto
cleanup
;
goto
cleanup
;
if
(
!
(
fp
=
fopen
(
path
,
"r"
)))
{
if
(
!
(
fp
=
fopen
(
path
,
"r"
)))
goto
cleanup
;
goto
cleanup
;
}
if
(
VIR_ALLOC_N
(
line
,
1024
)
<
0
)
if
(
VIR_ALLOC_N
(
line
,
1024
)
<
0
)
goto
cleanup
;
goto
cleanup
;
...
@@ -191,9 +190,8 @@ testSELinuxLoadDef(const char *testname)
...
@@ -191,9 +190,8 @@ testSELinuxLoadDef(const char *testname)
abs_srcdir
,
testname
)
<
0
)
abs_srcdir
,
testname
)
<
0
)
goto
cleanup
;
goto
cleanup
;
if
(
virFileReadAll
(
xmlfile
,
1024
*
1024
,
&
xmlstr
)
<
0
)
{
if
(
virFileReadAll
(
xmlfile
,
1024
*
1024
,
&
xmlstr
)
<
0
)
goto
cleanup
;
goto
cleanup
;
}
if
(
!
(
def
=
virDomainDefParseString
(
xmlstr
,
caps
,
xmlopt
,
if
(
!
(
def
=
virDomainDefParseString
(
xmlstr
,
caps
,
xmlopt
,
QEMU_EXPECTED_VIRT_TYPES
,
QEMU_EXPECTED_VIRT_TYPES
,
...
...
tests/shunloadtest.c
浏览文件 @
f5e65e4b
...
@@ -74,9 +74,8 @@ static void *threadMain(void *arg)
...
@@ -74,9 +74,8 @@ static void *threadMain(void *arg)
pthread_cond_signal
(
&
cond
);
pthread_cond_signal
(
&
cond
);
}
}
while
(
!
quit
)
{
while
(
!
quit
)
pthread_cond_wait
(
&
cond
,
&
lock
);
pthread_cond_wait
(
&
cond
,
&
lock
);
}
pthread_mutex_unlock
(
&
lock
);
pthread_mutex_unlock
(
&
lock
);
return
NULL
;
return
NULL
;
...
@@ -126,9 +125,8 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv)
...
@@ -126,9 +125,8 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv)
/* Wait for the thread to start and call libvirt */
/* Wait for the thread to start and call libvirt */
pthread_mutex_lock
(
&
lock
);
pthread_mutex_lock
(
&
lock
);
while
(
!
running
&&
!
failstart
)
{
while
(
!
running
&&
!
failstart
)
pthread_cond_wait
(
&
cond
,
&
lock
);
pthread_cond_wait
(
&
cond
,
&
lock
);
}
/* Close the shared library (and thus make libvirt.so
/* Close the shared library (and thus make libvirt.so
* non-resident */
* non-resident */
...
...
tests/utiltest.c
浏览文件 @
f5e65e4b
...
@@ -124,9 +124,8 @@ testParseVersionString(const void *data ATTRIBUTE_UNUSED)
...
@@ -124,9 +124,8 @@ testParseVersionString(const void *data ATTRIBUTE_UNUSED)
return
-
1
;
return
-
1
;
}
}
if
(
result
<
0
)
{
if
(
result
<
0
)
continue
;
continue
;
}
if
(
version
!=
versions
[
i
].
version
)
{
if
(
version
!=
versions
[
i
].
version
)
{
if
(
virTestGetDebug
()
>
0
)
{
if
(
virTestGetDebug
()
>
0
)
{
...
...
tests/virbuftest.c
浏览文件 @
f5e65e4b
...
@@ -38,9 +38,8 @@ static int testBufInfiniteLoop(const void *data)
...
@@ -38,9 +38,8 @@ static int testBufInfiniteLoop(const void *data)
* which was the case after the above addchar at the time of the bug.
* which was the case after the above addchar at the time of the bug.
* This test is a bit fragile, since it relies on virBuffer internals.
* This test is a bit fragile, since it relies on virBuffer internals.
*/
*/
if
(
virAsprintf
(
&
addstr
,
"%*s"
,
buf
->
a
-
buf
->
b
-
1
,
"a"
)
<
0
)
{
if
(
virAsprintf
(
&
addstr
,
"%*s"
,
buf
->
a
-
buf
->
b
-
1
,
"a"
)
<
0
)
goto
out
;
goto
out
;
}
if
(
info
->
doEscape
)
if
(
info
->
doEscape
)
virBufferEscapeString
(
buf
,
"%s"
,
addstr
);
virBufferEscapeString
(
buf
,
"%s"
,
addstr
);
...
...
tests/virhashtest.c
浏览文件 @
f5e65e4b
...
@@ -531,17 +531,15 @@ testHashGetItems(const void *data ATTRIBUTE_UNUSED)
...
@@ -531,17 +531,15 @@ testHashGetItems(const void *data ATTRIBUTE_UNUSED)
virHashAddEntry
(
hash
,
keya
,
value3
)
<
0
||
virHashAddEntry
(
hash
,
keya
,
value3
)
<
0
||
virHashAddEntry
(
hash
,
keyc
,
value1
)
<
0
||
virHashAddEntry
(
hash
,
keyc
,
value1
)
<
0
||
virHashAddEntry
(
hash
,
keyb
,
value2
)
<
0
)
{
virHashAddEntry
(
hash
,
keyb
,
value2
)
<
0
)
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed to create hash"
);
testError
(
"
\n
failed to create hash"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
if
(
!
(
array
=
virHashGetItems
(
hash
,
NULL
))
||
if
(
!
(
array
=
virHashGetItems
(
hash
,
NULL
))
||
array
[
3
].
key
||
array
[
3
].
value
)
{
array
[
3
].
key
||
array
[
3
].
value
)
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed to get items with NULL sort"
);
testError
(
"
\n
failed to get items with NULL sort"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
VIR_FREE
(
array
);
VIR_FREE
(
array
);
...
@@ -554,9 +552,8 @@ testHashGetItems(const void *data ATTRIBUTE_UNUSED)
...
@@ -554,9 +552,8 @@ testHashGetItems(const void *data ATTRIBUTE_UNUSED)
STRNEQ
(
array
[
2
].
key
,
"c"
)
||
STRNEQ
(
array
[
2
].
key
,
"c"
)
||
STRNEQ
(
array
[
2
].
value
,
"1"
)
||
STRNEQ
(
array
[
2
].
value
,
"1"
)
||
array
[
3
].
key
||
array
[
3
].
value
)
{
array
[
3
].
key
||
array
[
3
].
value
)
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed to get items with key sort"
);
testError
(
"
\n
failed to get items with key sort"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
VIR_FREE
(
array
);
VIR_FREE
(
array
);
...
@@ -569,9 +566,8 @@ testHashGetItems(const void *data ATTRIBUTE_UNUSED)
...
@@ -569,9 +566,8 @@ testHashGetItems(const void *data ATTRIBUTE_UNUSED)
STRNEQ
(
array
[
2
].
key
,
"a"
)
||
STRNEQ
(
array
[
2
].
key
,
"a"
)
||
STRNEQ
(
array
[
2
].
value
,
"3"
)
||
STRNEQ
(
array
[
2
].
value
,
"3"
)
||
array
[
3
].
key
||
array
[
3
].
value
)
{
array
[
3
].
key
||
array
[
3
].
value
)
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed to get items with value sort"
);
testError
(
"
\n
failed to get items with value sort"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
...
@@ -612,44 +608,38 @@ testHashEqual(const void *data ATTRIBUTE_UNUSED)
...
@@ -612,44 +608,38 @@ testHashEqual(const void *data ATTRIBUTE_UNUSED)
virHashAddEntry
(
hash1
,
keyc
,
value3_l
)
<
0
||
virHashAddEntry
(
hash1
,
keyc
,
value3_l
)
<
0
||
virHashAddEntry
(
hash2
,
keya
,
value1_u
)
<
0
||
virHashAddEntry
(
hash2
,
keya
,
value1_u
)
<
0
||
virHashAddEntry
(
hash2
,
keyb
,
value2_u
)
<
0
)
{
virHashAddEntry
(
hash2
,
keyb
,
value2_u
)
<
0
)
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed to create hashes"
);
testError
(
"
\n
failed to create hashes"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
if
(
virHashEqual
(
hash1
,
hash2
,
testHashEqualCompValue
))
{
if
(
virHashEqual
(
hash1
,
hash2
,
testHashEqualCompValue
))
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed equal test for different number of elements"
);
testError
(
"
\n
failed equal test for different number of elements"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
if
(
virHashAddEntry
(
hash2
,
keyc
,
value4_u
)
<
0
)
{
if
(
virHashAddEntry
(
hash2
,
keyc
,
value4_u
)
<
0
)
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed to add element to hash2"
);
testError
(
"
\n
failed to add element to hash2"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
if
(
virHashEqual
(
hash1
,
hash2
,
testHashEqualCompValue
))
{
if
(
virHashEqual
(
hash1
,
hash2
,
testHashEqualCompValue
))
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed equal test for same number of elements"
);
testError
(
"
\n
failed equal test for same number of elements"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
if
(
virHashUpdateEntry
(
hash2
,
keyc
,
value3_u
)
<
0
)
{
if
(
virHashUpdateEntry
(
hash2
,
keyc
,
value3_u
)
<
0
)
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed to update element in hash2"
);
testError
(
"
\n
failed to update element in hash2"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
if
(
!
virHashEqual
(
hash1
,
hash2
,
testHashEqualCompValue
))
{
if
(
!
virHashEqual
(
hash1
,
hash2
,
testHashEqualCompValue
))
{
if
(
virTestGetVerbose
())
{
if
(
virTestGetVerbose
())
testError
(
"
\n
failed equal test for equal hash tables"
);
testError
(
"
\n
failed equal test for equal hash tables"
);
}
goto
cleanup
;
goto
cleanup
;
}
}
...
...
tests/virtimetest.c
浏览文件 @
f5e65e4b
...
@@ -88,9 +88,8 @@ testTimeLocalOffset(const void *args)
...
@@ -88,9 +88,8 @@ testTimeLocalOffset(const void *args)
}
}
tzset
();
tzset
();
if
(
virTimeLocalOffsetFromUTC
(
&
actual
)
<
0
)
{
if
(
virTimeLocalOffsetFromUTC
(
&
actual
)
<
0
)
return
-
1
;
return
-
1
;
}
if
(
data
->
offset
!=
actual
)
{
if
(
data
->
offset
!=
actual
)
{
VIR_DEBUG
(
"Expect Offset %ld got %ld
\n
"
,
VIR_DEBUG
(
"Expect Offset %ld got %ld
\n
"
,
...
...
tests/vmx2xmltest.c
浏览文件 @
f5e65e4b
...
@@ -27,9 +27,8 @@ testCapsInit(void)
...
@@ -27,9 +27,8 @@ testCapsInit(void)
caps
=
virCapabilitiesNew
(
VIR_ARCH_I686
,
true
,
true
);
caps
=
virCapabilitiesNew
(
VIR_ARCH_I686
,
true
,
true
);
if
(
caps
==
NULL
)
{
if
(
caps
==
NULL
)
return
;
return
;
}
virCapabilitiesAddHostMigrateTransport
(
caps
,
"esx"
);
virCapabilitiesAddHostMigrateTransport
(
caps
,
"esx"
);
...
@@ -39,9 +38,8 @@ testCapsInit(void)
...
@@ -39,9 +38,8 @@ testCapsInit(void)
VIR_ARCH_I686
,
VIR_ARCH_I686
,
NULL
,
NULL
,
0
,
NULL
);
NULL
,
NULL
,
0
,
NULL
);
if
(
guest
==
NULL
)
{
if
(
guest
==
NULL
)
goto
failure
;
goto
failure
;
}
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"vmware"
,
NULL
,
NULL
,
0
,
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"vmware"
,
NULL
,
NULL
,
0
,
NULL
)
==
NULL
)
{
NULL
)
==
NULL
)
{
...
@@ -54,9 +52,8 @@ testCapsInit(void)
...
@@ -54,9 +52,8 @@ testCapsInit(void)
VIR_ARCH_X86_64
,
VIR_ARCH_X86_64
,
NULL
,
NULL
,
0
,
NULL
);
NULL
,
NULL
,
0
,
NULL
);
if
(
guest
==
NULL
)
{
if
(
guest
==
NULL
)
goto
failure
;
goto
failure
;
}
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"vmware"
,
NULL
,
NULL
,
0
,
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"vmware"
,
NULL
,
NULL
,
0
,
NULL
)
==
NULL
)
{
NULL
)
==
NULL
)
{
...
@@ -201,9 +198,8 @@ mymain(void)
...
@@ -201,9 +198,8 @@ mymain(void)
testCapsInit
();
testCapsInit
();
if
(
caps
==
NULL
)
{
if
(
caps
==
NULL
)
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
}
if
(
!
(
xmlopt
=
virVMXDomainXMLConfInit
()))
if
(
!
(
xmlopt
=
virVMXDomainXMLConfInit
()))
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
...
...
tests/xml2vmxtest.c
浏览文件 @
f5e65e4b
...
@@ -27,9 +27,8 @@ testCapsInit(void)
...
@@ -27,9 +27,8 @@ testCapsInit(void)
caps
=
virCapabilitiesNew
(
VIR_ARCH_I686
,
true
,
true
);
caps
=
virCapabilitiesNew
(
VIR_ARCH_I686
,
true
,
true
);
if
(
caps
==
NULL
)
{
if
(
caps
==
NULL
)
return
;
return
;
}
virCapabilitiesAddHostMigrateTransport
(
caps
,
"esx"
);
virCapabilitiesAddHostMigrateTransport
(
caps
,
"esx"
);
...
@@ -40,9 +39,8 @@ testCapsInit(void)
...
@@ -40,9 +39,8 @@ testCapsInit(void)
VIR_ARCH_I686
,
VIR_ARCH_I686
,
NULL
,
NULL
,
0
,
NULL
);
NULL
,
NULL
,
0
,
NULL
);
if
(
guest
==
NULL
)
{
if
(
guest
==
NULL
)
goto
failure
;
goto
failure
;
}
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"vmware"
,
NULL
,
NULL
,
0
,
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"vmware"
,
NULL
,
NULL
,
0
,
NULL
)
==
NULL
)
{
NULL
)
==
NULL
)
{
...
@@ -55,9 +53,8 @@ testCapsInit(void)
...
@@ -55,9 +53,8 @@ testCapsInit(void)
VIR_ARCH_X86_64
,
VIR_ARCH_X86_64
,
NULL
,
NULL
,
0
,
NULL
);
NULL
,
NULL
,
0
,
NULL
);
if
(
guest
==
NULL
)
{
if
(
guest
==
NULL
)
goto
failure
;
goto
failure
;
}
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"vmware"
,
NULL
,
NULL
,
0
,
if
(
virCapabilitiesAddGuestDomain
(
guest
,
"vmware"
,
NULL
,
NULL
,
0
,
NULL
)
==
NULL
)
{
NULL
)
==
NULL
)
{
...
@@ -81,21 +78,18 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
...
@@ -81,21 +78,18 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
char
*
formatted
=
NULL
;
char
*
formatted
=
NULL
;
virDomainDefPtr
def
=
NULL
;
virDomainDefPtr
def
=
NULL
;
if
(
virtTestLoadFile
(
xml
,
&
xmlData
)
<
0
)
{
if
(
virtTestLoadFile
(
xml
,
&
xmlData
)
<
0
)
goto
failure
;
goto
failure
;
}
if
(
virtTestLoadFile
(
vmx
,
&
vmxData
)
<
0
)
{
if
(
virtTestLoadFile
(
vmx
,
&
vmxData
)
<
0
)
goto
failure
;
goto
failure
;
}
def
=
virDomainDefParseString
(
xmlData
,
caps
,
xmlopt
,
def
=
virDomainDefParseString
(
xmlData
,
caps
,
xmlopt
,
1
<<
VIR_DOMAIN_VIRT_VMWARE
,
1
<<
VIR_DOMAIN_VIRT_VMWARE
,
VIR_DOMAIN_XML_INACTIVE
);
VIR_DOMAIN_XML_INACTIVE
);
if
(
def
==
NULL
)
{
if
(
def
==
NULL
)
goto
failure
;
goto
failure
;
}
if
(
!
virDomainDefCheckABIStability
(
def
,
def
))
{
if
(
!
virDomainDefCheckABIStability
(
def
,
def
))
{
fprintf
(
stderr
,
"ABI stability check failed on %s"
,
xml
);
fprintf
(
stderr
,
"ABI stability check failed on %s"
,
xml
);
...
@@ -104,9 +98,8 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
...
@@ -104,9 +98,8 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
formatted
=
virVMXFormatConfig
(
&
ctx
,
xmlopt
,
def
,
virtualHW_version
);
formatted
=
virVMXFormatConfig
(
&
ctx
,
xmlopt
,
def
,
virtualHW_version
);
if
(
formatted
==
NULL
)
{
if
(
formatted
==
NULL
)
goto
failure
;
goto
failure
;
}
if
(
STRNEQ
(
vmxData
,
formatted
))
{
if
(
STRNEQ
(
vmxData
,
formatted
))
{
virtTestDifference
(
stderr
,
vmxData
,
formatted
);
virtTestDifference
(
stderr
,
vmxData
,
formatted
);
...
@@ -207,9 +200,8 @@ testFormatVMXFileName(const char *src, void *opaque ATTRIBUTE_UNUSED)
...
@@ -207,9 +200,8 @@ testFormatVMXFileName(const char *src, void *opaque ATTRIBUTE_UNUSED)
success
=
true
;
success
=
true
;
cleanup:
cleanup:
if
(
!
success
)
{
if
(
!
success
)
VIR_FREE
(
absolutePath
);
VIR_FREE
(
absolutePath
);
}
VIR_FREE
(
copyOfDatastorePath
);
VIR_FREE
(
copyOfDatastorePath
);
...
@@ -233,9 +225,8 @@ mymain(void)
...
@@ -233,9 +225,8 @@ mymain(void)
testCapsInit
();
testCapsInit
();
if
(
caps
==
NULL
)
{
if
(
caps
==
NULL
)
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
}
if
(
!
(
xmlopt
=
virVMXDomainXMLConfInit
()))
if
(
!
(
xmlopt
=
virVMXDomainXMLConfInit
()))
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录