Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
d24dbdd0
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,体验更适合开发者的 AI 搜索 >>
提交
d24dbdd0
编写于
7月 18, 2013
作者:
P
Peter Krempa
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemumonitortestutils: Use consistent header style and line spacing
上级
56874f01
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
25 deletion
+44
-25
tests/qemumonitortestutils.c
tests/qemumonitortestutils.c
+41
-21
tests/qemumonitortestutils.h
tests/qemumonitortestutils.h
+3
-4
未找到文件。
tests/qemumonitortestutils.c
浏览文件 @
d24dbdd0
...
...
@@ -76,11 +76,13 @@ struct _qemuMonitorTest {
static
void
qemuMonitorTestItemFree
(
qemuMonitorTestItemPtr
item
);
/*
* Appends data for a reply to the outgoing buffer
*/
static
int
qemuMonitorTestAddReponse
(
qemuMonitorTestPtr
test
,
const
char
*
response
)
static
int
qemuMonitorTestAddReponse
(
qemuMonitorTestPtr
test
,
const
char
*
response
)
{
size_t
want
=
strlen
(
response
)
+
2
;
size_t
have
=
test
->
outgoingCapacity
-
test
->
outgoingLength
;
...
...
@@ -107,8 +109,9 @@ static int qemuMonitorTestAddReponse(qemuMonitorTestPtr test,
* Processes a single line, looking for a matching expected
* item to reply with, else replies with an error
*/
static
int
qemuMonitorTestProcessCommandJSON
(
qemuMonitorTestPtr
test
,
const
char
*
cmdstr
)
static
int
qemuMonitorTestProcessCommandJSON
(
qemuMonitorTestPtr
test
,
const
char
*
cmdstr
)
{
virJSONValuePtr
val
;
const
char
*
cmdname
;
...
...
@@ -150,8 +153,9 @@ cleanup:
}
static
int
qemuMonitorTestProcessCommandText
(
qemuMonitorTestPtr
test
,
const
char
*
cmdstr
)
static
int
qemuMonitorTestProcessCommandText
(
qemuMonitorTestPtr
test
,
const
char
*
cmdstr
)
{
char
*
tmp
;
char
*
cmdname
;
...
...
@@ -190,8 +194,10 @@ cleanup:
return
ret
;
}
static
int
qemuMonitorTestProcessCommand
(
qemuMonitorTestPtr
test
,
const
char
*
cmdstr
)
static
int
qemuMonitorTestProcessCommand
(
qemuMonitorTestPtr
test
,
const
char
*
cmdstr
)
{
if
(
test
->
json
)
return
qemuMonitorTestProcessCommandJSON
(
test
,
cmdstr
);
...
...
@@ -199,12 +205,14 @@ static int qemuMonitorTestProcessCommand(qemuMonitorTestPtr test,
return
qemuMonitorTestProcessCommandText
(
test
,
cmdstr
);
}
/*
* Handles read/write of monitor data on the monitor server side
*/
static
void
qemuMonitorTestIO
(
virNetSocketPtr
sock
,
int
events
,
void
*
opaque
)
static
void
qemuMonitorTestIO
(
virNetSocketPtr
sock
,
int
events
,
void
*
opaque
)
{
qemuMonitorTestPtr
test
=
opaque
;
bool
err
=
false
;
...
...
@@ -298,7 +306,8 @@ cleanup:
}
static
void
qemuMonitorTestWorker
(
void
*
opaque
)
static
void
qemuMonitorTestWorker
(
void
*
opaque
)
{
qemuMonitorTestPtr
test
=
opaque
;
...
...
@@ -322,7 +331,9 @@ static void qemuMonitorTestWorker(void *opaque)
return
;
}
static
void
qemuMonitorTestItemFree
(
qemuMonitorTestItemPtr
item
)
static
void
qemuMonitorTestItemFree
(
qemuMonitorTestItemPtr
item
)
{
if
(
!
item
)
return
;
...
...
@@ -335,13 +346,15 @@ static void qemuMonitorTestItemFree(qemuMonitorTestItemPtr item)
static
void
qemuMonitorTestFreeTimer
(
int
timer
ATTRIBUTE_UNUSED
,
void
*
opaque
ATTRIBUTE_UNUSED
)
qemuMonitorTestFreeTimer
(
int
timer
ATTRIBUTE_UNUSED
,
void
*
opaque
ATTRIBUTE_UNUSED
)
{
/* nothing to be done here */
}
void
qemuMonitorTestFree
(
qemuMonitorTestPtr
test
)
void
qemuMonitorTestFree
(
qemuMonitorTestPtr
test
)
{
size_t
i
;
int
timer
=
-
1
;
...
...
@@ -424,13 +437,16 @@ error:
}
static
void
qemuMonitorTestEOFNotify
(
qemuMonitorPtr
mon
ATTRIBUTE_UNUSED
,
virDomainObjPtr
vm
ATTRIBUTE_UNUSED
)
static
void
qemuMonitorTestEOFNotify
(
qemuMonitorPtr
mon
ATTRIBUTE_UNUSED
,
virDomainObjPtr
vm
ATTRIBUTE_UNUSED
)
{
}
static
void
qemuMonitorTestErrorNotify
(
qemuMonitorPtr
mon
ATTRIBUTE_UNUSED
,
virDomainObjPtr
vm
ATTRIBUTE_UNUSED
)
static
void
qemuMonitorTestErrorNotify
(
qemuMonitorPtr
mon
ATTRIBUTE_UNUSED
,
virDomainObjPtr
vm
ATTRIBUTE_UNUSED
)
{
}
...
...
@@ -440,12 +456,14 @@ static qemuMonitorCallbacks qemuCallbacks = {
.
errorNotify
=
qemuMonitorTestErrorNotify
,
};
#define QEMU_JSON_GREETING "{\"QMP\": {\"version\": {\"qemu\": {\"micro\": 1, \"minor\": 0, \"major\": 1}, \"package\": \" (qemu-kvm-1.0.1)\"}, \"capabilities\": []}}"
/* We skip the normal handshake reply of "{\"execute\":\"qmp_capabilities\"}" */
#define QEMU_TEXT_GREETING "QEMU 1.0,1 monitor - type 'help' for more information"
qemuMonitorTestPtr
qemuMonitorTestNew
(
bool
json
,
virDomainXMLOptionPtr
xmlopt
)
qemuMonitorTestPtr
qemuMonitorTestNew
(
bool
json
,
virDomainXMLOptionPtr
xmlopt
)
{
qemuMonitorTestPtr
test
=
NULL
;
virDomainChrSourceDef
src
;
...
...
@@ -541,7 +559,9 @@ error:
goto
cleanup
;
}
qemuMonitorPtr
qemuMonitorTestGetMonitor
(
qemuMonitorTestPtr
test
)
qemuMonitorPtr
qemuMonitorTestGetMonitor
(
qemuMonitorTestPtr
test
)
{
return
test
->
mon
;
}
tests/qemumonitortestutils.h
浏览文件 @
d24dbdd0
...
...
@@ -26,10 +26,9 @@
typedef
struct
_qemuMonitorTest
qemuMonitorTest
;
typedef
qemuMonitorTest
*
qemuMonitorTestPtr
;
int
qemuMonitorTestAddItem
(
qemuMonitorTestPtr
test
,
const
char
*
command_name
,
const
char
*
response
);
int
qemuMonitorTestAddItem
(
qemuMonitorTestPtr
test
,
const
char
*
command_name
,
const
char
*
response
);
qemuMonitorTestPtr
qemuMonitorTestNew
(
bool
json
,
virDomainXMLOptionPtr
xmlopt
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录