Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
0c3cea0b
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看板
提交
0c3cea0b
编写于
4月 22, 2011
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remote generator, daemon: Handle simple-return-value functions
上级
0fb79ff4
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
3464 addition
and
3259 deletion
+3464
-3259
daemon/remote.c
daemon/remote.c
+1202
-2818
daemon/remote_dispatch_bodies.c
daemon/remote_dispatch_bodies.c
+2053
-435
daemon/remote_generator.pl
daemon/remote_generator.pl
+209
-6
未找到文件。
daemon/remote.c
浏览文件 @
0c3cea0b
此差异已折叠。
点击以展开。
daemon/remote_dispatch_bodies.c
浏览文件 @
0c3cea0b
此差异已折叠。
点击以展开。
daemon/remote_generator.pl
浏览文件 @
0c3cea0b
...
...
@@ -54,6 +54,7 @@ if ($opt_c) {
}
my
$collect_args_members
=
0
;
my
$collect_ret_members
=
0
;
my
$last_name
;
while
(
<>
)
{
...
...
@@ -63,6 +64,12 @@ while (<>) {
}
elsif
(
$_
=~
m/^\s*(.*\S)\s*$/
)
{
push
(
@
{
$calls
{
$name
}
->
{
args_members
}},
$
1
);
}
}
elsif
(
$collect_ret_members
)
{
if
(
/^};/
)
{
$collect_ret_members
=
0
;
}
elsif
(
$_
=~
m/^\s*(.*\S)\s*$/
)
{
push
(
@
{
$calls
{
$name
}
->
{
ret_members
}},
$
1
);
}
}
elsif
(
/^struct ${structprefix}_(.*)_args/
)
{
$name
=
$
1
;
$ProcName
=
name_to_ProcName
(
$name
);
...
...
@@ -80,6 +87,7 @@ while (<>) {
};
$collect_args_members
=
1
;
$collect_ret_members
=
0
;
$last_name
=
$name
;
}
elsif
(
/^struct ${structprefix}_(.*)_ret/
)
{
$name
=
$
1
;
...
...
@@ -93,11 +101,14 @@ while (<>) {
ProcName
=>
$ProcName
,
UC_NAME
=>
uc
$name
,
args
=>
"
void
",
ret
=>
"
${structprefix}
_
${name}
_ret
"
ret
=>
"
${structprefix}
_
${name}
_ret
",
ret_members
=>
[]
}
}
$collect_args_members
=
0
;
$collect_ret_members
=
1
;
$last_name
=
$name
;
}
elsif
(
/^struct ${structprefix}_(.*)_msg/
)
{
$name
=
$
1
;
$ProcName
=
name_to_ProcName
(
$name
);
...
...
@@ -110,6 +121,7 @@ while (<>) {
};
$collect_args_members
=
0
;
$collect_ret_members
=
0
;
}
elsif
(
/^\s*${procprefix}_PROC_(.*?)\s+=\s+(\d+),?$/
)
{
$name
=
lc
$
1
;
$id
=
$
2
;
...
...
@@ -118,8 +130,10 @@ while (<>) {
$calls
[
$id
]
=
$calls
{
$name
};
$collect_args_members
=
0
;
$collect_ret_members
=
0
;
}
else
{
$collect_args_members
=
0
;
$collect_ret_members
=
0
;
}
}
...
...
@@ -235,7 +249,96 @@ elsif ($opt_b) {
"
DomainSetBlkioParameters
",
"
Open
",
"
StorageVolUpload
",
"
StorageVolDownload
");
"
StorageVolDownload
",
"
AuthList
",
"
AuthSaslInit
",
"
AuthSaslStart
",
"
AuthSaslStep
",
"
AuthPolkit
",
"
CpuBaseline
",
"
CpuCompare
",
"
DomainBlockPeek
",
"
DomainBlockStats
",
"
DomainCreateWithFlags
",
"
DomainCreateXML
",
"
DomainDefineXML
",
"
DomainEventsDeregister
",
"
DomainEventsRegister
",
"
DomainGetBlkioParameters
",
"
DomainGetBlockInfo
",
"
DomainGetInfo
",
"
DomainGetJobInfo
",
"
DomainGetMemoryParameters
",
"
DomainGetSchedulerParameters
",
"
DomainGetSchedulerType
",
"
DomainGetSecurityLabel
",
"
DomainGetVcpus
",
"
DomainInterfaceStats
",
"
DomainLookupById
",
"
DomainLookupByName
",
"
DomainLookupByUUID
",
"
DomainMemoryPeek
",
"
DomainMemoryStats
",
"
DomainMigrateFinish
",
"
DomainMigrateFinish2
",
"
DomainMigratePrepare
",
"
DomainMigratePrepare2
",
"
DomainSnapshotCreateXML
",
"
DomainSnapshotCurrent
",
"
DomainSnapshotListNames
",
"
DomainSnapshotLookupByName
",
"
FindStoragePoolSources
",
"
GetMaxVcpus
",
"
GetType
",
"
InterfaceLookupByMacString
",
"
InterfaceLookupByName
",
"
InterfaceDefineXML
",
"
ListDefinedDomains
",
"
ListDefinedInterfaces
",
"
ListDefinedNetworks
",
"
ListDefinedStoragePools
",
"
ListDomains
",
"
ListInterfaces
",
"
ListNetworks
",
"
ListNWFilters
",
"
ListSecrets
",
"
ListStoragePools
",
"
NetworkLookupByName
",
"
NetworkLookupByUUID
",
"
NodeDeviceCreateXML
",
"
NetworkCreateXML
",
"
NodeDeviceGetParent
",
"
NodeDeviceListCaps
",
"
NodeDeviceLookupByName
",
"
NodeGetCellsFreeMemory
",
"
NodeGetFreeMemory
",
"
NodeGetInfo
",
"
NodeGetSecurityModel
",
"
NetworkDefineXML
",
"
NodeListDevices
",
"
NodeNumOfDevices
",
"
NWFilterLookupByName
",
"
NWFilterLookupByUUID
",
"
SecretDefineXML
",
"
SecretGetValue
",
"
NWFilterDefineXML
",
"
SecretLookupByUsage
",
"
SecretLookupByUUID
",
"
StoragePoolCreateXML
",
"
StoragePoolDefineXML
",
"
StoragePoolGetInfo
",
"
StoragePoolListVolumes
",
"
StoragePoolLookupByName
",
"
StoragePoolLookupByUUID
",
"
StoragePoolLookupByVolume
",
"
StorageVolCreateXML
",
"
StorageVolCreateXMLFrom
",
"
StorageVolGetInfo
",
"
StorageVolLookupByKey
",
"
StorageVolLookupByName
",
"
StorageVolLookupByPath
");
}
elsif
(
$structprefix
eq
"
qemu
")
{
@ungeneratable
=
("
MonitorCommand
");
}
...
...
@@ -248,8 +351,9 @@ elsif ($opt_b) {
next
if
$calls
{
$_
}
->
{
msg
};
# FIXME: skip functions with explicit return value for now
if
(
$calls
{
$_
}
->
{
ret
}
ne
"
void
"
or
exists
(
$ug
{
$calls
{
$_
}
->
{
ProcName
}}))
{
print
"
\n
/*
${structprefix}
Dispatch
$calls
{
$_
}->{ProcName} has to be implemented manually */
\n
";
if
(
exists
(
$ug
{
$calls
{
$_
}
->
{
ProcName
}}))
{
print
"
\n
/*
${structprefix}
Dispatch
$calls
{
$_
}->{ProcName} has
"
.
"
to be implemented manually */
\n
";
next
;
}
...
...
@@ -282,6 +386,7 @@ elsif ($opt_b) {
my
@vars_list
=
();
my
@getters_list
=
();
my
@args_list
=
();
my
@ret_list
=
();
my
@free_list
=
();
if
(
$calls
{
$_
}
->
{
args
}
ne
"
void
")
{
...
...
@@ -402,6 +507,49 @@ elsif ($opt_b) {
}
}
my
$single_ret_var
=
"
undefined
";
my
$single_ret_by_ref
=
0
;
my
$single_ret_check
=
"
== undefined
";
if
(
$calls
{
$_
}
->
{
ret
}
ne
"
void
")
{
foreach
my
$ret_member
(
@
{
$calls
{
$_
}
->
{
ret_members
}})
{
if
(
$ret_member
=~
m/(\S+)<\S+>;/
)
{
push
(
@ret_list
,
"
ret->$1.$1_val
");
push
(
@ret_list
,
"
ret->$1.$1_len
");
}
elsif
(
$ret_member
=~
m/remote_nonnull_string (\S+);/
)
{
push
(
@vars_list
,
"
char *$1
");
push
(
@ret_list
,
"
ret->$1 = $1;
");
$single_ret_var
=
$
1
;
$single_ret_by_ref
=
0
;
$single_ret_check
=
"
== NULL
";
}
elsif
(
$ret_member
=~
m/int (\S+);/
)
{
push
(
@vars_list
,
"
int $1
");
push
(
@ret_list
,
"
ret->$1 = $1;
");
$single_ret_var
=
$
1
;
if
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainGetAutostart
"
or
$calls
{
$_
}
->
{
ProcName
}
eq
"
NetworkGetAutostart
"
or
$calls
{
$_
}
->
{
ProcName
}
eq
"
StoragePoolGetAutostart
")
{
$single_ret_by_ref
=
1
;
}
else
{
$single_ret_by_ref
=
0
;
$single_ret_check
=
"
< 0
";
}
}
elsif
(
$ret_member
=~
m/hyper (\S+);/
)
{
push
(
@vars_list
,
"
unsigned long $1
");
push
(
@ret_list
,
"
ret->$1 = $1;
");
$single_ret_var
=
$
1
;
if
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainGetMaxMemory
")
{
$single_ret_by_ref
=
0
;
$single_ret_check
=
"
== 0
";
}
else
{
$single_ret_by_ref
=
1
;
}
}
}
}
foreach
my
$var
(
@vars_list
)
{
print
"
$var
;
\n
";
}
...
...
@@ -415,7 +563,9 @@ elsif ($opt_b) {
print
join
("
\n
",
@getters_list
);
print
"
\n
";
if
(
@getters_list
)
{
print
"
\n
";
}
if
(
$calls
{
$_
}
->
{
ret
}
eq
"
void
")
{
print
"
if (vir
$calls
{
$_
}->{ProcName}(
";
...
...
@@ -423,6 +573,56 @@ elsif ($opt_b) {
print
"
) < 0)
\n
";
print
"
goto cleanup;
\n
";
print
"
\n
";
}
elsif
(
scalar
(
@
{
$calls
{
$_
}
->
{
ret_members
}})
==
1
)
{
my
$prefix
=
"";
my
$proc_name
=
$calls
{
$_
}
->
{
ProcName
};
if
(
!
@args_list
)
{
push
(
@args_list
,
"
conn
");
$prefix
=
"
Connect
"
}
if
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
GetSysinfo
"
or
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainXMLFromNative
"
or
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainXMLToNative
")
{
$prefix
=
"
Connect
"
}
elsif
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
SupportsFeature
")
{
$prefix
=
"
Drv
"
}
elsif
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainDumpXML
")
{
$proc_name
=
"
DomainGetXMLDesc
"
}
elsif
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
NetworkDumpXML
")
{
$proc_name
=
"
NetworkGetXMLDesc
"
}
elsif
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
StoragePoolDumpXML
")
{
$proc_name
=
"
StoragePoolGetXMLDesc
"
}
elsif
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
StorageVolDumpXML
")
{
$proc_name
=
"
StorageVolGetXMLDesc
"
}
elsif
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
NodeDeviceDumpXML
")
{
$proc_name
=
"
NodeDeviceGetXMLDesc
"
}
elsif
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainSnapshotDumpXML
")
{
$proc_name
=
"
DomainSnapshotGetXMLDesc
"
}
elsif
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainGetOsType
")
{
$proc_name
=
"
DomainGetOSType
"
}
if
(
$single_ret_by_ref
)
{
print
"
if (vir
$prefix$proc_name
(
";
print
join
('
,
',
@args_list
);
print
"
, &
$single_ret_var
) < 0)
\n
";
}
else
{
print
"
if ((
$single_ret_var
= vir
$prefix$proc_name
(
";
print
join
('
,
',
@args_list
);
print
"
))
$single_ret_check
)
\n
";
}
print
"
goto cleanup;
\n
";
print
"
\n
";
if
(
@ret_list
)
{
print
"
";
}
print
join
("
\n
",
@ret_list
);
print
"
\n
";
}
print
"
rv = 0;
\n
";
...
...
@@ -433,7 +633,10 @@ elsif ($opt_b) {
print
join
("
\n
",
@free_list
);
print
"
\n
";
if
(
@free_list
)
{
print
"
\n
";
}
print
"
return rv;
\n
";
print
"
}
\n
";
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录