Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
9a74649c
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看板
提交
9a74649c
编写于
4月 22, 2011
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remote generator, daemon: Handle functions with optional arguments
上级
04110306
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
148 addition
and
139 deletion
+148
-139
daemon/remote.c
daemon/remote.c
+0
-130
daemon/remote_dispatch_bodies.c
daemon/remote_dispatch_bodies.c
+132
-4
daemon/remote_generator.pl
daemon/remote_generator.pl
+16
-5
未找到文件。
daemon/remote.c
浏览文件 @
9a74649c
...
...
@@ -493,35 +493,6 @@ cleanup:
return
rv
;
}
static
int
remoteDispatchGetMaxVcpus
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
virConnectPtr
conn
,
remote_message_header
*
hdr
ATTRIBUTE_UNUSED
,
remote_error
*
rerr
,
remote_get_max_vcpus_args
*
args
,
remote_get_max_vcpus_ret
*
ret
)
{
char
*
type
;
int
rv
=
-
1
;
if
(
!
conn
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"connection not open"
));
goto
cleanup
;
}
type
=
args
->
type
?
*
args
->
type
:
NULL
;
if
((
ret
->
max_vcpus
=
virConnectGetMaxVcpus
(
conn
,
type
))
<
0
)
goto
cleanup
;
rv
=
0
;
cleanup:
if
(
rv
<
0
)
remoteDispatchError
(
rerr
);
return
rv
;
}
static
int
remoteDispatchNodeGetInfo
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
...
...
@@ -1359,46 +1330,6 @@ cleanup:
return
rv
;
}
static
int
remoteDispatchDomainMigratePerform
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
virConnectPtr
conn
,
remote_message_header
*
hdr
ATTRIBUTE_UNUSED
,
remote_error
*
rerr
,
remote_domain_migrate_perform_args
*
args
,
void
*
ret
ATTRIBUTE_UNUSED
)
{
virDomainPtr
dom
=
NULL
;
char
*
dname
;
int
rv
=
-
1
;
if
(
!
conn
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"connection not open"
));
goto
cleanup
;
}
if
(
!
(
dom
=
get_nonnull_domain
(
conn
,
args
->
dom
)))
goto
cleanup
;
dname
=
args
->
dname
==
NULL
?
NULL
:
*
args
->
dname
;
if
(
virDomainMigratePerform
(
dom
,
args
->
cookie
.
cookie_val
,
args
->
cookie
.
cookie_len
,
args
->
uri
,
args
->
flags
,
dname
,
args
->
resource
)
<
0
)
goto
cleanup
;
rv
=
0
;
cleanup:
if
(
rv
<
0
)
remoteDispatchError
(
rerr
);
if
(
dom
)
virDomainFree
(
dom
);
return
rv
;
}
static
int
remoteDispatchDomainMigratePrepare2
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
...
...
@@ -3139,37 +3070,6 @@ cleanup:
return
rv
;
}
static
int
remoteDispatchFindStoragePoolSources
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
virConnectPtr
conn
,
remote_message_header
*
hdr
ATTRIBUTE_UNUSED
,
remote_error
*
rerr
,
remote_find_storage_pool_sources_args
*
args
,
remote_find_storage_pool_sources_ret
*
ret
)
{
int
rv
=
-
1
;
if
(
!
conn
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"connection not open"
));
goto
cleanup
;
}
if
(
!
(
ret
->
xml
=
virConnectFindStoragePoolSources
(
conn
,
args
->
type
,
args
->
srcSpec
?
*
args
->
srcSpec
:
NULL
,
args
->
flags
)))
goto
cleanup
;
rv
=
0
;
cleanup:
if
(
rv
<
0
)
remoteDispatchError
(
rerr
);
return
rv
;
}
static
int
remoteDispatchStoragePoolGetInfo
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
...
...
@@ -3307,36 +3207,6 @@ cleanup:
* NODE INFO APIS
**************************************************************/
static
int
remoteDispatchNodeNumOfDevices
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
virConnectPtr
conn
,
remote_message_header
*
hdr
ATTRIBUTE_UNUSED
,
remote_error
*
rerr
,
remote_node_num_of_devices_args
*
args
,
remote_node_num_of_devices_ret
*
ret
)
{
int
rv
=
-
1
;
if
(
!
conn
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"connection not open"
));
goto
cleanup
;
}
if
((
ret
->
num
=
virNodeNumOfDevices
(
conn
,
args
->
cap
?
*
args
->
cap
:
NULL
,
args
->
flags
))
<
0
)
goto
cleanup
;
rv
=
0
;
cleanup:
if
(
rv
<
0
)
remoteDispatchError
(
rerr
);
return
rv
;
}
static
int
remoteDispatchNodeListDevices
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
...
...
daemon/remote_dispatch_bodies.c
浏览文件 @
9a74649c
...
...
@@ -1017,7 +1017,42 @@ cleanup:
return
rv
;
}
/* remoteDispatchDomainMigratePerform has to be implemented manually */
static
int
remoteDispatchDomainMigratePerform
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
virConnectPtr
conn
,
remote_message_header
*
hdr
ATTRIBUTE_UNUSED
,
remote_error
*
rerr
,
remote_domain_migrate_perform_args
*
args
,
void
*
ret
ATTRIBUTE_UNUSED
)
{
int
rv
=
-
1
;
virDomainPtr
dom
=
NULL
;
char
*
dname
;
if
(
!
conn
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"connection not open"
));
goto
cleanup
;
}
if
(
!
(
dom
=
get_nonnull_domain
(
conn
,
args
->
dom
)))
goto
cleanup
;
dname
=
args
->
dname
?
*
args
->
dname
:
NULL
;
if
(
virDomainMigratePerform
(
dom
,
args
->
cookie
.
cookie_val
,
args
->
cookie
.
cookie_len
,
args
->
uri
,
args
->
flags
,
dname
,
args
->
resource
)
<
0
)
goto
cleanup
;
rv
=
0
;
cleanup:
if
(
rv
<
0
)
remoteDispatchError
(
rerr
);
if
(
dom
)
virDomainFree
(
dom
);
return
rv
;
}
/* remoteDispatchDomainMigratePrepare has to be implemented manually */
...
...
@@ -1907,7 +1942,38 @@ cleanup:
return
rv
;
}
/* remoteDispatchFindStoragePoolSources has to be implemented manually */
static
int
remoteDispatchFindStoragePoolSources
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
virConnectPtr
conn
,
remote_message_header
*
hdr
ATTRIBUTE_UNUSED
,
remote_error
*
rerr
,
remote_find_storage_pool_sources_args
*
args
,
remote_find_storage_pool_sources_ret
*
ret
)
{
int
rv
=
-
1
;
char
*
srcSpec
;
char
*
xml
;
if
(
!
conn
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"connection not open"
));
goto
cleanup
;
}
srcSpec
=
args
->
srcSpec
?
*
args
->
srcSpec
:
NULL
;
if
((
xml
=
virConnectFindStoragePoolSources
(
conn
,
args
->
type
,
srcSpec
,
args
->
flags
))
==
NULL
)
goto
cleanup
;
ret
->
xml
=
xml
;
rv
=
0
;
cleanup:
if
(
rv
<
0
)
remoteDispatchError
(
rerr
);
return
rv
;
}
static
int
remoteDispatchGetCapabilities
(
...
...
@@ -1999,7 +2065,38 @@ cleanup:
return
rv
;
}
/* remoteDispatchGetMaxVcpus has to be implemented manually */
static
int
remoteDispatchGetMaxVcpus
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
virConnectPtr
conn
,
remote_message_header
*
hdr
ATTRIBUTE_UNUSED
,
remote_error
*
rerr
,
remote_get_max_vcpus_args
*
args
,
remote_get_max_vcpus_ret
*
ret
)
{
int
rv
=
-
1
;
char
*
type
;
int
max_vcpus
;
if
(
!
conn
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"connection not open"
));
goto
cleanup
;
}
type
=
args
->
type
?
*
args
->
type
:
NULL
;
if
((
max_vcpus
=
virConnectGetMaxVcpus
(
conn
,
type
))
<
0
)
goto
cleanup
;
ret
->
max_vcpus
=
max_vcpus
;
rv
=
0
;
cleanup:
if
(
rv
<
0
)
remoteDispatchError
(
rerr
);
return
rv
;
}
static
int
remoteDispatchGetSysinfo
(
...
...
@@ -3171,7 +3268,38 @@ cleanup:
/* remoteDispatchNodeListDevices has to be implemented manually */
/* remoteDispatchNodeNumOfDevices has to be implemented manually */
static
int
remoteDispatchNodeNumOfDevices
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
virConnectPtr
conn
,
remote_message_header
*
hdr
ATTRIBUTE_UNUSED
,
remote_error
*
rerr
,
remote_node_num_of_devices_args
*
args
,
remote_node_num_of_devices_ret
*
ret
)
{
int
rv
=
-
1
;
char
*
cap
;
int
num
;
if
(
!
conn
)
{
virNetError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"connection not open"
));
goto
cleanup
;
}
cap
=
args
->
cap
?
*
args
->
cap
:
NULL
;
if
((
num
=
virNodeNumOfDevices
(
conn
,
cap
,
args
->
flags
))
<
0
)
goto
cleanup
;
ret
->
num
=
num
;
rv
=
0
;
cleanup:
if
(
rv
<
0
)
remoteDispatchError
(
rerr
);
return
rv
;
}
static
int
remoteDispatchNumOfDefinedDomains
(
...
...
daemon/remote_generator.pl
浏览文件 @
9a74649c
...
...
@@ -241,7 +241,6 @@ elsif ($opt_b) {
@ungeneratable
=
("
Close
",
"
DomainEventsDeregisterAny
",
"
DomainEventsRegisterAny
",
"
DomainMigratePerform
",
"
DomainMigratePrepareTunnel
",
"
DomainOpenConsole
",
"
DomainPinVcpu
",
...
...
@@ -280,8 +279,6 @@ elsif ($opt_b) {
"
DomainMigratePrepare
",
"
DomainMigratePrepare2
",
"
DomainSnapshotListNames
",
"
FindStoragePoolSources
",
"
GetMaxVcpus
",
"
GetType
",
"
ListDefinedDomains
",
"
ListDefinedInterfaces
",
...
...
@@ -299,7 +296,6 @@ elsif ($opt_b) {
"
NodeGetInfo
",
"
NodeGetSecurityModel
",
"
NodeListDevices
",
"
NodeNumOfDevices
",
"
SecretGetValue
",
"
StoragePoolGetInfo
",
"
StoragePoolListVolumes
",
...
...
@@ -348,6 +344,7 @@ elsif ($opt_b) {
my
$has_node_device
=
0
;
my
@vars_list
=
();
my
@optionals_list
=
();
my
@getters_list
=
();
my
@args_list
=
();
my
@ret_list
=
();
...
...
@@ -470,6 +467,10 @@ elsif ($opt_b) {
if
(
$
1
eq
"
remote_uuid
")
{
push
(
@args_list
,
"
(unsigned char *) args->$2
");
}
elsif
(
$
1
eq
"
remote_string
")
{
push
(
@vars_list
,
"
char *$2
");
push
(
@optionals_list
,
"
$2
");
push
(
@args_list
,
"
$2
");
}
else
{
push
(
@args_list
,
"
args->$2
");
}
...
...
@@ -619,6 +620,14 @@ elsif ($opt_b) {
print
"
\n
";
}
foreach
my
$optional
(
@optionals_list
)
{
print
"
$optional
= args->
$optional
? *args->
$optional
: NULL;
\n
";
}
if
(
@optionals_list
)
{
print
"
\n
";
}
if
(
$calls
{
$_
}
->
{
ret
}
eq
"
void
")
{
print
"
if (vir
$calls
{
$_
}->{ProcName}(
";
print
join
('
,
',
@args_list
);
...
...
@@ -638,8 +647,10 @@ elsif ($opt_b) {
}
if
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
GetSysinfo
"
or
$calls
{
$_
}
->
{
ProcName
}
eq
"
GetMaxVcpus
"
or
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainXMLFromNative
"
or
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainXMLToNative
")
{
$calls
{
$_
}
->
{
ProcName
}
eq
"
DomainXMLToNative
"
or
$calls
{
$_
}
->
{
ProcName
}
eq
"
FindStoragePoolSources
")
{
$prefix
=
"
Connect
"
}
elsif
(
$calls
{
$_
}
->
{
ProcName
}
eq
"
SupportsFeature
")
{
$prefix
=
"
Drv
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录