Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
e401b0cd
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看板
提交
e401b0cd
编写于
9月 23, 2011
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Implement virConnectIsAlive in all drivers
上级
afdf014f
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
161 addition
and
0 deletion
+161
-0
src/esx/esx_driver.c
src/esx/esx_driver.c
+18
-0
src/hyperv/hyperv_driver.c
src/hyperv/hyperv_driver.c
+18
-0
src/libxl/libxl_driver.c
src/libxl/libxl_driver.c
+8
-0
src/lxc/lxc_driver.c
src/lxc/lxc_driver.c
+7
-0
src/openvz/openvz_driver.c
src/openvz/openvz_driver.c
+7
-0
src/phyp/phyp_driver.c
src/phyp/phyp_driver.c
+18
-0
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+6
-0
src/remote/remote_driver.c
src/remote/remote_driver.c
+18
-0
src/rpc/virnetclient.c
src/rpc/virnetclient.c
+14
-0
src/rpc/virnetclient.h
src/rpc/virnetclient.h
+1
-0
src/test/test_driver.c
src/test/test_driver.c
+6
-0
src/uml/uml_driver.c
src/uml/uml_driver.c
+7
-0
src/vbox/vbox_tmpl.c
src/vbox/vbox_tmpl.c
+6
-0
src/vmware/vmware_driver.c
src/vmware/vmware_driver.c
+7
-0
src/xen/xen_driver.c
src/xen/xen_driver.c
+8
-0
src/xenapi/xenapi_driver.c
src/xenapi/xenapi_driver.c
+12
-0
未找到文件。
src/esx/esx_driver.c
浏览文件 @
e401b0cd
...
...
@@ -4175,6 +4175,23 @@ esxIsSecure(virConnectPtr conn)
static
int
esxIsAlive
(
virConnectPtr
conn
)
{
esxPrivate
*
priv
=
conn
->
privateData
;
/* XXX we should be able to do something better than this but this is
* simple, safe, and good enough for now. In worst case, the function will
* return true even though the connection is not alive.
*/
if
(
priv
->
primary
)
return
1
;
else
return
0
;
}
static
int
esxDomainIsActive
(
virDomainPtr
domain
)
{
...
...
@@ -4996,6 +5013,7 @@ static virDriver esxDriver = {
.
domainSnapshotCurrent
=
esxDomainSnapshotCurrent
,
/* 0.8.0 */
.
domainRevertToSnapshot
=
esxDomainRevertToSnapshot
,
/* 0.8.0 */
.
domainSnapshotDelete
=
esxDomainSnapshotDelete
,
/* 0.8.0 */
.
isAlive
=
esxIsAlive
,
/* 0.9.7 */
};
...
...
src/hyperv/hyperv_driver.c
浏览文件 @
e401b0cd
...
...
@@ -1118,6 +1118,23 @@ hypervIsSecure(virConnectPtr conn)
static
int
hypervIsAlive
(
virConnectPtr
conn
)
{
hypervPrivate
*
priv
=
conn
->
privateData
;
/* XXX we should be able to do something better than this is simple, safe,
* and good enough for now. In worst case, the function will return true
* even though the connection is not alive.
*/
if
(
priv
->
client
)
return
1
;
else
return
0
;
}
static
int
hypervDomainIsActive
(
virDomainPtr
domain
)
{
...
...
@@ -1276,6 +1293,7 @@ static virDriver hypervDriver = {
.
domainManagedSave
=
hypervDomainManagedSave
,
/* 0.9.5 */
.
domainHasManagedSaveImage
=
hypervDomainHasManagedSaveImage
,
/* 0.9.5 */
.
domainManagedSaveRemove
=
hypervDomainManagedSaveRemove
,
/* 0.9.5 */
.
isAlive
=
hypervIsAlive
,
/* 0.9.7 */
};
...
...
src/libxl/libxl_driver.c
浏览文件 @
e401b0cd
...
...
@@ -3877,6 +3877,13 @@ libxlDomainEventDeregisterAny(virConnectPtr conn, int callbackID)
}
static
int
libxlIsAlive
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
)
{
return
1
;
}
static
virDriver
libxlDriver
=
{
.
no
=
VIR_DRV_LIBXL
,
.
name
=
"xenlight"
,
...
...
@@ -3950,6 +3957,7 @@ static virDriver libxlDriver = {
.
domainIsUpdated
=
libxlDomainIsUpdated
,
/* 0.9.0 */
.
domainEventRegisterAny
=
libxlDomainEventRegisterAny
,
/* 0.9.0 */
.
domainEventDeregisterAny
=
libxlDomainEventDeregisterAny
,
/* 0.9.0 */
.
isAlive
=
libxlIsAlive
,
/* 0.9.7 */
};
static
virStateDriver
libxlStateDriver
=
{
...
...
src/lxc/lxc_driver.c
浏览文件 @
e401b0cd
...
...
@@ -201,6 +201,12 @@ static int lxcIsEncrypted(virConnectPtr conn ATTRIBUTE_UNUSED)
}
static
int
lxcIsAlive
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
)
{
return
1
;
}
static
char
*
lxcGetCapabilities
(
virConnectPtr
conn
)
{
lxc_driver_t
*
driver
=
conn
->
privateData
;
char
*
xml
;
...
...
@@ -3273,6 +3279,7 @@ static virDriver lxcDriver = {
.
domainEventRegisterAny
=
lxcDomainEventRegisterAny
,
/* 0.8.0 */
.
domainEventDeregisterAny
=
lxcDomainEventDeregisterAny
,
/* 0.8.0 */
.
domainOpenConsole
=
lxcDomainOpenConsole
,
/* 0.8.6 */
.
isAlive
=
lxcIsAlive
,
/* 0.9.7 */
};
static
virStateDriver
lxcStateDriver
=
{
...
...
src/openvz/openvz_driver.c
浏览文件 @
e401b0cd
...
...
@@ -1424,6 +1424,12 @@ static int openvzIsSecure(virConnectPtr conn ATTRIBUTE_UNUSED) {
return
1
;
}
static
int
openvzIsAlive
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
)
{
return
1
;
}
static
char
*
openvzGetCapabilities
(
virConnectPtr
conn
)
{
struct
openvz_driver
*
driver
=
conn
->
privateData
;
char
*
ret
;
...
...
@@ -1712,6 +1718,7 @@ static virDriver openvzDriver = {
.
domainIsActive
=
openvzDomainIsActive
,
/* 0.7.3 */
.
domainIsPersistent
=
openvzDomainIsPersistent
,
/* 0.7.3 */
.
domainIsUpdated
=
openvzDomainIsUpdated
,
/* 0.8.6 */
.
isAlive
=
openvzIsAlive
,
/* 0.9.7 */
};
int
openvzRegister
(
void
)
{
...
...
src/phyp/phyp_driver.c
浏览文件 @
e401b0cd
...
...
@@ -1293,6 +1293,23 @@ phypIsSecure(virConnectPtr conn ATTRIBUTE_UNUSED)
return
1
;
}
static
int
phypIsAlive
(
virConnectPtr
conn
)
{
ConnectionData
*
connection_data
=
conn
->
networkPrivateData
;
/* XXX we should be able to do something better but this is simple, safe,
* and good enough for now. In worst case, the function will return true
* even though the connection is not alive.
*/
if
(
connection_data
&&
connection_data
->
session
)
return
1
;
else
return
0
;
}
static
int
phypIsUpdated
(
virDomainPtr
conn
ATTRIBUTE_UNUSED
)
{
...
...
@@ -3795,6 +3812,7 @@ static virDriver phypDriver = {
.
isEncrypted
=
phypIsEncrypted
,
/* 0.7.3 */
.
isSecure
=
phypIsSecure
,
/* 0.7.3 */
.
domainIsUpdated
=
phypIsUpdated
,
/* 0.8.6 */
.
isAlive
=
phypIsAlive
,
/* 0.9.7 */
};
static
virStorageDriver
phypStorageDriver
=
{
...
...
src/qemu/qemu_driver.c
浏览文件 @
e401b0cd
...
...
@@ -940,6 +940,11 @@ static int qemuIsEncrypted(virConnectPtr conn ATTRIBUTE_UNUSED)
return
0
;
}
static
int
qemuIsAlive
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
)
{
return
1
;
}
static
int
kvmGetMaxVCPUs
(
void
)
{
int
maxvcpus
=
1
;
...
...
@@ -10907,6 +10912,7 @@ static virDriver qemuDriver = {
.
domainGetBlockJobInfo
=
qemuDomainGetBlockJobInfo
,
/* 0.9.4 */
.
domainBlockJobSetSpeed
=
qemuDomainBlockJobSetSpeed
,
/* 0.9.4 */
.
domainBlockPull
=
qemuDomainBlockPull
,
/* 0.9.4 */
.
isAlive
=
qemuIsAlive
,
/* 0.9.7 */
};
...
...
src/remote/remote_driver.c
浏览文件 @
e401b0cd
...
...
@@ -4229,6 +4229,23 @@ cleanup:
}
static
int
remoteIsAlive
(
virConnectPtr
conn
)
{
struct
private_data
*
priv
=
conn
->
privateData
;
bool
ret
;
remoteDriverLock
(
priv
);
ret
=
virNetClientIsOpen
(
priv
->
client
);
remoteDriverUnlock
(
priv
);
if
(
ret
)
return
1
;
else
return
0
;
}
#include "remote_client_bodies.h"
#include "qemu_client_bodies.h"
...
...
@@ -4600,6 +4617,7 @@ static virDriver remote_driver = {
.
domainBlockJobSetSpeed
=
remoteDomainBlockJobSetSpeed
,
/* 0.9.4 */
.
domainBlockPull
=
remoteDomainBlockPull
,
/* 0.9.4 */
.
setKeepAlive
=
remoteSetKeepAlive
,
/* 0.9.7 */
.
isAlive
=
remoteIsAlive
,
/* 0.9.7 */
};
static
virNetworkDriver
network_driver
=
{
...
...
src/rpc/virnetclient.c
浏览文件 @
e401b0cd
...
...
@@ -677,6 +677,20 @@ bool virNetClientIsEncrypted(virNetClientPtr client)
}
bool
virNetClientIsOpen
(
virNetClientPtr
client
)
{
bool
ret
;
if
(
!
client
)
return
false
;
virNetClientLock
(
client
);
ret
=
client
->
sock
&&
!
client
->
wantClose
;
virNetClientUnlock
(
client
);
return
ret
;
}
int
virNetClientAddProgram
(
virNetClientPtr
client
,
virNetClientProgramPtr
prog
)
{
...
...
src/rpc/virnetclient.h
浏览文件 @
e401b0cd
...
...
@@ -86,6 +86,7 @@ int virNetClientSetTLSSession(virNetClientPtr client,
virNetTLSContextPtr
tls
);
bool
virNetClientIsEncrypted
(
virNetClientPtr
client
);
bool
virNetClientIsOpen
(
virNetClientPtr
client
);
const
char
*
virNetClientLocalAddrString
(
virNetClientPtr
client
);
const
char
*
virNetClientRemoteAddrString
(
virNetClientPtr
client
);
...
...
src/test/test_driver.c
浏览文件 @
e401b0cd
...
...
@@ -1191,6 +1191,11 @@ static int testIsEncrypted(virConnectPtr conn ATTRIBUTE_UNUSED)
return
0
;
}
static
int
testIsAlive
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
)
{
return
1
;
}
static
int
testGetMaxVCPUs
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
,
const
char
*
type
ATTRIBUTE_UNUSED
)
{
...
...
@@ -5624,6 +5629,7 @@ static virDriver testDriver = {
.
domainIsUpdated
=
testDomainIsUpdated
,
/* 0.8.6 */
.
domainEventRegisterAny
=
testDomainEventRegisterAny
,
/* 0.8.0 */
.
domainEventDeregisterAny
=
testDomainEventDeregisterAny
,
/* 0.8.0 */
.
isAlive
=
testIsAlive
,
/* 0.9.7 */
};
static
virNetworkDriver
testNetworkDriver
=
{
...
...
src/uml/uml_driver.c
浏览文件 @
e401b0cd
...
...
@@ -1226,6 +1226,12 @@ static int umlIsEncrypted(virConnectPtr conn ATTRIBUTE_UNUSED)
}
static
int
umlIsAlive
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
)
{
return
1
;
}
static
char
*
umlGetCapabilities
(
virConnectPtr
conn
)
{
struct
uml_driver
*
driver
=
(
struct
uml_driver
*
)
conn
->
privateData
;
char
*
xml
;
...
...
@@ -2597,6 +2603,7 @@ static virDriver umlDriver = {
.
domainEventRegisterAny
=
umlDomainEventRegisterAny
,
/* 0.9.4 */
.
domainEventDeregisterAny
=
umlDomainEventDeregisterAny
,
/* 0.9.4 */
.
domainOpenConsole
=
umlDomainOpenConsole
,
/* 0.8.6 */
.
isAlive
=
umlIsAlive
,
/* 0.9.7 */
};
static
int
...
...
src/vbox/vbox_tmpl.c
浏览文件 @
e401b0cd
...
...
@@ -1082,6 +1082,11 @@ static int vboxIsEncrypted(virConnectPtr conn ATTRIBUTE_UNUSED) {
return
0
;
}
static
int
vboxIsAlive
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
)
{
return
1
;
}
static
int
vboxGetMaxVcpus
(
virConnectPtr
conn
,
const
char
*
type
ATTRIBUTE_UNUSED
)
{
VBOX_OBJECT_CHECK
(
conn
,
int
,
-
1
);
PRUint32
maxCPUCount
=
0
;
...
...
@@ -9194,6 +9199,7 @@ virDriver NAME(Driver) = {
.
domainSnapshotCurrent
=
vboxDomainSnapshotCurrent
,
/* 0.8.0 */
.
domainRevertToSnapshot
=
vboxDomainRevertToSnapshot
,
/* 0.8.0 */
.
domainSnapshotDelete
=
vboxDomainSnapshotDelete
,
/* 0.8.0 */
.
isAlive
=
vboxIsAlive
,
/* 0.9.7 */
};
virNetworkDriver
NAME
(
NetworkDriver
)
=
{
...
...
src/vmware/vmware_driver.c
浏览文件 @
e401b0cd
...
...
@@ -958,6 +958,12 @@ vmwareDomainGetState(virDomainPtr dom,
return
ret
;
}
static
int
vmwareIsAlive
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
)
{
return
1
;
}
static
virDriver
vmwareDriver
=
{
.
no
=
VIR_DRV_VMWARE
,
.
name
=
"VMWARE"
,
...
...
@@ -990,6 +996,7 @@ static virDriver vmwareDriver = {
.
domainUndefineFlags
=
vmwareDomainUndefineFlags
,
/* 0.9.4 */
.
domainIsActive
=
vmwareDomainIsActive
,
/* 0.8.7 */
.
domainIsPersistent
=
vmwareDomainIsPersistent
,
/* 0.8.7 */
.
isAlive
=
vmwareIsAlive
,
/* 0.9.7 */
};
int
...
...
src/xen/xen_driver.c
浏览文件 @
e401b0cd
...
...
@@ -506,6 +506,13 @@ xenUnifiedIsSecure(virConnectPtr conn)
return
ret
;
}
static
int
xenUnifiedIsAlive
(
virConnectPtr
conn
ATTRIBUTE_UNUSED
)
{
/* XenD reconnects for each request */
return
1
;
}
int
xenUnifiedGetMaxVcpus
(
virConnectPtr
conn
,
const
char
*
type
)
{
...
...
@@ -2249,6 +2256,7 @@ static virDriver xenUnifiedDriver = {
.
domainEventRegisterAny
=
xenUnifiedDomainEventRegisterAny
,
/* 0.8.0 */
.
domainEventDeregisterAny
=
xenUnifiedDomainEventDeregisterAny
,
/* 0.8.0 */
.
domainOpenConsole
=
xenUnifiedDomainOpenConsole
,
/* 0.8.6 */
.
isAlive
=
xenUnifiedIsAlive
,
/* 0.9.7 */
};
/**
...
...
src/xenapi/xenapi_driver.c
浏览文件 @
e401b0cd
...
...
@@ -1895,6 +1895,17 @@ xenapiNodeGetCellsFreeMemory (virConnectPtr conn, unsigned long long *freeMems,
}
}
static
int
xenapiIsAlive
(
virConnectPtr
conn
)
{
struct
_xenapiPrivate
*
priv
=
conn
->
privateData
;
if
(
priv
->
session
&&
priv
->
session
->
ok
)
return
1
;
else
return
0
;
}
/* The interface which we export upwards to libvirt.c. */
static
virDriver
xenapiDriver
=
{
.
no
=
VIR_DRV_XENAPI
,
...
...
@@ -1945,6 +1956,7 @@ static virDriver xenapiDriver = {
.
nodeGetCellsFreeMemory
=
xenapiNodeGetCellsFreeMemory
,
/* 0.8.0 */
.
nodeGetFreeMemory
=
xenapiNodeGetFreeMemory
,
/* 0.8.0 */
.
domainIsUpdated
=
xenapiDomainIsUpdated
,
/* 0.8.6 */
.
isAlive
=
xenapiIsAlive
,
/* 0.9.7 */
};
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录