Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
aa9b79bc
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
aa9b79bc
编写于
9月 21, 2011
作者:
L
Luiz Capitulino
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qapi: Convert query-commands
Signed-off-by:
N
Luiz Capitulino
<
lcapitulino@redhat.com
>
上级
c5a415a0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
44 addition
and
25 deletion
+44
-25
monitor.c
monitor.c
+15
-25
qapi-schema.json
qapi-schema.json
+23
-0
qmp-commands.hx
qmp-commands.hx
+6
-0
未找到文件。
monitor.c
浏览文件 @
aa9b79bc
...
...
@@ -731,39 +731,37 @@ help:
help_cmd
(
mon
,
"info"
);
}
static
QObject
*
get_cmd_dict
(
const
char
*
name
)
static
CommandInfoList
*
alloc_cmd_entry
(
const
char
*
cmd_
name
)
{
const
char
*
p
;
CommandInfoList
*
info
;
/* Remove '|' from some commands */
p
=
strchr
(
name
,
'|'
);
if
(
p
)
{
p
++
;
}
else
{
p
=
name
;
}
info
=
g_malloc0
(
sizeof
(
*
info
));
info
->
value
=
g_malloc0
(
sizeof
(
*
info
->
value
));
info
->
value
->
name
=
g_strdup
(
cmd_name
);
return
qobject_from_jsonf
(
"{ 'name': %s }"
,
p
)
;
return
info
;
}
static
void
do_info_commands
(
Monitor
*
mon
,
QObject
**
ret_data
)
CommandInfoList
*
qmp_query_commands
(
Error
**
errp
)
{
QList
*
cmd_list
;
CommandInfoList
*
info
,
*
cmd_list
=
NULL
;
const
mon_cmd_t
*
cmd
;
cmd_list
=
qlist_new
();
for
(
cmd
=
qmp_cmds
;
cmd
->
name
!=
NULL
;
cmd
++
)
{
qlist_append_obj
(
cmd_list
,
get_cmd_dict
(
cmd
->
name
));
info
=
alloc_cmd_entry
(
cmd
->
name
);
info
->
next
=
cmd_list
;
cmd_list
=
info
;
}
for
(
cmd
=
qmp_query_cmds
;
cmd
->
name
!=
NULL
;
cmd
++
)
{
char
buf
[
128
];
snprintf
(
buf
,
sizeof
(
buf
),
"query-%s"
,
cmd
->
name
);
qlist_append_obj
(
cmd_list
,
get_cmd_dict
(
buf
));
info
=
alloc_cmd_entry
(
buf
);
info
->
next
=
cmd_list
;
cmd_list
=
info
;
}
*
ret_data
=
QOBJECT
(
cmd_list
)
;
return
cmd_list
;
}
/* get the current CPU defined by the user */
...
...
@@ -3063,14 +3061,6 @@ static const mon_cmd_t qmp_cmds[] = {
};
static
const
mon_cmd_t
qmp_query_cmds
[]
=
{
{
.
name
=
"commands"
,
.
args_type
=
""
,
.
params
=
""
,
.
help
=
"list QMP available commands"
,
.
user_print
=
monitor_user_noop
,
.
mhandler
.
info_new
=
do_info_commands
,
},
{
.
name
=
"block"
,
.
args_type
=
""
,
...
...
qapi-schema.json
浏览文件 @
aa9b79bc
...
...
@@ -202,3 +202,26 @@
#
Since:
0.14
.
0
##
{
'command':
'query-chardev'
,
'returns':
[
'ChardevInfo'
]
}
##
#
@CommandInfo:
#
#
Information
about
a
QMP
command
#
#
@name:
The
command
name
#
#
Since:
0.14
.
0
##
{
'type':
'CommandInfo'
,
'data':
{
'name':
'str'
}
}
##
#
@query-commands:
#
#
Return
a
list
of
supported
QMP
commands
by
this
server
#
#
Returns:
A
list
of
@CommandInfo
for
all
supported
commands
#
#
Since:
0.14
.
0
##
{
'command':
'query-commands'
,
'returns':
[
'CommandInfo'
]
}
qmp-commands.hx
浏览文件 @
aa9b79bc
...
...
@@ -1090,6 +1090,12 @@ Note: This example has been shortened as the real response is too long.
EQMP
{
.
name
=
"query-commands"
,
.
args_type
=
""
,
.
mhandler
.
cmd_new
=
qmp_marshal_input_query_commands
,
},
SQMP
query
-
chardev
-------------
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录