Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
2bfd45c9
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看板
提交
2bfd45c9
编写于
6月 13, 2006
作者:
D
Daniel Veillard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* src/libvirt.c src/xen_internal.c src/xend_internal.c
src/xs_internal.c: fix the connection and GetType initialization. Daniel
上级
7efa1c11
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
74 addition
and
7 deletion
+74
-7
ChangeLog
ChangeLog
+5
-0
src/libvirt.c
src/libvirt.c
+22
-3
src/xen_internal.c
src/xen_internal.c
+24
-2
src/xend_internal.c
src/xend_internal.c
+22
-1
src/xs_internal.c
src/xs_internal.c
+1
-1
未找到文件。
ChangeLog
浏览文件 @
2bfd45c9
Tue Jun 13 18:35:22 EDT 2006 Daniel Veillard <veillard@redhat.com>
* src/libvirt.c src/xen_internal.c src/xend_internal.c
src/xs_internal.c: fix the connection and GetType initialization.
Tue Jun 13 16:37:27 EDT 2006 Daniel Veillard <veillard@redhat.com>
* docs//*: rebuilt the documentation
...
...
src/libvirt.c
浏览文件 @
2bfd45c9
...
...
@@ -217,12 +217,19 @@ virGetVersion(unsigned long *libVer, const char *type,
virConnectPtr
virConnectOpen
(
const
char
*
name
)
{
int
i
,
res
;
int
i
,
res
,
for_xen
=
0
;
virConnectPtr
ret
=
NULL
;
if
(
!
initialized
)
virInitialize
();
if
(
name
==
NULL
)
{
name
=
"Xen"
;
for_xen
=
1
;
}
else
if
(
strncasecmp
(
name
,
"xen"
,
3
))
{
for_xen
=
1
;
}
ret
=
virGetConnect
();
if
(
ret
==
NULL
)
{
virLibConnError
(
NULL
,
VIR_ERR_NO_MEMORY
,
"Allocating connection"
);
...
...
@@ -236,8 +243,8 @@ virConnectOpen(const char *name)
* For a default connect to Xen make sure we manage to contact
* all related drivers.
*/
if
((
res
<
0
)
&&
(
name
==
NULL
)
&&
(
!
strnc
mp
(
virDriverTab
[
i
]
->
name
,
"X
en"
,
3
)))
if
((
res
<
0
)
&&
(
for_xen
)
&&
(
!
strnc
asecmp
(
virDriverTab
[
i
]
->
name
,
"x
en"
,
3
)))
goto
failed
;
if
(
res
==
0
)
ret
->
drivers
[
ret
->
nb_drivers
++
]
=
virDriverTab
[
i
];
...
...
@@ -282,6 +289,9 @@ virConnectOpenReadOnly(const char *name)
if
(
!
initialized
)
virInitialize
();
if
(
name
==
NULL
)
name
=
"Xen"
;
ret
=
virGetConnect
();
if
(
ret
==
NULL
)
{
virLibConnError
(
NULL
,
VIR_ERR_NO_MEMORY
,
"Allocating connection"
);
...
...
@@ -354,11 +364,20 @@ const char *
virConnectGetType
(
virConnectPtr
conn
)
{
int
i
;
const
char
*
ret
;
if
(
!
VIR_IS_CONNECT
(
conn
))
{
virLibConnError
(
conn
,
VIR_ERR_INVALID_CONN
,
__FUNCTION__
);
return
(
NULL
);
}
for
(
i
=
0
;
i
<
conn
->
nb_drivers
;
i
++
)
{
if
((
conn
->
drivers
[
i
]
!=
NULL
)
&&
(
conn
->
drivers
[
i
]
->
type
!=
NULL
))
{
ret
=
conn
->
drivers
[
i
]
->
type
(
conn
);
if
(
ret
!=
NULL
)
return
(
ret
);
}
}
for
(
i
=
0
;
i
<
conn
->
nb_drivers
;
i
++
)
{
if
((
conn
->
drivers
[
i
]
!=
NULL
)
&&
(
conn
->
drivers
[
i
]
->
name
!=
NULL
))
{
...
...
src/xen_internal.c
浏览文件 @
2bfd45c9
...
...
@@ -40,6 +40,8 @@ typedef struct hypercall_struct {
#define XEN_HYPERVISOR_SOCKET "/proc/xen/privcmd"
static
const
char
*
xenHypervisorGetType
(
virConnectPtr
conn
);
static
virDriver
xenHypervisorDriver
=
{
"Xen"
,
(
DOM0_INTERFACE_VERSION
>>
24
)
*
1000000
+
...
...
@@ -48,7 +50,7 @@ static virDriver xenHypervisorDriver = {
NULL
,
/* init */
xenHypervisorOpen
,
/* open */
xenHypervisorClose
,
/* close */
NULL
,
/* type */
xenHypervisorGetType
,
/* type */
xenHypervisorGetVersion
,
/* version */
NULL
,
/* nodeGetInfo */
xenHypervisorListDomains
,
/* listDomains */
...
...
@@ -121,7 +123,7 @@ xenHypervisorOpen(virConnectPtr conn, const char *name, int flags)
{
int
ret
;
if
((
name
!=
NULL
)
&&
(
strcmp
(
name
,
"xen"
)))
if
((
name
!=
NULL
)
&&
(
strc
asec
mp
(
name
,
"xen"
)))
return
(
-
1
);
conn
->
handle
=
-
1
;
...
...
@@ -201,6 +203,26 @@ xenHypervisorDoOp(int handle, dom0_op_t * op)
return
(
0
);
}
/**
* xenHypervisorGetType:
* @conn: pointer to the Xen Hypervisor block
*
* Get the version level of the Hypervisor running.
*
* Returns -1 in case of error, 0 otherwise. if the version can't be
* extracted by lack of capacities returns 0 and @hvVer is 0, otherwise
* @hvVer value is major * 1,000,000 + minor * 1,000 + release
*/
static
const
char
*
xenHypervisorGetType
(
virConnectPtr
conn
)
{
if
(
!
VIR_IS_CONNECT
(
conn
))
{
virXenError
(
VIR_ERR_INVALID_CONN
,
__FUNCTION__
,
0
);
return
(
NULL
);
}
return
(
"Xen"
);
}
/**
* xenHypervisorGetVersion:
* @conn: pointer to the connection block
...
...
src/xend_internal.c
浏览文件 @
2bfd45c9
...
...
@@ -36,6 +36,7 @@
#include "xend_internal.h"
#include "xen_internal.h"
/* for DOM0_INTERFACE_VERSION */
static
const
char
*
xenDaemonGetType
(
virConnectPtr
conn
);
static
int
xenDaemonNodeGetInfo
(
virConnectPtr
conn
,
virNodeInfoPtr
info
);
static
int
xenDaemonGetVersion
(
virConnectPtr
conn
,
unsigned
long
*
hvVer
);
...
...
@@ -47,7 +48,7 @@ static virDriver xenDaemonDriver = {
NULL
,
/* init */
xenDaemonOpen
,
/* open */
xenDaemonClose
,
/* close */
NULL
,
/* type */
xenDaemonGetType
,
/* type */
xenDaemonGetVersion
,
/* version */
xenDaemonNodeGetInfo
,
/* nodeGetInfo */
NULL
,
/* listDomains */
...
...
@@ -2076,6 +2077,26 @@ xenDaemonNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) {
return
(
ret
);
}
/**
* xenDaemonGetType:
* @conn: pointer to the Xen Daemon block
*
* Get the version level of the Hypervisor running.
*
* Returns -1 in case of error, 0 otherwise. if the version can't be
* extracted by lack of capacities returns 0 and @hvVer is 0, otherwise
* @hvVer value is major * 1,000,000 + minor * 1,000 + release
*/
static
const
char
*
xenDaemonGetType
(
virConnectPtr
conn
)
{
if
(
!
VIR_IS_CONNECT
(
conn
))
{
virXendError
(
conn
,
VIR_ERR_INVALID_CONN
,
__FUNCTION__
);
return
(
NULL
);
}
return
(
"XenDaemon"
);
}
/**
* xenDaemonGetVersion:
* @conn: pointer to the Xen Daemon block
...
...
src/xs_internal.c
浏览文件 @
2bfd45c9
...
...
@@ -288,7 +288,7 @@ virConnectCheckStoreID(virConnectPtr conn, int id)
int
xenStoreOpen
(
virConnectPtr
conn
,
const
char
*
name
,
int
flags
)
{
if
((
name
!=
NULL
)
&&
(
strcmp
(
name
,
"xen"
)))
if
((
name
!=
NULL
)
&&
(
strc
asec
mp
(
name
,
"xen"
)))
return
(
-
1
);
if
(
flags
&
VIR_DRV_OPEN_RO
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录