Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
d9bee413
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看板
提交
d9bee413
编写于
5月 23, 2016
作者:
P
Peter Krempa
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Move and rename qemuDomainCheckEjectableMedia to qemuProcessRefreshDisks
Move it to a more sane place since it's refreshing data about disks.
上级
f1690dc3
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
59 addition
and
55 deletion
+59
-55
src/qemu/qemu_hotplug.c
src/qemu/qemu_hotplug.c
+0
-48
src/qemu/qemu_hotplug.h
src/qemu/qemu_hotplug.h
+0
-3
src/qemu/qemu_migration.c
src/qemu/qemu_migration.c
+1
-1
src/qemu/qemu_process.c
src/qemu/qemu_process.c
+53
-3
src/qemu/qemu_process.h
src/qemu/qemu_process.h
+5
-0
未找到文件。
src/qemu/qemu_hotplug.c
浏览文件 @
d9bee413
...
...
@@ -283,54 +283,6 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
goto
cleanup
;
}
int
qemuDomainCheckEjectableMedia
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
qemuDomainAsyncJob
asyncJob
)
{
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
virHashTablePtr
table
=
NULL
;
int
ret
=
-
1
;
size_t
i
;
if
(
qemuDomainObjEnterMonitorAsync
(
driver
,
vm
,
asyncJob
)
==
0
)
{
table
=
qemuMonitorGetBlockInfo
(
priv
->
mon
);
if
(
qemuDomainObjExitMonitor
(
driver
,
vm
)
<
0
)
goto
cleanup
;
}
if
(
!
table
)
goto
cleanup
;
for
(
i
=
0
;
i
<
vm
->
def
->
ndisks
;
i
++
)
{
virDomainDiskDefPtr
disk
=
vm
->
def
->
disks
[
i
];
struct
qemuDomainDiskInfo
*
info
;
if
(
disk
->
device
==
VIR_DOMAIN_DISK_DEVICE_DISK
||
disk
->
device
==
VIR_DOMAIN_DISK_DEVICE_LUN
)
{
continue
;
}
info
=
qemuMonitorBlockInfoLookup
(
table
,
disk
->
info
.
alias
);
if
(
!
info
)
goto
cleanup
;
if
(
info
->
tray_open
)
{
if
(
virDomainDiskGetSource
(
disk
))
ignore_value
(
virDomainDiskSetSource
(
disk
,
NULL
));
disk
->
tray_status
=
VIR_DOMAIN_DISK_TRAY_OPEN
;
}
else
{
disk
->
tray_status
=
VIR_DOMAIN_DISK_TRAY_CLOSED
;
}
}
ret
=
0
;
cleanup:
virHashFree
(
table
);
return
ret
;
}
static
int
qemuDomainAttachVirtioDiskDevice
(
virConnectPtr
conn
,
...
...
src/qemu/qemu_hotplug.h
浏览文件 @
d9bee413
...
...
@@ -33,9 +33,6 @@ int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
virDomainDiskDefPtr
disk
,
virStorageSourcePtr
newsrc
,
bool
force
);
int
qemuDomainCheckEjectableMedia
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
qemuDomainAsyncJob
asyncJob
);
int
qemuDomainAttachControllerDevice
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
virDomainControllerDefPtr
controller
);
...
...
src/qemu/qemu_migration.c
浏览文件 @
d9bee413
...
...
@@ -3263,7 +3263,7 @@ qemuMigrationBegin(virConnectPtr conn,
* We don't want to require them on the destination.
*/
if
(
!
(
flags
&
VIR_MIGRATE_OFFLINE
)
&&
qemu
DomainCheckEjectableMedia
(
driver
,
vm
,
asyncJob
)
<
0
)
qemu
ProcessRefreshDisks
(
driver
,
vm
,
asyncJob
)
<
0
)
goto
endjob
;
if
(
!
(
xml
=
qemuMigrationBeginPhase
(
driver
,
vm
,
xmlin
,
dname
,
...
...
src/qemu/qemu_process.c
浏览文件 @
d9bee413
...
...
@@ -3306,7 +3306,7 @@ qemuProcessReconnect(void *opaque)
if
(
qemuProcessFiltersInstantiate
(
obj
->
def
))
goto
error
;
if
(
qemu
DomainCheckEjectableMedia
(
driver
,
obj
,
QEMU_ASYNC_JOB_NONE
)
<
0
)
if
(
qemu
ProcessRefreshDisks
(
driver
,
obj
,
QEMU_ASYNC_JOB_NONE
)
<
0
)
goto
error
;
if
(
qemuRefreshVirtioChannelState
(
driver
,
obj
)
<
0
)
...
...
@@ -5316,8 +5316,8 @@ qemuProcessLaunch(virConnectPtr conn,
if
(
qemuProcessUpdateVideoRamSize
(
driver
,
vm
,
asyncJob
)
<
0
)
goto
cleanup
;
VIR_DEBUG
(
"Updating
ejectable media status
"
);
if
(
qemu
DomainCheckEjectableMedia
(
driver
,
vm
,
asyncJob
)
<
0
)
VIR_DEBUG
(
"Updating
disk data
"
);
if
(
qemu
ProcessRefreshDisks
(
driver
,
vm
,
asyncJob
)
<
0
)
goto
cleanup
;
if
(
flags
&
VIR_QEMU_PROCESS_START_AUTODESTROY
&&
...
...
@@ -6231,3 +6231,53 @@ bool qemuProcessAutoDestroyActive(virQEMUDriverPtr driver,
cb
=
virCloseCallbacksGet
(
driver
->
closeCallbacks
,
vm
,
NULL
);
return
cb
==
qemuProcessAutoDestroy
;
}
int
qemuProcessRefreshDisks
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
qemuDomainAsyncJob
asyncJob
)
{
qemuDomainObjPrivatePtr
priv
=
vm
->
privateData
;
virHashTablePtr
table
=
NULL
;
int
ret
=
-
1
;
size_t
i
;
if
(
qemuDomainObjEnterMonitorAsync
(
driver
,
vm
,
asyncJob
)
==
0
)
{
table
=
qemuMonitorGetBlockInfo
(
priv
->
mon
);
if
(
qemuDomainObjExitMonitor
(
driver
,
vm
)
<
0
)
goto
cleanup
;
}
if
(
!
table
)
goto
cleanup
;
for
(
i
=
0
;
i
<
vm
->
def
->
ndisks
;
i
++
)
{
virDomainDiskDefPtr
disk
=
vm
->
def
->
disks
[
i
];
struct
qemuDomainDiskInfo
*
info
;
if
(
disk
->
device
==
VIR_DOMAIN_DISK_DEVICE_DISK
||
disk
->
device
==
VIR_DOMAIN_DISK_DEVICE_LUN
)
{
continue
;
}
info
=
qemuMonitorBlockInfoLookup
(
table
,
disk
->
info
.
alias
);
if
(
!
info
)
goto
cleanup
;
if
(
info
->
tray_open
)
{
if
(
virDomainDiskGetSource
(
disk
))
ignore_value
(
virDomainDiskSetSource
(
disk
,
NULL
));
disk
->
tray_status
=
VIR_DOMAIN_DISK_TRAY_OPEN
;
}
else
{
disk
->
tray_status
=
VIR_DOMAIN_DISK_TRAY_CLOSED
;
}
}
ret
=
0
;
cleanup:
virHashFree
(
table
);
return
ret
;
}
src/qemu/qemu_process.h
浏览文件 @
d9bee413
...
...
@@ -192,4 +192,9 @@ int qemuRefreshVirtioChannelState(virQEMUDriverPtr driver,
int
qemuProcessRefreshBalloonState
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
int
asyncJob
);
int
qemuProcessRefreshDisks
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
qemuDomainAsyncJob
asyncJob
);
#endif
/* __QEMU_PROCESS_H__ */
tester丶
🤺
@ssszwink
mentioned in commit
a829ef03
·
9月 10, 2020
mentioned in commit
a829ef03
mentioned in commit a829ef032300b8330457bdce9df062115318ba53
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录