Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
c3912912
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看板
提交
c3912912
编写于
6月 17, 2010
作者:
M
Matthias Bolte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add optional model attribute to the controller element
This is a step towards controller support for the ESX driver.
上级
f8f29b1f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
55 addition
and
0 deletion
+55
-0
docs/schemas/domain.rng
docs/schemas/domain.rng
+9
-0
src/conf/domain_conf.c
src/conf/domain_conf.c
+34
-0
src/conf/domain_conf.h
src/conf/domain_conf.h
+11
-0
src/qemu/qemu_driver.c
src/qemu/qemu_driver.c
+1
-0
未找到文件。
docs/schemas/domain.rng
浏览文件 @
c3912912
...
@@ -670,6 +670,15 @@
...
@@ -670,6 +670,15 @@
<attribute
name=
"index"
>
<attribute
name=
"index"
>
<ref
name=
"unsignedInt"
/>
<ref
name=
"unsignedInt"
/>
</attribute>
</attribute>
<optional>
<attribute
name=
"model"
>
<choice>
<value>
buslogic
</value>
<value>
lsilogic
</value>
<value>
lsisas1068
</value>
</choice>
</attribute>
</optional>
<optional>
<optional>
<ref
name=
"address"
/>
<ref
name=
"address"
/>
</optional>
</optional>
...
...
src/conf/domain_conf.c
浏览文件 @
c3912912
...
@@ -139,6 +139,11 @@ VIR_ENUM_IMPL(virDomainController, VIR_DOMAIN_CONTROLLER_TYPE_LAST,
...
@@ -139,6 +139,11 @@ VIR_ENUM_IMPL(virDomainController, VIR_DOMAIN_CONTROLLER_TYPE_LAST,
"sata"
,
"sata"
,
"virtio-serial"
)
"virtio-serial"
)
VIR_ENUM_IMPL
(
virDomainControllerModel
,
VIR_DOMAIN_CONTROLLER_MODEL_LAST
,
"buslogic"
,
"lsilogic"
,
"lsisas1068"
)
VIR_ENUM_IMPL
(
virDomainFS
,
VIR_DOMAIN_FS_TYPE_LAST
,
VIR_ENUM_IMPL
(
virDomainFS
,
VIR_DOMAIN_FS_TYPE_LAST
,
"mount"
,
"mount"
,
"block"
,
"block"
,
...
@@ -1670,6 +1675,7 @@ virDomainControllerDefParseXML(xmlNodePtr node,
...
@@ -1670,6 +1675,7 @@ virDomainControllerDefParseXML(xmlNodePtr node,
virDomainControllerDefPtr
def
;
virDomainControllerDefPtr
def
;
char
*
type
=
NULL
;
char
*
type
=
NULL
;
char
*
idx
=
NULL
;
char
*
idx
=
NULL
;
char
*
model
=
NULL
;
if
(
VIR_ALLOC
(
def
)
<
0
)
{
if
(
VIR_ALLOC
(
def
)
<
0
)
{
virReportOOMError
();
virReportOOMError
();
...
@@ -1694,6 +1700,17 @@ virDomainControllerDefParseXML(xmlNodePtr node,
...
@@ -1694,6 +1700,17 @@ virDomainControllerDefParseXML(xmlNodePtr node,
}
}
}
}
model
=
virXMLPropString
(
node
,
"model"
);
if
(
model
)
{
if
((
def
->
model
=
virDomainControllerModelTypeFromString
(
model
))
<
0
)
{
virDomainReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"Unknown model type '%s'"
),
model
);
goto
error
;
}
}
else
{
def
->
model
=
-
1
;
}
if
(
virDomainDeviceInfoParseXML
(
node
,
&
def
->
info
,
flags
)
<
0
)
if
(
virDomainDeviceInfoParseXML
(
node
,
&
def
->
info
,
flags
)
<
0
)
goto
error
;
goto
error
;
...
@@ -1745,6 +1762,7 @@ virDomainControllerDefParseXML(xmlNodePtr node,
...
@@ -1745,6 +1762,7 @@ virDomainControllerDefParseXML(xmlNodePtr node,
cleanup:
cleanup:
VIR_FREE
(
type
);
VIR_FREE
(
type
);
VIR_FREE
(
idx
);
VIR_FREE
(
idx
);
VIR_FREE
(
model
);
return
def
;
return
def
;
...
@@ -4819,6 +4837,7 @@ static int virDomainDefMaybeAddController(virDomainDefPtr def,
...
@@ -4819,6 +4837,7 @@ static int virDomainDefMaybeAddController(virDomainDefPtr def,
cont
->
type
=
type
;
cont
->
type
=
type
;
cont
->
idx
=
idx
;
cont
->
idx
=
idx
;
cont
->
model
=
-
1
;
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL
)
{
if
(
cont
->
type
==
VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL
)
{
cont
->
opts
.
vioserial
.
ports
=
-
1
;
cont
->
opts
.
vioserial
.
ports
=
-
1
;
...
@@ -5232,6 +5251,7 @@ virDomainControllerDefFormat(virBufferPtr buf,
...
@@ -5232,6 +5251,7 @@ virDomainControllerDefFormat(virBufferPtr buf,
int
flags
)
int
flags
)
{
{
const
char
*
type
=
virDomainControllerTypeToString
(
def
->
type
);
const
char
*
type
=
virDomainControllerTypeToString
(
def
->
type
);
const
char
*
model
=
NULL
;
if
(
!
type
)
{
if
(
!
type
)
{
virDomainReportError
(
VIR_ERR_INTERNAL_ERROR
,
virDomainReportError
(
VIR_ERR_INTERNAL_ERROR
,
...
@@ -5239,10 +5259,24 @@ virDomainControllerDefFormat(virBufferPtr buf,
...
@@ -5239,10 +5259,24 @@ virDomainControllerDefFormat(virBufferPtr buf,
return
-
1
;
return
-
1
;
}
}
if
(
def
->
model
!=
-
1
)
{
model
=
virDomainControllerModelTypeToString
(
def
->
model
);
if
(
!
model
)
{
virDomainReportError
(
VIR_ERR_INTERNAL_ERROR
,
_
(
"unexpected model type %d"
),
def
->
model
);
return
-
1
;
}
}
virBufferVSprintf
(
buf
,
virBufferVSprintf
(
buf
,
" <controller type='%s' index='%d'"
,
" <controller type='%s' index='%d'"
,
type
,
def
->
idx
);
type
,
def
->
idx
);
if
(
model
)
{
virBufferEscapeString
(
buf
,
" model='%s'"
,
model
);
}
switch
(
def
->
type
)
{
switch
(
def
->
type
)
{
case
VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL
:
case
VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL
:
if
(
def
->
opts
.
vioserial
.
ports
!=
-
1
)
{
if
(
def
->
opts
.
vioserial
.
ports
!=
-
1
)
{
...
...
src/conf/domain_conf.h
浏览文件 @
c3912912
...
@@ -194,6 +194,15 @@ enum virDomainControllerType {
...
@@ -194,6 +194,15 @@ enum virDomainControllerType {
VIR_DOMAIN_CONTROLLER_TYPE_LAST
VIR_DOMAIN_CONTROLLER_TYPE_LAST
};
};
enum
virDomainControllerModel
{
VIR_DOMAIN_CONTROLLER_MODEL_BUSLOGIC
,
VIR_DOMAIN_CONTROLLER_MODEL_LSILOGIC
,
VIR_DOMAIN_CONTROLLER_MODEL_LSISAS1068
,
VIR_DOMAIN_CONTROLLER_MODEL_LAST
};
typedef
struct
_virDomainVirtioSerialOpts
virDomainVirtioSerialOpts
;
typedef
struct
_virDomainVirtioSerialOpts
virDomainVirtioSerialOpts
;
typedef
virDomainVirtioSerialOpts
*
virDomainVirtioSerialOptsPtr
;
typedef
virDomainVirtioSerialOpts
*
virDomainVirtioSerialOptsPtr
;
struct
_virDomainVirtioSerialOpts
{
struct
_virDomainVirtioSerialOpts
{
...
@@ -207,6 +216,7 @@ typedef virDomainControllerDef *virDomainControllerDefPtr;
...
@@ -207,6 +216,7 @@ typedef virDomainControllerDef *virDomainControllerDefPtr;
struct
_virDomainControllerDef
{
struct
_virDomainControllerDef
{
int
type
;
int
type
;
int
idx
;
int
idx
;
int
model
;
/* -1 == undef */
union
{
union
{
virDomainVirtioSerialOpts
vioserial
;
virDomainVirtioSerialOpts
vioserial
;
}
opts
;
}
opts
;
...
@@ -1073,6 +1083,7 @@ VIR_ENUM_DECL(virDomainDiskBus)
...
@@ -1073,6 +1083,7 @@ VIR_ENUM_DECL(virDomainDiskBus)
VIR_ENUM_DECL
(
virDomainDiskCache
)
VIR_ENUM_DECL
(
virDomainDiskCache
)
VIR_ENUM_DECL
(
virDomainDiskErrorPolicy
)
VIR_ENUM_DECL
(
virDomainDiskErrorPolicy
)
VIR_ENUM_DECL
(
virDomainController
)
VIR_ENUM_DECL
(
virDomainController
)
VIR_ENUM_DECL
(
virDomainControllerModel
)
VIR_ENUM_DECL
(
virDomainFS
)
VIR_ENUM_DECL
(
virDomainFS
)
VIR_ENUM_DECL
(
virDomainNet
)
VIR_ENUM_DECL
(
virDomainNet
)
VIR_ENUM_DECL
(
virDomainChrTarget
)
VIR_ENUM_DECL
(
virDomainChrTarget
)
...
...
src/qemu/qemu_driver.c
浏览文件 @
c3912912
...
@@ -7270,6 +7270,7 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
...
@@ -7270,6 +7270,7 @@ qemuDomainFindOrCreateSCSIDiskController(struct qemud_driver *driver,
}
}
cont
->
type
=
VIR_DOMAIN_CONTROLLER_TYPE_SCSI
;
cont
->
type
=
VIR_DOMAIN_CONTROLLER_TYPE_SCSI
;
cont
->
idx
=
0
;
cont
->
idx
=
0
;
cont
->
model
=
-
1
;
VIR_INFO0
(
"No SCSI controller present, hotplugging one"
);
VIR_INFO0
(
"No SCSI controller present, hotplugging one"
);
if
(
qemudDomainAttachPciControllerDevice
(
driver
,
if
(
qemudDomainAttachPciControllerDevice
(
driver
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录