Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
5ec76b0c
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看板
提交
5ec76b0c
编写于
10月 11, 2017
作者:
J
Ján Tomko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move qemuCheckCCWS390AddressSupport to qemu_domain
Let it be reused in qemu_domain_address.
上级
fef28553
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
56 addition
and
56 deletion
+56
-56
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+5
-45
src/qemu/qemu_command.h
src/qemu/qemu_command.h
+0
-5
src/qemu/qemu_domain.c
src/qemu/qemu_domain.c
+40
-0
src/qemu/qemu_domain.h
src/qemu/qemu_domain.h
+5
-0
src/qemu/qemu_hotplug.c
src/qemu/qemu_hotplug.c
+6
-6
未找到文件。
src/qemu/qemu_command.c
浏览文件 @
5ec76b0c
...
...
@@ -1262,46 +1262,6 @@ qemuCheckDiskConfig(virDomainDiskDefPtr disk)
}
/* Check whether the device address is using either 'ccw' or default s390
* address format and whether that's "legal" for the current qemu and/or
* guest os.machine type. This is the corollary to the code which doesn't
* find the address type set using an emulator that supports either 'ccw'
* or s390 and sets the address type based on the capabilities.
*
* If the address is using 'ccw' or s390 and it's not supported, generate
* an error and return false; otherwise, return true.
*/
bool
qemuCheckCCWS390AddressSupport
(
const
virDomainDef
*
def
,
virDomainDeviceInfo
info
,
virQEMUCapsPtr
qemuCaps
,
const
char
*
devicename
)
{
if
(
info
.
type
==
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW
)
{
if
(
!
qemuDomainIsS390CCW
(
def
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"cannot use CCW address type for device "
"'%s' using machine type '%s'"
),
devicename
,
def
->
os
.
machine
);
return
false
;
}
else
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_VIRTIO_CCW
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"CCW address type is not supported by "
"this QEMU"
));
return
false
;
}
}
else
if
(
info
.
type
==
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390
)
{
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_VIRTIO_S390
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"virtio S390 address type is not supported by "
"this QEMU"
));
return
false
;
}
}
return
true
;
}
/* QEMU 1.2 and later have a binary flag -enable-fips that must be
* used for VNC auth to obey FIPS settings; but the flag only
* exists on Linux, and with no way to probe for it via QMP. Our
...
...
@@ -1951,7 +1911,7 @@ qemuBuildDriveDevStr(const virDomainDef *def,
if
(
qemuCheckDiskConfig
(
disk
)
<
0
)
goto
error
;
if
(
!
qemuCheckCCWS390AddressSupport
(
def
,
disk
->
info
,
qemuCaps
,
disk
->
dst
))
if
(
!
qemu
Domain
CheckCCWS390AddressSupport
(
def
,
disk
->
info
,
qemuCaps
,
disk
->
dst
))
goto
error
;
if
(
disk
->
iothread
&&
!
qemuCheckIOThreads
(
def
,
disk
))
...
...
@@ -2685,8 +2645,8 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
*
devstr
=
NULL
;
if
(
!
qemuCheckCCWS390AddressSupport
(
domainDef
,
def
->
info
,
qemuCaps
,
"controller"
))
if
(
!
qemu
Domain
CheckCCWS390AddressSupport
(
domainDef
,
def
->
info
,
qemuCaps
,
"controller"
))
return
-
1
;
if
(
def
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_SCSI
)
{
...
...
@@ -5895,8 +5855,8 @@ qemuBuildRNGDevStr(const virDomainDef *def,
goto
error
;
}
if
(
!
qemuCheckCCWS390AddressSupport
(
def
,
dev
->
info
,
qemuCaps
,
dev
->
source
.
file
))
if
(
!
qemu
Domain
CheckCCWS390AddressSupport
(
def
,
dev
->
info
,
qemuCaps
,
dev
->
source
.
file
))
goto
error
;
if
(
dev
->
info
.
type
==
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW
)
...
...
src/qemu/qemu_command.h
浏览文件 @
5ec76b0c
...
...
@@ -182,11 +182,6 @@ int qemuCheckDiskConfig(virDomainDiskDefPtr disk);
bool
qemuCheckFips
(
void
);
bool
qemuCheckCCWS390AddressSupport
(
const
virDomainDef
*
def
,
virDomainDeviceInfo
info
,
virQEMUCapsPtr
qemuCaps
,
const
char
*
devicename
);
virJSONValuePtr
qemuBuildHotpluggableCPUProps
(
const
virDomainVcpuDef
*
vcpu
)
ATTRIBUTE_NONNULL
(
1
);
...
...
src/qemu/qemu_domain.c
浏览文件 @
5ec76b0c
...
...
@@ -10162,3 +10162,43 @@ qemuDomainGetMachineName(virDomainObjPtr vm)
return
ret
;
}
/* Check whether the device address is using either 'ccw' or default s390
* address format and whether that's "legal" for the current qemu and/or
* guest os.machine type. This is the corollary to the code which doesn't
* find the address type set using an emulator that supports either 'ccw'
* or s390 and sets the address type based on the capabilities.
*
* If the address is using 'ccw' or s390 and it's not supported, generate
* an error and return false; otherwise, return true.
*/
bool
qemuDomainCheckCCWS390AddressSupport
(
const
virDomainDef
*
def
,
virDomainDeviceInfo
info
,
virQEMUCapsPtr
qemuCaps
,
const
char
*
devicename
)
{
if
(
info
.
type
==
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW
)
{
if
(
!
qemuDomainIsS390CCW
(
def
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"cannot use CCW address type for device "
"'%s' using machine type '%s'"
),
devicename
,
def
->
os
.
machine
);
return
false
;
}
else
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_VIRTIO_CCW
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"CCW address type is not supported by "
"this QEMU"
));
return
false
;
}
}
else
if
(
info
.
type
==
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390
)
{
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_VIRTIO_S390
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"virtio S390 address type is not supported by "
"this QEMU"
));
return
false
;
}
}
return
true
;
}
src/qemu/qemu_domain.h
浏览文件 @
5ec76b0c
...
...
@@ -987,4 +987,9 @@ int
qemuDomainObjPrivateXMLParseAllowReboot
(
xmlXPathContextPtr
ctxt
,
virTristateBool
*
allowReboot
);
bool
qemuDomainCheckCCWS390AddressSupport
(
const
virDomainDef
*
def
,
virDomainDeviceInfo
info
,
virQEMUCapsPtr
qemuCaps
,
const
char
*
devicename
);
#endif
/* __QEMU_DOMAIN_H__ */
src/qemu/qemu_hotplug.c
浏览文件 @
5ec76b0c
...
...
@@ -379,8 +379,8 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
else
if
(
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_VIRTIO_S390
))
disk
->
info
.
type
=
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390
;
}
else
{
if
(
!
qemuCheckCCWS390AddressSupport
(
vm
->
def
,
disk
->
info
,
priv
->
qemuCaps
,
disk
->
dst
))
if
(
!
qemu
Domain
CheckCCWS390AddressSupport
(
vm
->
def
,
disk
->
info
,
priv
->
qemuCaps
,
disk
->
dst
))
goto
cleanup
;
}
...
...
@@ -553,8 +553,8 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver,
else
if
(
virQEMUCapsGet
(
priv
->
qemuCaps
,
QEMU_CAPS_VIRTIO_S390
))
controller
->
info
.
type
=
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390
;
}
else
{
if
(
!
qemuCheckCCWS390AddressSupport
(
vm
->
def
,
controller
->
info
,
priv
->
qemuCaps
,
"controller"
))
if
(
!
qemu
Domain
CheckCCWS390AddressSupport
(
vm
->
def
,
controller
->
info
,
priv
->
qemuCaps
,
"controller"
))
goto
cleanup
;
}
...
...
@@ -2158,8 +2158,8 @@ qemuDomainAttachRNGDevice(virConnectPtr conn,
rng
->
info
.
type
=
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390
;
}
}
else
{
if
(
!
qemuCheckCCWS390AddressSupport
(
vm
->
def
,
rng
->
info
,
priv
->
qemuCaps
,
"rng"
))
if
(
!
qemu
Domain
CheckCCWS390AddressSupport
(
vm
->
def
,
rng
->
info
,
priv
->
qemuCaps
,
"rng"
))
goto
cleanup
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录