Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
605542c3
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看板
提交
605542c3
编写于
1月 22, 2010
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virConnectBaselineCPU public API
上级
5130713b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
79 addition
and
0 deletion
+79
-0
include/libvirt/libvirt.h.in
include/libvirt/libvirt.h.in
+18
-0
python/generator.py
python/generator.py
+1
-0
python/libvirt-override-api.xml
python/libvirt-override-api.xml
+7
-0
python/libvirt-override.c
python/libvirt-override.c
+52
-0
src/libvirt_public.syms
src/libvirt_public.syms
+1
-0
未找到文件。
include/libvirt/libvirt.h.in
浏览文件 @
605542c3
...
...
@@ -1769,6 +1769,24 @@ int virConnectCompareCPU(virConnectPtr conn,
unsigned
int
flags
);
/**
* virConnectBaselineCPU:
*
* @conn: virConnect connection
* @ncpus: number of CPUs in xmlCPUs
* @xmlCPUs: array of XML descriptions of host CPUs
* @flags: fine-tuning flags
*
* Computes the most feature-rich CPU which is compatible with all given
* host CPUs.
*
* Returns XML description of the computed CPU or NULL on error.
*/
char
*
virConnectBaselineCPU
(
virConnectPtr
conn
,
const
char
**
xmlCPUs
,
unsigned
int
ncpus
,
unsigned
int
flags
);
#ifdef __cplusplus
}
#endif
...
...
python/generator.py
浏览文件 @
605542c3
...
...
@@ -308,6 +308,7 @@ skip_impl = (
'virEventRegisterImpl'
,
'virNodeListDevices'
,
'virNodeDeviceListCaps'
,
'virConnectBaselineCPU'
,
)
...
...
python/libvirt-override-api.xml
浏览文件 @
605542c3
...
...
@@ -231,5 +231,12 @@
<arg
name=
'conn'
type=
'virConnectPtr'
info=
'pointer to the hypervisor connection'
/>
<return
type=
'str *'
info=
'the list of Names of None in case of error'
/>
</function>
<function
name=
'virConnectBaselineCPU'
file=
'python'
>
<info>
Computes the most feature-rich CPU which is compatible with all given host CPUs.
</info>
<return
type=
'char *'
info=
'XML description of the computed CPU or NULL on error.'
/>
<arg
name=
'conn'
type=
'virConnectPtr'
info=
'virConnect connection'
/>
<arg
name=
'xmlCPUs'
type=
'const char **'
info=
'array of XML descriptions of host CPUs'
/>
<arg
name=
'flags'
type=
'unsigned int'
info=
'fine-tuning flags, currently unused, pass 0.'
/>
</function>
</symbols>
</api>
python/libvirt-override.c
浏览文件 @
605542c3
...
...
@@ -2019,6 +2019,57 @@ libvirt_virConnectListDefinedInterfaces(PyObject *self ATTRIBUTE_UNUSED,
return
(
py_retval
);
}
static
PyObject
*
libvirt_virConnectBaselineCPU
(
PyObject
*
self
ATTRIBUTE_UNUSED
,
PyObject
*
args
)
{
PyObject
*
pyobj_conn
;
PyObject
*
list
;
virConnectPtr
conn
;
unsigned
int
flags
;
const
char
**
xmlcpus
=
NULL
;
int
ncpus
=
0
;
char
*
base_cpu
;
PyObject
*
pybase_cpu
;
if
(
!
PyArg_ParseTuple
(
args
,
(
char
*
)
"OOi:virConnectBaselineCPU"
,
&
pyobj_conn
,
&
list
,
&
flags
))
return
(
NULL
);
conn
=
(
virConnectPtr
)
PyvirConnect_Get
(
pyobj_conn
);
if
(
PyList_Check
(
list
))
{
int
i
;
ncpus
=
PyList_Size
(
list
);
if
((
xmlcpus
=
malloc
(
ncpus
*
sizeof
(
*
xmlcpus
)))
==
NULL
)
return
VIR_PY_INT_FAIL
;
for
(
i
=
0
;
i
<
ncpus
;
i
++
)
{
xmlcpus
[
i
]
=
PyString_AsString
(
PyList_GetItem
(
list
,
i
));
if
(
xmlcpus
[
i
]
==
NULL
)
return
VIR_PY_INT_FAIL
;
}
}
LIBVIRT_BEGIN_ALLOW_THREADS
;
base_cpu
=
virConnectBaselineCPU
(
conn
,
xmlcpus
,
ncpus
,
flags
);
LIBVIRT_END_ALLOW_THREADS
;
free
(
xmlcpus
);
if
(
base_cpu
==
NULL
)
return
VIR_PY_INT_FAIL
;
pybase_cpu
=
PyString_FromString
(
base_cpu
);
free
(
base_cpu
);
if
(
pybase_cpu
==
NULL
)
return
VIR_PY_INT_FAIL
;
return
pybase_cpu
;
}
/*******************************************
* Helper functions to avoid importing modules
* for every callback
...
...
@@ -2734,6 +2785,7 @@ static PyMethodDef libvirtMethods[] = {
{(
char
*
)
"virSecretSetValue"
,
libvirt_virSecretSetValue
,
METH_VARARGS
,
NULL
},
{(
char
*
)
"virConnectListInterfaces"
,
libvirt_virConnectListInterfaces
,
METH_VARARGS
,
NULL
},
{(
char
*
)
"virConnectListDefinedInterfaces"
,
libvirt_virConnectListDefinedInterfaces
,
METH_VARARGS
,
NULL
},
{(
char
*
)
"virConnectBaselineCPU"
,
libvirt_virConnectBaselineCPU
,
METH_VARARGS
,
NULL
},
{
NULL
,
NULL
,
0
,
NULL
}
};
...
...
src/libvirt_public.syms
浏览文件 @
605542c3
...
...
@@ -353,6 +353,7 @@ LIBVIRT_0.7.7 {
global:
virDomainAttachDeviceFlags;
virDomainDetachDeviceFlags;
virConnectBaselineCPU;
} LIBVIRT_0.7.5;
# .... define new API here using predicted next version number ....
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录