Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
c44ba1d4
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,发现更多精彩内容 >>
提交
c44ba1d4
编写于
11月 27, 2017
作者:
J
John Ferlan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
qemu: Use virDomainPCIControllerOpts in qemuBuildControllerDevStr
Shorten up a few characters and reference the pciopts pointer
上级
e1f7c354
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
60 addition
and
58 deletion
+60
-58
src/qemu/qemu_command.c
src/qemu/qemu_command.c
+60
-58
未找到文件。
src/qemu/qemu_command.c
浏览文件 @
c44ba1d4
...
...
@@ -2608,6 +2608,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
int
*
nusbcontroller
)
{
virBuffer
buf
=
VIR_BUFFER_INITIALIZER
;
const
virDomainPCIControllerOpts
*
pciopts
;
const
char
*
modelName
=
NULL
;
*
devstr
=
NULL
;
...
...
@@ -2711,24 +2712,26 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
break
;
case
VIR_DOMAIN_CONTROLLER_TYPE_PCI
:
pciopts
=
&
def
->
opts
.
pciopts
;
switch
((
virDomainControllerModelPCI
)
def
->
model
)
{
case
VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE
:
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
||
def
->
opts
.
pciopts
.
chassisNr
==
-
1
)
{
pciopts
->
chassisNr
==
-
1
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"autogenerated pci-bridge options not set"
));
goto
error
;
}
modelName
=
virDomainControllerPCIModelNameTypeToString
(
def
->
opts
.
pciopts
.
modelName
);
modelName
=
virDomainControllerPCIModelNameTypeToString
(
pciopts
->
modelName
);
if
(
!
modelName
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown pci-bridge model name value %d"
),
def
->
opts
.
pciopts
.
modelName
);
pciopts
->
modelName
);
goto
error
;
}
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCI_BRIDGE
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"PCI controller model name '%s' "
...
...
@@ -2743,26 +2746,26 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
goto
error
;
}
virBufferAsprintf
(
&
buf
,
"%s,chassis_nr=%d,id=%s"
,
modelName
,
def
->
opts
.
pciopts
.
chassisNr
,
modelName
,
pciopts
->
chassisNr
,
def
->
info
.
alias
);
break
;
case
VIR_DOMAIN_CONTROLLER_MODEL_PCI_EXPANDER_BUS
:
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
||
def
->
opts
.
pciopts
.
busNr
==
-
1
)
{
pciopts
->
busNr
==
-
1
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"autogenerated pci-expander-bus options not set"
));
goto
error
;
}
modelName
=
virDomainControllerPCIModelNameTypeToString
(
def
->
opts
.
pciopts
.
modelName
);
modelName
=
virDomainControllerPCIModelNameTypeToString
(
pciopts
->
modelName
);
if
(
!
modelName
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown pci-expander-bus model name value %d"
),
def
->
opts
.
pciopts
.
modelName
);
pciopts
->
modelName
);
goto
error
;
}
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"PCI controller model name '%s' "
...
...
@@ -2777,28 +2780,28 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
goto
error
;
}
virBufferAsprintf
(
&
buf
,
"%s,bus_nr=%d,id=%s"
,
modelName
,
def
->
opts
.
pciopts
.
busNr
,
modelName
,
pciopts
->
busNr
,
def
->
info
.
alias
);
if
(
def
->
opts
.
pciopts
.
numaNode
!=
-
1
)
if
(
pciopts
->
numaNode
!=
-
1
)
virBufferAsprintf
(
&
buf
,
",numa_node=%d"
,
def
->
opts
.
pciopts
.
numaNode
);
pciopts
->
numaNode
);
break
;
case
VIR_DOMAIN_CONTROLLER_MODEL_DMI_TO_PCI_BRIDGE
:
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"autogenerated dmi-to-pci-bridge options not set"
));
goto
error
;
}
modelName
=
virDomainControllerPCIModelNameTypeToString
(
def
->
opts
.
pciopts
.
modelName
);
modelName
=
virDomainControllerPCIModelNameTypeToString
(
pciopts
->
modelName
);
if
(
!
modelName
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown dmi-to-pci-bridge model name value %d"
),
def
->
opts
.
pciopts
.
modelName
);
pciopts
->
modelName
);
goto
error
;
}
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_I82801B11_BRIDGE
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"PCI controller model name '%s' "
...
...
@@ -2815,24 +2818,23 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
virBufferAsprintf
(
&
buf
,
"%s,id=%s"
,
modelName
,
def
->
info
.
alias
);
break
;
case
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT_PORT
:
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
||
def
->
opts
.
pciopts
.
chassis
==
-
1
||
def
->
opts
.
pciopts
.
port
==
-
1
)
{
pciopts
->
chassis
==
-
1
||
pciopts
->
port
==
-
1
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"autogenerated pcie-root-port options not set"
));
goto
error
;
}
modelName
=
virDomainControllerPCIModelNameTypeToString
(
def
->
opts
.
pciopts
.
modelName
);
modelName
=
virDomainControllerPCIModelNameTypeToString
(
pciopts
->
modelName
);
if
(
!
modelName
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown pcie-root-port model name value %d"
),
def
->
opts
.
pciopts
.
modelName
);
pciopts
->
modelName
);
goto
error
;
}
if
((
def
->
opts
.
pciopts
.
modelName
!=
if
((
pciopts
->
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420
)
&&
(
def
->
opts
.
pciopts
.
modelName
!=
(
pciopts
->
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"PCI controller model name '%s' "
...
...
@@ -2840,7 +2842,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
modelName
);
goto
error
;
}
if
((
def
->
opts
.
pciopts
.
modelName
==
if
((
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_IOH3420
)
&&
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_DEVICE_IOH3420
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
...
...
@@ -2848,7 +2850,7 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
"controller is not supported in this QEMU binary"
));
goto
error
;
}
if
((
def
->
opts
.
pciopts
.
modelName
==
if
((
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PCIE_ROOT_PORT
)
&&
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_DEVICE_PCIE_ROOT_PORT
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
...
...
@@ -2858,24 +2860,24 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
}
virBufferAsprintf
(
&
buf
,
"%s,port=0x%x,chassis=%d,id=%s"
,
modelName
,
def
->
opts
.
pciopts
.
port
,
def
->
opts
.
pciopts
.
chassis
,
def
->
info
.
alias
);
modelName
,
pciopts
->
port
,
pciopts
->
chassis
,
def
->
info
.
alias
);
break
;
case
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_UPSTREAM_PORT
:
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"autogenerated pcie-switch-upstream-port options not set"
));
goto
error
;
}
modelName
=
virDomainControllerPCIModelNameTypeToString
(
def
->
opts
.
pciopts
.
modelName
);
modelName
=
virDomainControllerPCIModelNameTypeToString
(
pciopts
->
modelName
);
if
(
!
modelName
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown pcie-switch-upstream-port model name value %d"
),
def
->
opts
.
pciopts
.
modelName
);
pciopts
->
modelName
);
goto
error
;
}
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_X3130_UPSTREAM
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"PCI controller model name '%s' "
...
...
@@ -2893,24 +2895,24 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
virBufferAsprintf
(
&
buf
,
"%s,id=%s"
,
modelName
,
def
->
info
.
alias
);
break
;
case
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_SWITCH_DOWNSTREAM_PORT
:
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
||
def
->
opts
.
pciopts
.
chassis
==
-
1
||
def
->
opts
.
pciopts
.
port
==
-
1
)
{
pciopts
->
chassis
==
-
1
||
pciopts
->
port
==
-
1
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"autogenerated pcie-switch-downstream-port "
"options not set"
));
goto
error
;
}
modelName
=
virDomainControllerPCIModelNameTypeToString
(
def
->
opts
.
pciopts
.
modelName
);
modelName
=
virDomainControllerPCIModelNameTypeToString
(
pciopts
->
modelName
);
if
(
!
modelName
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown pcie-switch-downstream-port model name value %d"
),
def
->
opts
.
pciopts
.
modelName
);
pciopts
->
modelName
);
goto
error
;
}
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_XIO3130_DOWNSTREAM
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"PCI controller model name '%s' "
...
...
@@ -2926,26 +2928,26 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
goto
error
;
}
virBufferAsprintf
(
&
buf
,
"%s,port=0x%x,chassis=%d,id=%s"
,
modelName
,
def
->
opts
.
pciopts
.
port
,
def
->
opts
.
pciopts
.
chassis
,
def
->
info
.
alias
);
modelName
,
pciopts
->
port
,
pciopts
->
chassis
,
def
->
info
.
alias
);
break
;
case
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS
:
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
||
def
->
opts
.
pciopts
.
busNr
==
-
1
)
{
pciopts
->
busNr
==
-
1
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"autogenerated pcie-expander-bus options not set"
));
goto
error
;
}
modelName
=
virDomainControllerPCIModelNameTypeToString
(
def
->
opts
.
pciopts
.
modelName
);
modelName
=
virDomainControllerPCIModelNameTypeToString
(
pciopts
->
modelName
);
if
(
!
modelName
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown pcie-expander-bus model name value %d"
),
def
->
opts
.
pciopts
.
modelName
);
pciopts
->
modelName
);
goto
error
;
}
if
(
def
->
opts
.
pciopts
.
modelName
if
(
pciopts
->
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_PXB_PCIE
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"PCI controller model name '%s' "
...
...
@@ -2960,32 +2962,32 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
goto
error
;
}
virBufferAsprintf
(
&
buf
,
"%s,bus_nr=%d,id=%s"
,
modelName
,
def
->
opts
.
pciopts
.
busNr
,
modelName
,
pciopts
->
busNr
,
def
->
info
.
alias
);
if
(
def
->
opts
.
pciopts
.
numaNode
!=
-
1
)
if
(
pciopts
->
numaNode
!=
-
1
)
virBufferAsprintf
(
&
buf
,
",numa_node=%d"
,
def
->
opts
.
pciopts
.
numaNode
);
pciopts
->
numaNode
);
break
;
case
VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT
:
if
(
def
->
opts
.
pciopts
.
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
||
def
->
opts
.
pciopts
.
targetIndex
==
-
1
)
{
if
(
pciopts
->
modelName
==
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE
||
pciopts
->
targetIndex
==
-
1
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
"%s"
,
_
(
"autogenerated pci-root options not set"
));
goto
error
;
}
/* Skip the implicit one */
if
(
def
->
opts
.
pciopts
.
targetIndex
==
0
)
if
(
pciopts
->
targetIndex
==
0
)
goto
done
;
modelName
=
virDomainControllerPCIModelNameTypeToString
(
def
->
opts
.
pciopts
.
modelName
);
modelName
=
virDomainControllerPCIModelNameTypeToString
(
pciopts
->
modelName
);
if
(
!
modelName
)
{
virReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unknown pci-root model name value %d"
),
def
->
opts
.
pciopts
.
modelName
);
pciopts
->
modelName
);
goto
error
;
}
if
(
def
->
opts
.
pciopts
.
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE
)
{
if
(
pciopts
->
modelName
!=
VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_SPAPR_PCI_HOST_BRIDGE
)
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
_
(
"PCI controller model name '%s' is not valid for a pci-root"
),
modelName
);
...
...
@@ -2998,17 +3000,17 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
goto
error
;
}
virBufferAsprintf
(
&
buf
,
"%s,index=%d,id=%s"
,
modelName
,
def
->
opts
.
pciopts
.
targetIndex
,
modelName
,
pciopts
->
targetIndex
,
def
->
info
.
alias
);
if
(
def
->
opts
.
pciopts
.
numaNode
!=
-
1
)
{
if
(
pciopts
->
numaNode
!=
-
1
)
{
if
(
!
virQEMUCapsGet
(
qemuCaps
,
QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE
))
{
virReportError
(
VIR_ERR_CONFIG_UNSUPPORTED
,
"%s"
,
_
(
"the spapr-pci-host-bridge controller "
"doesn't support numa_node on this QEMU binary"
));
goto
error
;
}
virBufferAsprintf
(
&
buf
,
",numa_node=%d"
,
def
->
opts
.
pciopts
.
numaNode
);
virBufferAsprintf
(
&
buf
,
",numa_node=%d"
,
pciopts
->
numaNode
);
}
break
;
case
VIR_DOMAIN_CONTROLLER_MODEL_PCIE_ROOT
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录