Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
7e3dd506
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,发现更多精彩内容 >>
提交
7e3dd506
编写于
2月 12, 2017
作者:
P
Pavel Hrdina
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu_process: move capabilities check for iothreads
Signed-off-by:
N
Pavel Hrdina
<
phrdina@redhat.com
>
上级
caf66e01
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
26 deletion
+39
-26
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+5
-26
src/qemu/qemu_process.c
src/qemu/qemu_process.c
+34
-0
未找到文件。
src/qemu/qemu_command.c
浏览文件 @
7e3dd506
...
@@ -2586,23 +2586,11 @@ qemuBuildUSBControllerDevStr(virDomainControllerDefPtr def,
...
@@ -2586,23 +2586,11 @@ qemuBuildUSBControllerDevStr(virDomainControllerDefPtr def,
*/
*/
static
bool
static
bool
qemuCheckSCSIControllerIOThreads
(
const
virDomainDef
*
domainDef
,
qemuCheckSCSIControllerIOThreads
(
const
virDomainDef
*
domainDef
,
virDomainControllerDefPtr
def
,
virDomainControllerDefPtr
def
)
virQEMUCapsPtr
qemuCaps
)
{
{
if
(
!
def
->
iothread
)
if
(
!
def
->
iothread
)
return
true
;
return
true
;
/* By this time QEMU_CAPS_OBJECT_IOTHREAD was already checked.
* We just need to check if the QEMU_CAPS_VIRTIO_SCSI_IOTHREAD
* capability is set.
*/
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_VIRTIO_SCSI_IOTHREAD
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"IOThreads for virtio-scsi not supported for "
"this QEMU"
));
return
false
;
}
if
(
def
->
model
!=
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI
)
{
if
(
def
->
model
!=
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"IOThreads only supported for virtio-scsi "
_
(
"IOThreads only supported for virtio-scsi "
...
@@ -2681,8 +2669,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
...
@@ -2681,8 +2669,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
if
(
def
->
info
.
type
==
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW
)
{
if
(
def
->
info
.
type
==
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW
)
{
virBufferAddLit
(
&
buf
,
"virtio-scsi-ccw"
);
virBufferAddLit
(
&
buf
,
"virtio-scsi-ccw"
);
if
(
def
->
iothread
)
{
if
(
def
->
iothread
)
{
if
(
!
qemuCheckSCSIControllerIOThreads
(
domainDef
,
if
(
!
qemuCheckSCSIControllerIOThreads
(
domainDef
,
def
))
def
,
qemuCaps
))
goto
error
;
goto
error
;
virBufferAsprintf
(
&
buf
,
",iothread=iothread%u"
,
virBufferAsprintf
(
&
buf
,
",iothread=iothread%u"
,
def
->
iothread
);
def
->
iothread
);
...
@@ -2696,8 +2683,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
...
@@ -2696,8 +2683,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
}
else
{
}
else
{
virBufferAddLit
(
&
buf
,
"virtio-scsi-pci"
);
virBufferAddLit
(
&
buf
,
"virtio-scsi-pci"
);
if
(
def
->
iothread
)
{
if
(
def
->
iothread
)
{
if
(
!
qemuCheckSCSIControllerIOThreads
(
domainDef
,
if
(
!
qemuCheckSCSIControllerIOThreads
(
domainDef
,
def
))
def
,
qemuCaps
))
goto
error
;
goto
error
;
virBufferAsprintf
(
&
buf
,
",iothread=iothread%u"
,
virBufferAsprintf
(
&
buf
,
",iothread=iothread%u"
,
def
->
iothread
);
def
->
iothread
);
...
@@ -7389,20 +7375,13 @@ qemuBuildMemCommandLine(virCommandPtr cmd,
...
@@ -7389,20 +7375,13 @@ qemuBuildMemCommandLine(virCommandPtr cmd,
static
int
static
int
qemuBuildIOThreadCommandLine
(
virCommandPtr
cmd
,
qemuBuildIOThreadCommandLine
(
virCommandPtr
cmd
,
const
virDomainDef
*
def
,
const
virDomainDef
*
def
)
virQEMUCapsPtr
qemuCaps
)
{
{
size_t
i
;
size_t
i
;
if
(
def
->
niothreadids
==
0
)
if
(
def
->
niothreadids
==
0
)
return
0
;
return
0
;
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_OBJECT_IOTHREAD
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"IOThreads not supported for this QEMU"
));
return
-
1
;
}
/* Create iothread objects using the defined iothreadids list
/* Create iothread objects using the defined iothreadids list
* and the defined id and name from the list. These may be used
* and the defined id and name from the list. These may be used
* by a disk definition which will associate to an iothread by
* by a disk definition which will associate to an iothread by
...
@@ -9715,7 +9694,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
...
@@ -9715,7 +9694,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if
(
qemuBuildSmpCommandLine
(
cmd
,
def
)
<
0
)
if
(
qemuBuildSmpCommandLine
(
cmd
,
def
)
<
0
)
goto
error
;
goto
error
;
if
(
qemuBuildIOThreadCommandLine
(
cmd
,
def
,
qemuCaps
)
<
0
)
if
(
qemuBuildIOThreadCommandLine
(
cmd
,
def
)
<
0
)
goto
error
;
goto
error
;
if
(
virDomainNumaGetNodeCount
(
def
->
numa
)
&&
if
(
virDomainNumaGetNodeCount
(
def
->
numa
)
&&
...
...
src/qemu/qemu_process.c
浏览文件 @
7e3dd506
...
@@ -4584,6 +4584,37 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm,
...
@@ -4584,6 +4584,37 @@ qemuProcessStartValidateVideo(virDomainObjPtr vm,
}
}
static
int
qemuProcessStartValidateIOThreads
(
virDomainObjPtr
vm
,
virQEMUCapsPtr
qemuCaps
)
{
size_t
i
;
if
(
vm
->
def
->
niothreadids
>
0
&&
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_OBJECT_IOTHREAD
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"IOThreads not supported for this QEMU"
));
return
-
1
;
}
for
(
i
=
0
;
i
<
vm
->
def
->
ncontrollers
;
i
++
)
{
virDomainControllerDefPtr
cont
=
vm
->
def
->
controllers
[
i
];
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_SCSI
&&
cont
->
model
==
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI
&&
cont
->
iothread
>
0
&&
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_VIRTIO_SCSI_IOTHREAD
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"IOThreads for virtio-scsi not supported for "
"this QEMU"
));
return
-
1
;
}
}
return
0
;
}
static
int
static
int
qemuProcessStartValidateXML
(
virQEMUDriverPtr
driver
,
qemuProcessStartValidateXML
(
virQEMUDriverPtr
driver
,
virDomainObjPtr
vm
,
virDomainObjPtr
vm
,
...
@@ -4660,6 +4691,9 @@ qemuProcessStartValidate(virQEMUDriverPtr driver,
...
@@ -4660,6 +4691,9 @@ qemuProcessStartValidate(virQEMUDriverPtr driver,
if
(
qemuProcessStartValidateVideo
(
vm
,
qemuCaps
)
<
0
)
if
(
qemuProcessStartValidateVideo
(
vm
,
qemuCaps
)
<
0
)
return
-
1
;
return
-
1
;
if
(
qemuProcessStartValidateIOThreads
(
vm
,
qemuCaps
)
<
0
)
return
-
1
;
VIR_DEBUG
(
"Checking for any possible (non-fatal) issues"
);
VIR_DEBUG
(
"Checking for any possible (non-fatal) issues"
);
qemuProcessStartWarnShmem
(
vm
);
qemuProcessStartWarnShmem
(
vm
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录