Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
19b6914a
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
19b6914a
编写于
12月 21, 2011
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
virtio-s390: convert to QEMU Object Model
Signed-off-by:
N
Anthony Liguori
<
aliguori@us.ibm.com
>
上级
999e12bb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
65 addition
and
28 deletion
+65
-28
hw/s390-virtio-bus.c
hw/s390-virtio-bus.c
+65
-28
未找到文件。
hw/s390-virtio-bus.c
浏览文件 @
19b6914a
...
...
@@ -50,11 +50,19 @@ struct BusInfo s390_virtio_bus_info = {
.
size
=
sizeof
(
VirtIOS390Bus
),
};
typedef
struct
{
DeviceInfo
qdev
;
typedef
struct
VirtIOS390DeviceClass
{
DeviceClass
parent_class
;
int
(
*
init
)(
VirtIOS390Device
*
dev
);
}
VirtIOS390Device
Info
;
}
VirtIOS390Device
Class
;
#define TYPE_VIRTIO_S390_DEVICE "virtio-s390-device"
#define VIRTIO_S390_DEVICE(obj) \
OBJECT_CHECK(VirtIOS390Device, (obj), TYPE_VIRTIO_S390_DEVICE)
#define VIRTIO_S390_DEVICE_CLASS(klass) \
OBJECT_CLASS_CHECK(VirtIOS390DeviceClass, (klass), TYPE_VIRTIO_S390_DEVICE)
#define VIRTIO_S390_DEVICE_GET_CLASS(obj) \
OBJECT_GET_CLASS(VirtIOS390DeviceClass, (obj), TYPE_VIRTIO_S390_DEVICE)
static
const
VirtIOBindings
virtio_s390_bindings
;
...
...
@@ -343,12 +351,19 @@ static const VirtIOBindings virtio_s390_bindings = {
.
get_features
=
virtio_s390_get_features
,
};
static
VirtIOS390DeviceInfo
s390_virtio_net
=
{
.
init
=
s390_virtio_net_init
,
.
qdev
.
name
=
"virtio-net-s390"
,
.
qdev
.
alias
=
"virtio-net"
,
.
qdev
.
size
=
sizeof
(
VirtIOS390Device
),
.
qdev
.
props
=
(
Property
[])
{
static
void
s390_virtio_net_class_init
(
ObjectClass
*
klass
,
void
*
data
)
{
VirtIOS390DeviceClass
*
dc
=
VIRTIO_S390_DEVICE_CLASS
(
klass
);
dc
->
init
=
s390_virtio_net_init
;
}
static
DeviceInfo
s390_virtio_net
=
{
.
name
=
"virtio-net-s390"
,
.
alias
=
"virtio-net"
,
.
size
=
sizeof
(
VirtIOS390Device
),
.
class_init
=
s390_virtio_net_class_init
,
.
props
=
(
Property
[])
{
DEFINE_NIC_PROPERTIES
(
VirtIOS390Device
,
nic
),
DEFINE_PROP_UINT32
(
"x-txtimer"
,
VirtIOS390Device
,
net
.
txtimer
,
TX_TIMER_INTERVAL
),
...
...
@@ -359,24 +374,38 @@ static VirtIOS390DeviceInfo s390_virtio_net = {
},
};
static
VirtIOS390DeviceInfo
s390_virtio_blk
=
{
.
init
=
s390_virtio_blk_init
,
.
qdev
.
name
=
"virtio-blk-s390"
,
.
qdev
.
alias
=
"virtio-blk"
,
.
qdev
.
size
=
sizeof
(
VirtIOS390Device
),
.
qdev
.
props
=
(
Property
[])
{
static
void
s390_virtio_blk_class_init
(
ObjectClass
*
klass
,
void
*
data
)
{
VirtIOS390DeviceClass
*
dc
=
VIRTIO_S390_DEVICE_CLASS
(
klass
);
dc
->
init
=
s390_virtio_blk_init
;
}
static
DeviceInfo
s390_virtio_blk
=
{
.
name
=
"virtio-blk-s390"
,
.
alias
=
"virtio-blk"
,
.
size
=
sizeof
(
VirtIOS390Device
),
.
class_init
=
s390_virtio_blk_class_init
,
.
props
=
(
Property
[])
{
DEFINE_BLOCK_PROPERTIES
(
VirtIOS390Device
,
block
),
DEFINE_PROP_STRING
(
"serial"
,
VirtIOS390Device
,
block_serial
),
DEFINE_PROP_END_OF_LIST
(),
},
};
static
VirtIOS390DeviceInfo
s390_virtio_serial
=
{
.
init
=
s390_virtio_serial_init
,
.
qdev
.
name
=
"virtio-serial-s390"
,
.
qdev
.
alias
=
"virtio-serial"
,
.
qdev
.
size
=
sizeof
(
VirtIOS390Device
),
.
qdev
.
props
=
(
Property
[])
{
static
void
s390_virtio_serial_class_init
(
ObjectClass
*
klass
,
void
*
data
)
{
VirtIOS390DeviceClass
*
dc
=
VIRTIO_S390_DEVICE_CLASS
(
klass
);
dc
->
init
=
s390_virtio_serial_init
;
}
static
DeviceInfo
s390_virtio_serial
=
{
.
name
=
"virtio-serial-s390"
,
.
alias
=
"virtio-serial"
,
.
size
=
sizeof
(
VirtIOS390Device
),
.
class_init
=
s390_virtio_serial_class_init
,
.
props
=
(
Property
[])
{
DEFINE_PROP_UINT32
(
"max_ports"
,
VirtIOS390Device
,
serial
.
max_virtserial_ports
,
31
),
DEFINE_PROP_END_OF_LIST
(),
...
...
@@ -385,24 +414,32 @@ static VirtIOS390DeviceInfo s390_virtio_serial = {
static
int
s390_virtio_busdev_init
(
DeviceState
*
dev
,
DeviceInfo
*
info
)
{
VirtIOS390DeviceInfo
*
_info
=
(
VirtIOS390DeviceInfo
*
)
info
;
VirtIOS390Device
*
_dev
=
(
VirtIOS390Device
*
)
dev
;
VirtIOS390DeviceClass
*
_info
=
VIRTIO_S390_DEVICE_GET_CLASS
(
dev
);
return
_info
->
init
(
_dev
);
}
static
void
s390_virtio_bus_register_withprop
(
VirtIOS390
DeviceInfo
*
info
)
static
void
s390_virtio_bus_register_withprop
(
DeviceInfo
*
info
)
{
info
->
qdev
.
init
=
s390_virtio_busdev_init
;
info
->
qdev
.
bus_info
=
&
s390_virtio_bus_info
;
info
->
qdev
.
unplug
=
qdev_simple_unplug_cb
;
info
->
init
=
s390_virtio_busdev_init
;
info
->
bus_info
=
&
s390_virtio_bus_info
;
info
->
unplug
=
qdev_simple_unplug_cb
;
assert
(
info
->
qdev
.
size
>=
sizeof
(
VirtIOS390Device
));
qdev_register
(
&
info
->
qdev
);
assert
(
info
->
size
>=
sizeof
(
VirtIOS390Device
));
qdev_register
_subclass
(
info
,
TYPE_VIRTIO_S390_DEVICE
);
}
static
TypeInfo
virtio_s390_device_info
=
{
.
name
=
TYPE_VIRTIO_S390_DEVICE
,
.
parent
=
TYPE_DEVICE
,
.
instance_size
=
sizeof
(
VirtIOS390Device
),
.
abstract
=
true
,
};
static
void
s390_virtio_register
(
void
)
{
type_register_static
(
&
virtio_s390_device_info
);
s390_virtio_bus_register_withprop
(
&
s390_virtio_serial
);
s390_virtio_bus_register_withprop
(
&
s390_virtio_blk
);
s390_virtio_bus_register_withprop
(
&
s390_virtio_net
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录