Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
df0ebf6b
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看板
提交
df0ebf6b
编写于
4月 17, 2013
作者:
J
Ján Tomko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
conf: add PCI controllers
Add new controller type 'pci' with models 'pci-root' and 'pci-bridge'.
上级
024e9af3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
67 addition
and
2 deletion
+67
-2
docs/formatdomain.html.in
docs/formatdomain.html.in
+26
-1
docs/schemas/domaincommon.rng
docs/schemas/domaincommon.rng
+12
-0
src/conf/domain_conf.c
src/conf/domain_conf.c
+20
-1
src/conf/domain_conf.h
src/conf/domain_conf.h
+9
-0
未找到文件。
docs/formatdomain.html.in
浏览文件 @
df0ebf6b
...
...
@@ -2124,7 +2124,7 @@
<p>
Each controller has a mandatory attribute
<code>
type
</code>
,
which must be one of "ide", "fdc", "scsi", "sata", "usb",
"ccid",
or "virtio-serial
", and a mandatory
"ccid",
"virtio-serial" or "pci
", and a mandatory
attribute
<code>
index
</code>
which is the decimal integer
describing in which order the bus controller is encountered (for
use in
<code>
controller
</code>
attributes
...
...
@@ -2179,6 +2179,31 @@
<
/controller
>
...
<
/devices
>
...
</pre>
<p>
PCI controllers have an optional
<code>
model
</code>
attribute with
possible values
<code>
pci-root
</code>
or
<code>
pci-bridge
</code>
.
For machine types which provide an implicit pci bus, the pci-root
controller with index=0 is auto-added and required to use PCI devices.
PCI root has no address.
PCI bridges are auto-added if there are too many devices to fit on
the one bus provided by pci-root, or a PCI bus number greater than zero
was specified.
PCI bridges can also be specified manually, but their addresses should
only refer to PCI buses provided by already specified PCI controllers.
Leaving gaps in the PCI controller indexes might lead to an invalid
configuration.
(
<span
class=
"since"
>
since 1.0.5
</span>
)
</p>
<pre>
...
<
devices
>
<
controller type='pci' index='0' model='pci-root'/
>
<
controller type='pci' index='1' model='pci-bridge'
>
<
address type='pci' domain='0' bus='0' slot='5' function='0' multifunction=off'/
>
<
/controller
>
<
/devices
>
...
</pre>
<h4><a
name=
"elementsLease"
>
Device leases
</a></h4>
...
...
docs/schemas/domaincommon.rng
浏览文件 @
df0ebf6b
...
...
@@ -1470,6 +1470,18 @@
<ref
name=
"usbmaster"
/>
</optional>
</group>
<!-- pci has an optional attribute "model" -->
<group>
<attribute
name=
"type"
>
<value>
pci
</value>
</attribute>
<attribute
name=
"model"
>
<choice>
<value>
pci-root
</value>
<value>
pci-bridge
</value>
</choice>
</attribute>
</group>
<!-- virtio-serial has optional "ports" and "vectors" -->
<group>
<attribute
name=
"type"
>
...
...
src/conf/domain_conf.c
浏览文件 @
df0ebf6b
...
...
@@ -301,7 +301,12 @@ VIR_ENUM_IMPL(virDomainController, VIR_DOMAIN_CONTROLLER_TYPE_LAST,
"sata",
"virtio-serial",
"ccid",
"usb")
"usb",
"pci")
VIR_ENUM_IMPL(virDomainControllerModelPCI, VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST,
"pci-root",
"pci-bridge")
VIR_ENUM_IMPL(virDomainControllerModelSCSI, VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LAST,
"auto",
...
...
@@ -5164,6 +5169,8 @@ virDomainControllerModelTypeFromString(const virDomainControllerDefPtr def,
return virDomainControllerModelSCSITypeFromString(model);
else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB)
return virDomainControllerModelUSBTypeFromString(model);
else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI)
return virDomainControllerModelPCITypeFromString(model);
return -1;
}
...
...
@@ -5289,6 +5296,16 @@ virDomainControllerDefParseXML(xmlNodePtr node,
}
break;
}
case VIR_DOMAIN_CONTROLLER_TYPE_PCI:
switch (def->model) {
case VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT:
if (def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("pci-root controller should not "
"have an address"));
goto error;
}
}
default:
break;
...
...
@@ -13554,6 +13571,8 @@ virDomainControllerModelTypeToString(virDomainControllerDefPtr def,
return virDomainControllerModelSCSITypeToString(model);
else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_USB)
return virDomainControllerModelUSBTypeToString(model);
else if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI)
return virDomainControllerModelPCITypeToString(model);
return NULL;
}
...
...
src/conf/domain_conf.h
浏览文件 @
df0ebf6b
...
...
@@ -701,11 +701,19 @@ enum virDomainControllerType {
VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL
,
VIR_DOMAIN_CONTROLLER_TYPE_CCID
,
VIR_DOMAIN_CONTROLLER_TYPE_USB
,
VIR_DOMAIN_CONTROLLER_TYPE_PCI
,
VIR_DOMAIN_CONTROLLER_TYPE_LAST
};
enum
virDomainControllerModelPCI
{
VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT
,
VIR_DOMAIN_CONTROLLER_MODEL_PCI_BRIDGE
,
VIR_DOMAIN_CONTROLLER_MODEL_PCI_LAST
};
enum
virDomainControllerModelSCSI
{
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AUTO
,
VIR_DOMAIN_CONTROLLER_MODEL_SCSI_BUSLOGIC
,
...
...
@@ -2435,6 +2443,7 @@ VIR_ENUM_DECL(virDomainIoEventFd)
VIR_ENUM_DECL
(
virDomainVirtioEventIdx
)
VIR_ENUM_DECL
(
virDomainDiskCopyOnRead
)
VIR_ENUM_DECL
(
virDomainController
)
VIR_ENUM_DECL
(
virDomainControllerModelPCI
)
VIR_ENUM_DECL
(
virDomainControllerModelSCSI
)
VIR_ENUM_DECL
(
virDomainControllerModelUSB
)
VIR_ENUM_DECL
(
virDomainFS
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录