Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b5041a49
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看板
提交
b5041a49
编写于
4月 23, 2011
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remote generator, client: Handle functions that return lists
上级
8921799a
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
858 addition
and
786 deletion
+858
-786
cfg.mk
cfg.mk
+6
-0
daemon/remote_generator.pl
daemon/remote_generator.pl
+78
-15
po/POTFILES.in
po/POTFILES.in
+1
-0
src/remote/remote_client_bodies.c
src/remote/remote_client_bodies.c
+773
-13
src/remote/remote_driver.c
src/remote/remote_driver.c
+0
-758
未找到文件。
cfg.mk
浏览文件 @
b5041a49
...
...
@@ -590,6 +590,9 @@ exclude_file_name_regexp--sc_avoid_write = \
exclude_file_name_regexp--sc_bindtextdomain
=
^
(
tests|examples
)
/
exclude_file_name_regexp--sc_libvirt_unmarked_diagnostics
=
\
^daemon/remote_generator
\.
pl
$$
exclude_file_name_regexp--sc_po_check
=
^
(
docs/|daemon/remote_generator
\.
pl
$$
)
exclude_file_name_regexp--sc_prohibit_VIR_ERR_NO_MEMORY
=
\
...
...
@@ -621,6 +624,9 @@ exclude_file_name_regexp--sc_prohibit_gethostname = ^src/util/util\.c$$
exclude_file_name_regexp--sc_prohibit_gettext_noop
=
^docs/
exclude_file_name_regexp--sc_prohibit_newline_at_end_of_diagnostic
=
\
^daemon/remote_generator
\.
pl
$$
exclude_file_name_regexp--sc_prohibit_nonreentrant
=
\
^
((
po|docs|tests
)
/|tools/
(
virsh|console
)
\.
c
$$
)
...
...
daemon/remote_generator.pl
浏览文件 @
b5041a49
...
...
@@ -758,29 +758,16 @@ elsif ($opt_k) {
"
NWFilterDefineXML
",
# public API and XDR protocol mismatch
"
DomainMigratePerform
",
"
DomainMigrateFinish2
",
"
DomainSnapshotListNames
",
"
FindStoragePoolSources
",
"
IsSecure
",
"
ListDefinedDomains
",
"
ListDefinedInterfaces
",
"
ListNWFilters
",
"
SupportsFeature
",
"
NodeListDevices
",
"
NodeGetCellsFreeMemory
",
"
ListDefinedNetworks
",
"
StoragePoolListVolumes
",
"
ListDomains
",
"
ListStoragePools
",
"
SecretSetValue
",
"
GetURI
",
"
ListInterfaces
",
"
ListDefinedStoragePools
",
"
NodeDeviceDettach
",
"
ListNetworks
",
"
NodeDeviceListCaps
",
"
NodeDeviceReset
",
"
NodeDeviceReAttach
",
"
ListSecrets
",
"
DomainBlockPeek
",
"
DomainCreateWithFlags
",
...
...
@@ -928,8 +915,9 @@ elsif ($opt_k) {
# fix priv_name for the NumOf* functions
if
(
$priv_name
eq
"
privateData
"
and
!
(
$call
->
{
ProcName
}
=~
m/Domains/
)
and
$call
->
{
ProcName
}
=~
m/NumOf(Defined|Domain)*(\S+)s/
)
{
!
(
$call
->
{
ProcName
}
=~
m/(Domains|DomainSnapshot)/
)
and
(
$call
->
{
ProcName
}
=~
m/NumOf(Defined|Domain)*(\S+)s/
or
$call
->
{
ProcName
}
=~
m/List(Defined|Domain)*(\S+)s/
))
{
my
$prefix
=
lc
$
2
;
$prefix
=~
s/(pool|vol)$//
;
$priv_name
=
"
${prefix}
PrivateData
";
...
...
@@ -940,6 +928,11 @@ elsif ($opt_k) {
my
$call_ret
=
"
&ret
";
my
$single_ret_var
=
"
int rv = -1
";
my
$single_ret_type
=
"
int
";
my
$single_ret_as_list
=
0
;
my
$single_ret_list_error_msg_type
=
"
undefined
";
my
$single_ret_list_name
=
"
undefined
";
my
$single_ret_list_max_var
=
"
undefined
";
my
$single_ret_list_max_define
=
"
undefined
";
my
$multi_ret
=
0
;
if
(
$call
->
{
ret
}
ne
"
void
"
and
...
...
@@ -964,6 +957,30 @@ elsif ($opt_k) {
}
else
{
die
"
unhandled type for multi-return-value:
$ret_member
";
}
}
elsif
(
$ret_member
=~
m/remote_nonnull_string (\S+)<(\S+)>;/
)
{
$single_ret_as_list
=
1
;
$single_ret_list_name
=
$
1
;
$single_ret_list_max_var
=
"
max$1
";
$single_ret_list_max_define
=
$
2
;
my
$first_arg
=
shift
(
@args_list
);
my
$second_arg
;
if
(
$call
->
{
ProcName
}
eq
"
NodeListDevices
")
{
$second_arg
=
shift
(
@args_list
);
}
unshift
(
@args_list
,
"
char **const $1
");
if
(
defined
$second_arg
)
{
unshift
(
@args_list
,
$second_arg
);
}
unshift
(
@args_list
,
$first_arg
);
push
(
@ret_list
,
"
rv = ret.$1.$1_len;
");
$single_ret_var
=
"
int rv = -1
";
$single_ret_type
=
"
int
";
}
elsif
(
$ret_member
=~
m/remote_nonnull_string (\S+);/
)
{
push
(
@ret_list
,
"
rv = ret.$1;
");
$single_ret_var
=
"
char *rv = NULL
";
...
...
@@ -1062,9 +1079,23 @@ elsif ($opt_k) {
print
"
$var
;
\n
";
}
if
(
$single_ret_as_list
)
{
print
"
int i;
\n
";
}
print
"
\n
";
print
"
remoteDriverLock(priv);
\n
";
if
(
$single_ret_as_list
)
{
print
"
\n
";
print
"
if (
$single_ret_list_max_var
>
$single_ret_list_max_define
) {
\n
";
print
"
remoteError(VIR_ERR_RPC,
\n
";
print
"
_(
\"
too many remote
${single_ret_list_error_msg_type}
s: %d > %d
\"
),
\n
";
print
"
$single_ret_list_max_var
,
$single_ret_list_max_define
);
\n
";
print
"
goto done;
\n
";
print
"
}
\n
";
}
if
(
@setters_list
)
{
print
"
\n
";
print
"
";
...
...
@@ -1088,6 +1119,32 @@ elsif ($opt_k) {
print
"
goto done;
\n
";
print
"
\n
";
if
(
$single_ret_as_list
)
{
print
"
if (ret.
$single_ret_list_name
.
${single_ret_list_name}
_len >
$single_ret_list_max_var
) {
\n
";
print
"
remoteError(VIR_ERR_RPC,
\n
";
print
"
_(
\"
too many remote
${single_ret_list_error_msg_type}
s: %d > %d
\"
),
\n
";
print
"
ret.
$single_ret_list_name
.
${single_ret_list_name}
_len,
$single_ret_list_max_var
);
\n
";
print
"
goto cleanup;
\n
";
print
"
}
\n
";
print
"
\n
";
print
"
/* This call is caller-frees (although that isn't clear from
\n
";
print
"
* the documentation). However xdr_free will free up both the
\n
";
print
"
* names and the list of pointers, so we have to strdup the
\n
";
print
"
* names here. */
\n
";
print
"
for (i = 0; i < ret.
$single_ret_list_name
.
${single_ret_list_name}
_len; ++i) {
\n
";
print
"
${single_ret_list_name}
[i] = strdup(ret.
$single_ret_list_name
.
${single_ret_list_name}
_val[i]);
\n
";
print
"
\n
";
print
"
if (
${single_ret_list_name}
[i] == NULL) {
\n
";
print
"
for (--i; i >= 0; --i)
\n
";
print
"
VIR_FREE(
${single_ret_list_name}
[i]);
\n
";
print
"
\n
";
print
"
virReportOOMError();
\n
";
print
"
goto cleanup;
\n
";
print
"
}
\n
";
print
"
}
\n
";
print
"
\n
";
}
if
(
@ret_list
)
{
print
"
";
print
join
("
\n
",
@ret_list
);
...
...
@@ -1098,6 +1155,12 @@ elsif ($opt_k) {
print
"
rv = 0;
\n
";
}
if
(
$single_ret_as_list
)
{
print
"
\n
";
print
"
cleanup:
\n
";
print
"
xdr_free((xdrproc_t)xdr_remote_
$call
->{name}_ret, (char *)&ret);
\n
";
}
print
"
\n
";
print
"
done:
\n
";
print
"
remoteDriverUnlock(priv);
\n
";
...
...
po/POTFILES.in
浏览文件 @
b5041a49
...
...
@@ -64,6 +64,7 @@ src/qemu/qemu_monitor.c
src/qemu/qemu_monitor_json.c
src/qemu/qemu_monitor_text.c
src/qemu/qemu_process.c
src/remote/remote_client_bodies.c
src/remote/remote_driver.c
src/secret/secret_driver.c
src/security/security_apparmor.c
...
...
src/remote/remote_client_bodies.c
浏览文件 @
b5041a49
此差异已折叠。
点击以展开。
src/remote/remote_driver.c
浏览文件 @
b5041a49
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录