Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
984c01ba
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看板
提交
984c01ba
编写于
7月 11, 2013
作者:
J
Jiri Denemark
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Emit VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED events
上级
3fbf78bd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
2 deletion
+31
-2
src/qemu/qemu_hotplug.c
src/qemu/qemu_hotplug.c
+28
-2
tests/qemuhotplugtest.c
tests/qemuhotplugtest.c
+3
-0
未找到文件。
src/qemu/qemu_hotplug.c
浏览文件 @
984c01ba
...
...
@@ -2234,6 +2234,7 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
virDomainDiskDefPtr
disk
)
{
virDomainDeviceDef
dev
;
virDomainEventPtr
event
;
size_t
i
;
VIR_DEBUG
(
"Removing disk %s from domain %p %s"
,
...
...
@@ -2241,6 +2242,10 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
virDomainAuditDisk
(
vm
,
disk
->
src
,
NULL
,
"detach"
,
true
);
event
=
virDomainEventDeviceRemovedNewFromObj
(
vm
,
disk
->
info
.
alias
);
if
(
event
)
qemuDomainEventQueue
(
driver
,
event
);
for
(
i
=
0
;
i
<
vm
->
def
->
ndisks
;
i
++
)
{
if
(
vm
->
def
->
disks
[
i
]
==
disk
)
{
virDomainDiskRemove
(
vm
->
def
,
i
);
...
...
@@ -2269,15 +2274,20 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver,
static
void
qemuDomainRemoveControllerDevice
(
virQEMUDriverPtr
driver
ATTRIBUTE_UNUSED
,
qemuDomainRemoveControllerDevice
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
virDomainControllerDefPtr
controller
)
{
virDomainEventPtr
event
;
size_t
i
;
VIR_DEBUG
(
"Removing controller %s from domain %p %s"
,
controller
->
info
.
alias
,
vm
,
vm
->
def
->
name
);
event
=
virDomainEventDeviceRemovedNewFromObj
(
vm
,
controller
->
info
.
alias
);
if
(
event
)
qemuDomainEventQueue
(
driver
,
event
);
for
(
i
=
0
;
i
<
vm
->
def
->
ncontrollers
;
i
++
)
{
if
(
vm
->
def
->
controllers
[
i
]
==
controller
)
{
virDomainControllerRemove
(
vm
->
def
,
i
);
...
...
@@ -2297,6 +2307,7 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
{
virQEMUDriverConfigPtr
cfg
=
virQEMUDriverGetConfig
(
driver
);
virNetDevVPortProfilePtr
vport
;
virDomainEventPtr
event
;
size_t
i
;
VIR_DEBUG
(
"Removing network interface %s from domain %p %s"
,
...
...
@@ -2304,6 +2315,10 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver,
virDomainAuditNet
(
vm
,
net
,
NULL
,
"detach"
,
true
);
event
=
virDomainEventDeviceRemovedNewFromObj
(
vm
,
net
->
info
.
alias
);
if
(
event
)
qemuDomainEventQueue
(
driver
,
event
);
for
(
i
=
0
;
i
<
vm
->
def
->
nnets
;
i
++
)
{
if
(
vm
->
def
->
nets
[
i
]
==
net
)
{
virDomainNetRemove
(
vm
->
def
,
i
);
...
...
@@ -2420,11 +2435,16 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
virDomainHostdevDefPtr
hostdev
)
{
virDomainNetDefPtr
net
=
NULL
;
virDomainEventPtr
event
;
size_t
i
;
VIR_DEBUG
(
"Removing host device %s from domain %p %s"
,
hostdev
->
info
->
alias
,
vm
,
vm
->
def
->
name
);
event
=
virDomainEventDeviceRemovedNewFromObj
(
vm
,
hostdev
->
info
->
alias
);
if
(
event
)
qemuDomainEventQueue
(
driver
,
event
);
if
(
hostdev
->
parent
.
type
==
VIR_DOMAIN_DEVICE_NET
)
{
net
=
hostdev
->
parent
.
data
.
net
;
...
...
@@ -2477,13 +2497,19 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver,
static
void
qemuDomainRemoveChrDevice
(
virQEMUDriverPtr
driver
ATTRIBUTE_UNUSED
,
qemuDomainRemoveChrDevice
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
virDomainChrDefPtr
chr
)
{
virDomainEventPtr
event
;
VIR_DEBUG
(
"Removing character device %s from domain %p %s"
,
chr
->
info
.
alias
,
vm
,
vm
->
def
->
name
);
event
=
virDomainEventDeviceRemovedNewFromObj
(
vm
,
chr
->
info
.
alias
);
if
(
event
)
qemuDomainEventQueue
(
driver
,
event
);
qemuDomainChrRemove
(
vm
->
def
,
chr
);
virDomainChrDefFree
(
chr
);
}
...
...
tests/qemuhotplugtest.c
浏览文件 @
984c01ba
...
...
@@ -269,6 +269,9 @@ mymain(void)
VIR_FREE
(
driver
.
config
->
spiceListen
);
VIR_FREE
(
driver
.
config
->
vncListen
);
if
(
!
(
driver
.
domainEventState
=
virDomainEventStateNew
()))
return
EXIT_FAILURE
;
/* some dummy values from 'config file' */
if
(
VIR_STRDUP_QUIET
(
driver
.
config
->
spicePassword
,
"123456"
)
<
0
)
return
EXIT_FAILURE
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录