Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
ccf6916c
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看板
提交
ccf6916c
编写于
4月 19, 2013
作者:
P
Paolo Bonzini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vhost-scsi-ccw: new device supporting the tcm_vhost Linux kernel module
Signed-off-by:
N
Paolo Bonzini
<
pbonzini@redhat.com
>
上级
50787628
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
65 addition
and
0 deletion
+65
-0
hw/s390x/virtio-ccw.c
hw/s390x/virtio-ccw.c
+51
-0
hw/s390x/virtio-ccw.h
hw/s390x/virtio-ccw.h
+14
-0
未找到文件。
hw/s390x/virtio-ccw.c
浏览文件 @
ccf6916c
...
...
@@ -687,6 +687,28 @@ static void virtio_ccw_scsi_instance_init(Object *obj)
object_property_add_child
(
obj
,
"virtio-backend"
,
OBJECT
(
&
dev
->
vdev
),
NULL
);
}
#ifdef CONFIG_VHOST_SCSI
static
int
vhost_ccw_scsi_init
(
VirtioCcwDevice
*
ccw_dev
)
{
VHostSCSICcw
*
dev
=
VHOST_SCSI_CCW
(
ccw_dev
);
DeviceState
*
vdev
=
DEVICE
(
&
dev
->
vdev
);
qdev_set_parent_bus
(
vdev
,
BUS
(
&
ccw_dev
->
bus
));
if
(
qdev_init
(
vdev
)
<
0
)
{
return
-
1
;
}
return
virtio_ccw_device_init
(
ccw_dev
,
VIRTIO_DEVICE
(
vdev
));
}
static
void
vhost_ccw_scsi_instance_init
(
Object
*
obj
)
{
VHostSCSICcw
*
dev
=
VHOST_SCSI_CCW
(
obj
);
object_initialize
(
OBJECT
(
&
dev
->
vdev
),
TYPE_VHOST_SCSI
);
object_property_add_child
(
obj
,
"virtio-backend"
,
OBJECT
(
&
dev
->
vdev
),
NULL
);
}
#endif
static
int
virtio_ccw_rng_init
(
VirtioCcwDevice
*
dev
)
{
VirtIODevice
*
vdev
;
...
...
@@ -897,6 +919,34 @@ static const TypeInfo virtio_ccw_scsi = {
.
class_init
=
virtio_ccw_scsi_class_init
,
};
#ifdef CONFIG_VHOST_SCSI
static
Property
vhost_ccw_scsi_properties
[]
=
{
DEFINE_PROP_STRING
(
"devno"
,
VirtioCcwDevice
,
bus_id
),
DEFINE_VHOST_SCSI_PROPERTIES
(
VirtIOSCSICcw
,
vdev
.
parent_obj
.
conf
),
DEFINE_VIRTIO_COMMON_FEATURES
(
VirtioCcwDevice
,
host_features
[
0
]),
DEFINE_PROP_END_OF_LIST
(),
};
static
void
vhost_ccw_scsi_class_init
(
ObjectClass
*
klass
,
void
*
data
)
{
DeviceClass
*
dc
=
DEVICE_CLASS
(
klass
);
VirtIOCCWDeviceClass
*
k
=
VIRTIO_CCW_DEVICE_CLASS
(
klass
);
k
->
init
=
vhost_ccw_scsi_init
;
k
->
exit
=
virtio_ccw_exit
;
dc
->
reset
=
virtio_ccw_reset
;
dc
->
props
=
vhost_ccw_scsi_properties
;
}
static
const
TypeInfo
vhost_ccw_scsi
=
{
.
name
=
TYPE_VHOST_SCSI_CCW
,
.
parent
=
TYPE_VIRTIO_CCW_DEVICE
,
.
instance_size
=
sizeof
(
VirtIOSCSICcw
),
.
instance_init
=
vhost_ccw_scsi_instance_init
,
.
class_init
=
vhost_ccw_scsi_class_init
,
};
#endif
static
void
virtio_ccw_rng_initfn
(
Object
*
obj
)
{
VirtioCcwDevice
*
dev
=
VIRTIO_CCW_DEVICE
(
obj
);
...
...
@@ -1054,6 +1104,7 @@ static void virtio_ccw_register(void)
type_register_static
(
&
virtio_ccw_net
);
type_register_static
(
&
virtio_ccw_balloon
);
type_register_static
(
&
virtio_ccw_scsi
);
type_register_static
(
&
vhost_ccw_scsi
);
type_register_static
(
&
virtio_ccw_rng
);
type_register_static
(
&
virtual_css_bridge_info
);
}
...
...
hw/s390x/virtio-ccw.h
浏览文件 @
ccf6916c
...
...
@@ -16,6 +16,9 @@
#include <hw/virtio/virtio-net.h>
#include <hw/virtio/virtio-serial.h>
#include <hw/virtio/virtio-scsi.h>
#ifdef CONFIG_VHOST_SCSI
#include <hw/virtio/vhost-scsi.h>
#endif
#include <hw/virtio/virtio-balloon.h>
#include <hw/virtio/virtio-rng.h>
#include <hw/virtio/virtio-bus.h>
...
...
@@ -101,6 +104,17 @@ typedef struct VirtIOSCSICcw {
VirtIOSCSI
vdev
;
}
VirtIOSCSICcw
;
/* vhost-scsi-ccw */
#define TYPE_VHOST_SCSI_CCW "vhost-scsi-ccw"
#define VHOST_SCSI_CCW(obj) \
OBJECT_CHECK(VHostSCSICcw, (obj), TYPE_VHOST_SCSI_CCW)
typedef
struct
VHostSCSICcw
{
VirtioCcwDevice
parent_obj
;
VHostSCSI
vdev
;
}
VHostSCSICcw
;
/* virtio-blk-ccw */
#define TYPE_VIRTIO_BLK_CCW "virtio-blk-ccw"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录