Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
0f0ad111
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,发现更多精彩内容 >>
提交
0f0ad111
编写于
3月 29, 2018
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
json: Replace access to virJSONValue->type by virJSONValueGetType
Signed-off-by:
N
Peter Krempa
<
pkrempa@redhat.com
>
上级
91813b87
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
14 deletion
+15
-14
src/qemu/qemu_agent.c
src/qemu/qemu_agent.c
+3
-3
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_json.c
+9
-9
src/util/virqemu.c
src/util/virqemu.c
+3
-2
未找到文件。
src/qemu/qemu_agent.c
浏览文件 @
0f0ad111
...
...
@@ -336,7 +336,7 @@ qemuAgentIOProcessLine(qemuAgentPtr mon,
goto
cleanup
;
}
if
(
obj
->
type
!=
VIR_JSON_TYPE_OBJECT
)
{
if
(
virJSONValueGetType
(
obj
)
!=
VIR_JSON_TYPE_OBJECT
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Parsed JSON reply '%s' isn't an object"
),
line
);
goto
cleanup
;
...
...
@@ -1872,7 +1872,7 @@ qemuAgentGetFSInfo(qemuAgentPtr mon, virDomainFSInfoPtr **info,
goto
cleanup
;
}
if
(
data
->
type
!=
VIR_JSON_TYPE_ARRAY
)
{
if
(
virJSONValueGetType
(
data
)
!=
VIR_JSON_TYPE_ARRAY
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"guest-get-fsinfo return information was not "
"an array"
));
...
...
@@ -1931,7 +1931,7 @@ qemuAgentGetFSInfo(qemuAgentPtr mon, virDomainFSInfoPtr **info,
goto
cleanup
;
}
if
(
entry
->
type
!=
VIR_JSON_TYPE_ARRAY
)
{
if
(
virJSONValueGetType
(
entry
)
!=
VIR_JSON_TYPE_ARRAY
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"guest-get-fsinfo 'disk' data was not an array"
));
goto
cleanup
;
...
...
src/qemu/qemu_monitor_json.c
浏览文件 @
0f0ad111
...
...
@@ -197,7 +197,7 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon,
if
(
!
(
obj
=
virJSONValueFromString
(
line
)))
goto
cleanup
;
if
(
obj
->
type
!=
VIR_JSON_TYPE_OBJECT
)
{
if
(
virJSONValueGetType
(
obj
)
!=
VIR_JSON_TYPE_OBJECT
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Parsed JSON reply '%s' isn't an object"
),
line
);
goto
cleanup
;
...
...
@@ -1978,7 +1978,7 @@ qemuMonitorJSONGetBlockDev(virJSONValuePtr devices,
{
virJSONValuePtr
dev
=
virJSONValueArrayGet
(
devices
,
idx
);
if
(
!
dev
||
dev
->
type
!=
VIR_JSON_TYPE_OBJECT
)
{
if
(
!
dev
||
virJSONValueGetType
(
dev
)
!=
VIR_JSON_TYPE_OBJECT
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"query-block device entry was not in expected format"
));
return
NULL
;
...
...
@@ -2197,7 +2197,7 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon,
virJSONValuePtr
dev
=
virJSONValueArrayGet
(
devices
,
i
);
const
char
*
dev_name
;
if
(
!
dev
||
dev
->
type
!=
VIR_JSON_TYPE_OBJECT
)
{
if
(
!
dev
||
virJSONValueGetType
(
dev
)
!=
VIR_JSON_TYPE_OBJECT
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"blockstats device entry was not "
"in expected format"
));
...
...
@@ -3276,7 +3276,7 @@ qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon,
for
(
i
=
0
;
i
<
virJSONValueArraySize
(
formats
);
i
++
)
{
virJSONValuePtr
dumpformat
=
virJSONValueArrayGet
(
formats
,
i
);
if
(
!
dumpformat
||
dumpformat
->
type
!=
VIR_JSON_TYPE_STRING
)
{
if
(
!
dumpformat
||
virJSONValueGetType
(
dumpformat
)
!=
VIR_JSON_TYPE_STRING
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"missing entry in supported dump formats"
));
goto
cleanup
;
...
...
@@ -4791,7 +4791,7 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr result,
virJSONValuePtr
inserted
;
const
char
*
current_dev
;
if
(
!
temp_dev
||
temp_dev
->
type
!=
VIR_JSON_TYPE_OBJECT
)
{
if
(
!
temp_dev
||
virJSONValueGetType
(
temp_dev
)
!=
VIR_JSON_TYPE_OBJECT
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"block_io_throttle device entry "
"was not in expected format"
));
...
...
@@ -5261,7 +5261,7 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon,
for
(
j
=
0
;
j
<
len
;
j
++
)
{
virJSONValuePtr
blocker
=
virJSONValueArrayGet
(
blockers
,
j
);
if
(
blocker
->
type
!=
VIR_JSON_TYPE_STRING
)
{
if
(
virJSONValueGetType
(
blocker
)
!=
VIR_JSON_TYPE_STRING
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"unexpected value in unavailable-features "
"array"
));
...
...
@@ -5304,7 +5304,7 @@ qemuMonitorJSONParseCPUModelProperty(const char *key,
prop
=
machine_model
->
props
+
machine_model
->
nprops
;
switch
((
virJSONType
)
v
alue
->
type
)
{
switch
((
virJSONType
)
v
irJSONValueGetType
(
value
)
)
{
case
VIR_JSON_TYPE_STRING
:
if
(
VIR_STRDUP
(
prop
->
value
.
string
,
virJSONValueGetString
(
value
))
<
0
)
return
-
1
;
...
...
@@ -6193,7 +6193,7 @@ qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon,
virJSONValuePtr
cap
=
virJSONValueArrayGet
(
caps
,
i
);
const
char
*
name
;
if
(
!
cap
||
cap
->
type
!=
VIR_JSON_TYPE_OBJECT
)
{
if
(
!
cap
||
virJSONValueGetType
(
cap
)
!=
VIR_JSON_TYPE_OBJECT
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"missing entry in migration capabilities list"
));
goto
cleanup
;
...
...
@@ -6343,7 +6343,7 @@ qemuMonitorJSONGetGICCapabilities(qemuMonitorPtr mon,
bool
kernel
;
bool
emulated
;
if
(
!
cap
||
cap
->
type
!=
VIR_JSON_TYPE_OBJECT
)
{
if
(
!
cap
||
virJSONValueGetType
(
cap
)
!=
VIR_JSON_TYPE_OBJECT
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"missing entry in GIC capabilities list"
));
goto
cleanup
;
...
...
src/util/virqemu.c
浏览文件 @
0f0ad111
...
...
@@ -146,16 +146,17 @@ virQEMUBuildCommandLineJSONRecurse(const char *key,
bool
nested
)
{
struct
virQEMUCommandLineJSONIteratorData
data
=
{
key
,
buf
,
arrayFunc
};
virJSONType
type
=
virJSONValueGetType
(
value
);
virJSONValuePtr
elem
;
size_t
i
;
if
(
!
key
&&
value
->
type
!=
VIR_JSON_TYPE_OBJECT
)
{
if
(
!
key
&&
type
!=
VIR_JSON_TYPE_OBJECT
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"only JSON objects can be top level"
));
return
-
1
;
}
switch
(
(
virJSONType
)
value
->
type
)
{
switch
(
type
)
{
case
VIR_JSON_TYPE_STRING
:
virBufferAsprintf
(
buf
,
"%s="
,
key
);
virQEMUBuildBufferEscapeComma
(
buf
,
value
->
data
.
string
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录