Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
1edf5cc5
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1edf5cc5
编写于
7月 21, 2011
作者:
M
Michal Privoznik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
destroy: Implement internal API for xen driver
上级
73838d33
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
79 addition
and
4 deletion
+79
-4
src/xen/xen_driver.c
src/xen/xen_driver.c
+28
-0
src/xen/xen_driver.h
src/xen/xen_driver.h
+1
-0
src/xen/xen_hypervisor.c
src/xen/xen_hypervisor.c
+22
-2
src/xen/xen_hypervisor.h
src/xen/xen_hypervisor.h
+3
-0
src/xen/xen_inotify.c
src/xen/xen_inotify.c
+1
-0
src/xen/xend_internal.c
src/xen/xend_internal.c
+22
-2
src/xen/xm_internal.c
src/xen/xm_internal.c
+1
-0
src/xen/xs_internal.c
src/xen/xs_internal.c
+1
-0
未找到文件。
src/xen/xen_driver.c
浏览文件 @
1edf5cc5
...
...
@@ -925,6 +925,33 @@ xenUnifiedDomainDestroy (virDomainPtr dom)
return
-
1
;
}
static
int
xenUnifiedDomainDestroyFlags
(
virDomainPtr
dom
,
unsigned
int
flags
)
{
GET_PRIVATE
(
dom
->
conn
);
int
i
;
virCheckFlags
(
0
,
-
1
);
/* Try non-hypervisor methods first, then hypervisor direct method
* as a last resort.
*/
for
(
i
=
0
;
i
<
XEN_UNIFIED_NR_DRIVERS
;
++
i
)
if
(
i
!=
XEN_UNIFIED_HYPERVISOR_OFFSET
&&
priv
->
opened
[
i
]
&&
drivers
[
i
]
->
domainDestroyFlags
&&
drivers
[
i
]
->
domainDestroyFlags
(
dom
)
==
0
)
return
0
;
if
(
priv
->
opened
[
XEN_UNIFIED_HYPERVISOR_OFFSET
]
&&
drivers
[
XEN_UNIFIED_HYPERVISOR_OFFSET
]
->
domainDestroyFlags
&&
drivers
[
XEN_UNIFIED_HYPERVISOR_OFFSET
]
->
domainDestroyFlags
(
dom
)
==
0
)
return
0
;
return
-
1
;
}
static
char
*
xenUnifiedDomainGetOSType
(
virDomainPtr
dom
)
{
...
...
@@ -2205,6 +2232,7 @@ static virDriver xenUnifiedDriver = {
.
domainShutdown
=
xenUnifiedDomainShutdown
,
/* 0.0.3 */
.
domainReboot
=
xenUnifiedDomainReboot
,
/* 0.1.0 */
.
domainDestroy
=
xenUnifiedDomainDestroy
,
/* 0.0.3 */
.
domainDestroyFlags
=
xenUnifiedDomainDestroyFlags
,
/* 0.9.4 */
.
domainGetOSType
=
xenUnifiedDomainGetOSType
,
/* 0.0.3 */
.
domainGetMaxMemory
=
xenUnifiedDomainGetMaxMemory
,
/* 0.0.3 */
.
domainSetMaxMemory
=
xenUnifiedDomainSetMaxMemory
,
/* 0.0.3 */
...
...
src/xen/xen_driver.h
浏览文件 @
1edf5cc5
...
...
@@ -95,6 +95,7 @@ struct xenUnifiedDriver {
virDrvDomainShutdown
domainShutdown
;
virDrvDomainReboot
domainReboot
;
virDrvDomainDestroy
domainDestroy
;
virDrvDomainDestroyFlags
domainDestroyFlags
;
virDrvDomainGetOSType
domainGetOSType
;
virDrvDomainGetMaxMemory
domainGetMaxMemory
;
virDrvDomainSetMaxMemory
domainSetMaxMemory
;
...
...
src/xen/xen_hypervisor.c
浏览文件 @
1edf5cc5
...
...
@@ -816,6 +816,7 @@ struct xenUnifiedDriver xenHypervisorDriver = {
NULL
,
/* domainShutdown */
NULL
,
/* domainReboot */
xenHypervisorDestroyDomain
,
/* domainDestroy */
xenHypervisorDestroyDomainFlags
,
/* domainDestroyFlags */
xenHypervisorDomainGetOSType
,
/* domainGetOSType */
xenHypervisorGetMaxMemory
,
/* domainGetMaxMemory */
xenHypervisorSetMaxMemory
,
/* domainSetMaxMemory */
...
...
@@ -3433,19 +3434,26 @@ xenHypervisorResumeDomain(virDomainPtr domain)
}
/**
* xenHypervisorDestroyDomain:
* xenHypervisorDestroyDomain
Flags
:
* @domain: pointer to the domain block
* @flags: an OR'ed set of virDomainDestroyFlagsValues
*
* Do an hypervisor call to destroy the given domain
*
* Calling this function with no @flags set (equal to zero)
* is equivalent to calling xenHypervisorDestroyDomain.
*
* Returns 0 in case of success, -1 in case of error.
*/
int
xenHypervisorDestroyDomain
(
virDomainPtr
domain
)
xenHypervisorDestroyDomainFlags
(
virDomainPtr
domain
,
unsigned
int
flags
)
{
int
ret
;
xenUnifiedPrivatePtr
priv
;
virCheckFlags
(
0
,
-
1
);
if
(
domain
->
conn
==
NULL
)
return
-
1
;
...
...
@@ -3459,6 +3467,18 @@ xenHypervisorDestroyDomain(virDomainPtr domain)
return
(
0
);
}
/**
* xenHypervisorDestroyDomain:
* @domain: pointer to the domain block
*
* See xenHypervisorDestroyDomainFlags
*/
int
xenHypervisorDestroyDomain
(
virDomainPtr
domain
)
{
return
xenHypervisorDestroyDomainFlags
(
domain
,
0
);
}
/**
* xenHypervisorSetMaxMemory:
* @domain: pointer to the domain block
...
...
src/xen/xen_hypervisor.h
浏览文件 @
1edf5cc5
...
...
@@ -59,6 +59,9 @@ int xenHypervisorGetMaxVcpus (virConnectPtr conn,
const
char
*
type
);
int
xenHypervisorDestroyDomain
(
virDomainPtr
domain
)
ATTRIBUTE_NONNULL
(
1
);
int
xenHypervisorDestroyDomainFlags
(
virDomainPtr
domain
,
unsigned
int
flags
)
ATTRIBUTE_NONNULL
(
1
);
int
xenHypervisorResumeDomain
(
virDomainPtr
domain
)
ATTRIBUTE_NONNULL
(
1
);
int
xenHypervisorPauseDomain
(
virDomainPtr
domain
)
...
...
src/xen/xen_inotify.c
浏览文件 @
1edf5cc5
...
...
@@ -63,6 +63,7 @@ struct xenUnifiedDriver xenInotifyDriver = {
NULL
,
/* domainShutdown */
NULL
,
/* domainReboot */
NULL
,
/* domainDestroy */
NULL
,
/* domainDestroyFlags */
NULL
,
/* domainGetOSType */
NULL
,
/* domainGetMaxMemory */
NULL
,
/* domainSetMaxMemory */
...
...
src/xen/xend_internal.c
浏览文件 @
1edf5cc5
...
...
@@ -1509,8 +1509,9 @@ xenDaemonDomainReboot(virDomainPtr domain, unsigned int flags)
}
/**
* xenDaemonDomainDestroy:
* xenDaemonDomainDestroy
Flags
:
* @domain: pointer to the Domain block
* @flags: an OR'ed set of virDomainDestroyFlagsValues
*
* Abruptly halt the domain, the OS is not properly shutdown and the
* resources allocated for the domain are immediately freed, mounted
...
...
@@ -1519,11 +1520,17 @@ xenDaemonDomainReboot(virDomainPtr domain, unsigned int flags)
* dying and will go away completely once all of the resources have been
* unmapped (usually from the backend devices).
*
* Calling this function with no @flags set (equal to zero)
* is equivalent to calling xenDaemonDomainDestroy.
*
* Returns 0 in case of success, -1 (with errno) in case of error.
*/
int
xenDaemonDomainDestroy
(
virDomainPtr
domain
)
xenDaemonDomainDestroyFlags
(
virDomainPtr
domain
,
unsigned
int
flags
)
{
virCheckFlags
(
0
,
-
1
);
if
((
domain
==
NULL
)
||
(
domain
->
conn
==
NULL
)
||
(
domain
->
name
==
NULL
))
{
virXendError
(
VIR_ERR_INVALID_ARG
,
__FUNCTION__
);
return
(
-
1
);
...
...
@@ -1538,6 +1545,18 @@ xenDaemonDomainDestroy(virDomainPtr domain)
return
xend_op
(
domain
->
conn
,
domain
->
name
,
"op"
,
"destroy"
,
NULL
);
}
/**
* xenDaemonDomainDestroy:
* @domain: pointer to the Domain block
*
* See xenDaemonDomainDestroyFlags
*/
int
xenDaemonDomainDestroy
(
virDomainPtr
dom
)
{
return
xenDaemonDomainDestroyFlags
(
dom
,
0
);
}
/**
* xenDaemonDomainGetOSType:
* @domain: a domain object
...
...
@@ -3941,6 +3960,7 @@ struct xenUnifiedDriver xenDaemonDriver = {
xenDaemonDomainShutdown
,
/* domainShutdown */
xenDaemonDomainReboot
,
/* domainReboot */
xenDaemonDomainDestroy
,
/* domainDestroy */
xenDaemonDomainDestroyFlags
,
/* domainDestroyFlags */
xenDaemonDomainGetOSType
,
/* domainGetOSType */
xenDaemonDomainGetMaxMemory
,
/* domainGetMaxMemory */
xenDaemonDomainSetMaxMemory
,
/* domainSetMaxMemory */
...
...
src/xen/xm_internal.c
浏览文件 @
1edf5cc5
...
...
@@ -95,6 +95,7 @@ struct xenUnifiedDriver xenXMDriver = {
NULL
,
/* domainShutdown */
NULL
,
/* domainReboot */
NULL
,
/* domainDestroy */
NULL
,
/* domainDestroyFlags */
NULL
,
/* domainGetOSType */
xenXMDomainGetMaxMemory
,
/* domainGetMaxMemory */
xenXMDomainSetMaxMemory
,
/* domainSetMaxMemory */
...
...
src/xen/xs_internal.c
浏览文件 @
1edf5cc5
...
...
@@ -56,6 +56,7 @@ struct xenUnifiedDriver xenStoreDriver = {
xenStoreDomainShutdown
,
/* domainShutdown */
xenStoreDomainReboot
,
/* domainReboot */
NULL
,
/* domainDestroy */
NULL
,
/* domainDestroyFlags */
xenStoreDomainGetOSType
,
/* domainGetOSType */
xenStoreDomainGetMaxMemory
,
/* domainGetMaxMemory */
NULL
,
/* domainSetMaxMemory */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录