Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
046ca3f4
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看板
提交
046ca3f4
编写于
12月 07, 2010
作者:
E
Eric Blake
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sysinfo: formatting cleanups
* src/util/sysinfo.c: Indentation and () fixups.
上级
3fbc30d9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
19 deletion
+18
-19
src/util/sysinfo.c
src/util/sysinfo.c
+18
-19
未找到文件。
src/util/sysinfo.c
浏览文件 @
046ca3f4
...
...
@@ -39,7 +39,7 @@
#define VIR_FROM_THIS VIR_FROM_SYSINFO
#define virSmbiosReportError(code, ...) \
#define virSmbiosReportError(code, ...)
\
virReportErrorHelper(NULL, VIR_FROM_SYSINFO, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
...
...
@@ -88,7 +88,7 @@ virSysinfoRead(void) {
*/
virReportSystemError
(
ENOSYS
,
"%s"
,
_
(
"Host sysinfo extraction not supported on this platform"
));
return
(
NULL
)
;
return
NULL
;
}
#else
virSysinfoDefPtr
...
...
@@ -104,9 +104,9 @@ virSysinfoRead(void) {
path
=
virFindFileInPath
(
SYSINFO_SMBIOS_DECODER
);
if
(
path
==
NULL
)
{
virSmbiosReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Failed to find path for %s binary"
),
_
(
"Failed to find path for %s binary"
),
SYSINFO_SMBIOS_DECODER
);
return
(
NULL
)
;
return
NULL
;
}
argv
[
0
]
=
path
;
...
...
@@ -114,7 +114,7 @@ virSysinfoRead(void) {
VIR_EXEC_NONE
|
VIR_EXEC_NONBLOCK
);
if
(
res
<
0
)
{
virSmbiosReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Failed to execute command %s"
),
_
(
"Failed to execute command %s"
),
path
);
res
=
1
;
goto
cleanup
;
...
...
@@ -143,7 +143,7 @@ virSysinfoRead(void) {
}
if
(
exitstatus
!=
0
)
{
virSmbiosReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"command %s failed with error code %d:%s"
),
_
(
"command %s failed with error code %d:%s"
),
path
,
exitstatus
,
errbuf
);
goto
cleanup
;
}
...
...
@@ -159,25 +159,25 @@ virSysinfoRead(void) {
cur
+=
8
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
bios_vendor
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
cur
=
strstr
(
base
,
"Version: "
))
!=
NULL
)
{
cur
+=
9
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
bios_version
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
cur
=
strstr
(
base
,
"Release Date: "
))
!=
NULL
)
{
cur
+=
14
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
bios_date
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
cur
=
strstr
(
base
,
"BIOS Revision: "
))
!=
NULL
)
{
cur
+=
15
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
bios_release
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
base
=
strstr
(
outbuf
,
"System Information"
))
==
NULL
)
goto
cleanup
;
...
...
@@ -186,43 +186,43 @@ virSysinfoRead(void) {
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
system_manufacturer
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
cur
=
strstr
(
base
,
"Product Name: "
))
!=
NULL
)
{
cur
+=
14
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
system_product
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
cur
=
strstr
(
base
,
"Version: "
))
!=
NULL
)
{
cur
+=
9
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
system_version
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
cur
=
strstr
(
base
,
"Serial Number: "
))
!=
NULL
)
{
cur
+=
15
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
system_serial
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
cur
=
strstr
(
base
,
"UUID: "
))
!=
NULL
)
{
cur
+=
6
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
system_uuid
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
cur
=
strstr
(
base
,
"SKU Number: "
))
!=
NULL
)
{
cur
+=
12
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
system_sku
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
if
((
cur
=
strstr
(
base
,
"Family: "
))
!=
NULL
)
{
cur
+=
8
;
eol
=
strchr
(
cur
,
'\n'
);
if
((
eol
)
&&
((
ret
->
system_family
=
strndup
(
cur
,
eol
-
cur
))
==
NULL
))
goto
no_memory
;
goto
no_memory
;
}
cleanup:
...
...
@@ -230,12 +230,11 @@ cleanup:
VIR_FREE
(
errbuf
);
VIR_FREE
(
path
);
return
(
ret
)
;
return
ret
;
no_memory:
virReportOOMError
();
virSysinfoDefFree
(
ret
);
ret
=
NULL
;
goto
cleanup
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录