Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
e4c65831
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,发现更多精彩内容 >>
提交
e4c65831
编写于
4月 01, 2009
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Misc fixes uncovered by OOM testing
上级
dab6391f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
45 addition
and
32 deletion
+45
-32
ChangeLog
ChangeLog
+15
-0
src/datatypes.c
src/datatypes.c
+4
-20
src/domain_conf.c
src/domain_conf.c
+5
-2
src/nodeinfo.c
src/nodeinfo.c
+8
-8
src/xend_internal.c
src/xend_internal.c
+5
-0
tests/sexpr2xmltest.c
tests/sexpr2xmltest.c
+5
-1
tests/testutils.c
tests/testutils.c
+2
-1
tests/xml2sexprtest.c
tests/xml2sexprtest.c
+1
-0
未找到文件。
ChangeLog
浏览文件 @
e4c65831
Wed Apr 1 11:27:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
Misc fixes uncovered from OOM testing
* src/datatypes.c: Switch to virReportErrorHelper for error
reporting, so source line/file/function info is correct
* src/domain_conf.c: Check for failure in virXPathNodeSet()
* src/noeinfo.c: Translate error strings
* src/xend_internal.c: Check for OOM failure after generating
SEXPR buffer
* tests/sexpr2xmltest.c: Don't unref a NULL connection object.
Reset error object between tests. Free capabilities on exit
* tests/testutils.c: Fix crash in OOM testing for non-SMP
usage
* tests/xml2sexprtest.c: Reset error object between tests
Wed Apr 1 11:22:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
Sanitise symlink resolving
...
...
src/datatypes.c
浏览文件 @
e4c65831
...
...
@@ -28,31 +28,15 @@
#define VIR_FROM_THIS VIR_FROM_NONE
#define virLibConnError(conn, code, fmt...) \
virReportErrorHelper(conn, VIR_FROM_THIS, code, __FILE__, \
__FUNCTION__, __LINE__, fmt)
/************************************************************************
* *
* Domain and Connections allocations *
* *
************************************************************************/
/**
* virLibConnError:
* @conn: the connection if available
* @error: the error number
* @info: extra information string
*
* Handle an error at the connection level
*/
static
void
virLibConnError
(
virConnectPtr
conn
,
virErrorNumber
error
,
const
char
*
info
)
{
const
char
*
errmsg
;
if
(
error
==
VIR_ERR_OK
)
return
;
errmsg
=
virErrorMsg
(
error
,
info
);
virRaiseError
(
conn
,
NULL
,
NULL
,
VIR_FROM_NONE
,
error
,
VIR_ERR_ERROR
,
errmsg
,
info
,
NULL
,
0
,
0
,
errmsg
,
info
);
}
/**
* virDomainFreeName:
...
...
src/domain_conf.c
浏览文件 @
e4c65831
...
...
@@ -2068,7 +2068,10 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
VIR_FREE
(
tmp
);
}
if
((
n
=
virXPathNodeSet
(
conn
,
"./features/*"
,
ctxt
,
&
nodes
))
>
0
)
{
n
=
virXPathNodeSet
(
conn
,
"./features/*"
,
ctxt
,
&
nodes
);
if
(
n
<
0
)
goto
error
;
if
(
n
)
{
for
(
i
=
0
;
i
<
n
;
i
++
)
{
int
val
=
virDomainFeatureTypeFromString
((
const
char
*
)
nodes
[
i
]
->
name
);
if
(
val
<
0
)
{
...
...
@@ -2079,8 +2082,8 @@ static virDomainDefPtr virDomainDefParseXML(virConnectPtr conn,
}
def
->
features
|=
(
1
<<
val
);
}
VIR_FREE
(
nodes
);
}
VIR_FREE
(
nodes
);
if
(
virDomainLifecycleParseXML
(
conn
,
ctxt
,
"string(./on_reboot[1])"
,
&
def
->
onReboot
,
VIR_DOMAIN_LIFECYCLE_RESTART
)
<
0
)
...
...
src/nodeinfo.c
浏览文件 @
e4c65831
...
...
@@ -74,8 +74,8 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr n
buf
++
;
if
(
*
buf
!=
':'
)
{
virRaiseError
(
conn
,
NULL
,
NULL
,
0
,
VIR_ERR_INTERNAL_ERROR
,
VIR_ERR_ERROR
,
NULL
,
NULL
,
NULL
,
0
,
0
,
"parsing cpuinfo processor"
);
VIR_ERR_ERROR
,
NULL
,
NULL
,
NULL
,
0
,
0
,
"%s"
,
_
(
"parsing cpuinfo processor"
)
);
return
-
1
;
}
nodeinfo
->
cpus
++
;
...
...
@@ -87,8 +87,8 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr n
buf
++
;
if
(
*
buf
!=
':'
||
!
buf
[
1
])
{
virRaiseError
(
conn
,
NULL
,
NULL
,
0
,
VIR_ERR_INTERNAL_ERROR
,
VIR_ERR_ERROR
,
NULL
,
NULL
,
NULL
,
0
,
0
,
"parsing cpuinfo cpu MHz"
);
VIR_ERR_ERROR
,
NULL
,
NULL
,
NULL
,
0
,
0
,
"%s"
,
_
(
"parsing cpuinfo cpu MHz"
)
);
return
-
1
;
}
if
(
virStrToLong_ui
(
buf
+
1
,
&
p
,
10
,
&
ui
)
==
0
...
...
@@ -103,8 +103,8 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr n
buf
++
;
if
(
*
buf
!=
':'
||
!
buf
[
1
])
{
virRaiseError
(
conn
,
NULL
,
NULL
,
0
,
VIR_ERR_INTERNAL_ERROR
,
VIR_ERR_ERROR
,
NULL
,
NULL
,
NULL
,
0
,
0
,
"parsing cpuinfo cpu cores %c"
,
*
buf
);
VIR_ERR_ERROR
,
NULL
,
NULL
,
NULL
,
0
,
0
,
"parsing cpuinfo cpu cores %c"
,
*
buf
);
return
-
1
;
}
if
(
virStrToLong_ui
(
buf
+
1
,
&
p
,
10
,
&
id
)
==
0
...
...
@@ -116,8 +116,8 @@ int linuxNodeInfoCPUPopulate(virConnectPtr conn, FILE *cpuinfo, virNodeInfoPtr n
if
(
!
nodeinfo
->
cpus
)
{
virRaiseError
(
conn
,
NULL
,
NULL
,
0
,
VIR_ERR_INTERNAL_ERROR
,
VIR_ERR_ERROR
,
NULL
,
NULL
,
NULL
,
0
,
0
,
"no cpus found"
);
VIR_ERR_ERROR
,
NULL
,
NULL
,
NULL
,
0
,
0
,
"%s"
,
_
(
"no cpus found"
)
);
return
-
1
;
}
...
...
src/xend_internal.c
浏览文件 @
e4c65831
...
...
@@ -5538,6 +5538,11 @@ xenDaemonFormatSxpr(virConnectPtr conn,
virBufferAddLit
(
&
buf
,
")"
);
/* closes (vm */
if
(
virBufferError
(
&
buf
))
{
virReportOOMError
(
conn
);
return
NULL
;
}
return
virBufferContentAndReset
(
&
buf
);
error:
...
...
tests/sexpr2xmltest.c
浏览文件 @
e4c65831
...
...
@@ -64,7 +64,8 @@ static int testCompareFiles(const char *xml, const char *sexpr,
fail:
free
(
gotxml
);
virDomainDefFree
(
def
);
virUnrefConnect
(
conn
);
if
(
conn
)
virUnrefConnect
(
conn
);
return
ret
;
}
...
...
@@ -115,6 +116,7 @@ mymain(int argc, char **argv)
#define DO_TEST(in, out, version) \
do { \
struct testInfo info = { in, out, version }; \
virResetLastError(); \
if (virtTestRun("Xen SEXPR-2-XML " in " -> " out, \
1, testCompareHelper, &info) < 0) \
ret = -1; \
...
...
@@ -163,6 +165,8 @@ mymain(int argc, char **argv)
DO_TEST
(
"fv-sound"
,
"fv-sound"
,
1
);
DO_TEST
(
"fv-sound-all"
,
"fv-sound-all"
,
1
);
virCapabilitiesFree
(
caps
);
return
(
ret
==
0
?
EXIT_SUCCESS
:
EXIT_FAILURE
);
}
...
...
tests/testutils.c
浏览文件 @
e4c65831
...
...
@@ -409,7 +409,8 @@ int virtTestMain(int argc,
/* Run once for each alloc, failing a different one
and validating that the test case failed */
for
(
n
=
0
;
n
<
approxAlloc
&&
(
!
mp
||
worker
)
;
n
++
)
{
if
((
n
%
mp
)
!=
(
worker
-
1
))
if
(
mp
&&
(
n
%
mp
)
!=
(
worker
-
1
))
continue
;
if
(
!
testDebug
)
{
if
(
mp
)
...
...
tests/xml2sexprtest.c
浏览文件 @
e4c65831
...
...
@@ -95,6 +95,7 @@ mymain(int argc, char **argv)
#define DO_TEST(in, out, name, version) \
do { \
struct testInfo info = { in, out, name, version }; \
virResetLastError(); \
if (virtTestRun("Xen XML-2-SEXPR " in " -> " out, \
1, testCompareHelper, &info) < 0) \
ret = -1; \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录