Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
07e3af9a
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
07e3af9a
编写于
5月 14, 2009
作者:
P
Paul Brook
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Virtio-blk qdev conversion
Signed-off-by:
N
Paul Brook
<
paul@codesourcery.com
>
上级
b4496b13
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
18 deletion
+15
-18
hw/pc.c
hw/pc.c
+1
-2
hw/pci-hotplug.c
hw/pci-hotplug.c
+2
-1
hw/ppc440_bamboo.c
hw/ppc440_bamboo.c
+1
-2
hw/ppce500_mpc8544ds.c
hw/ppce500_mpc8544ds.c
+1
-2
hw/virtio-blk.c
hw/virtio-blk.c
+10
-9
hw/virtio-blk.h
hw/virtio-blk.h
+0
-2
未找到文件。
hw/pc.c
浏览文件 @
07e3af9a
...
...
@@ -33,7 +33,6 @@
#include "boards.h"
#include "monitor.h"
#include "fw_cfg.h"
#include "virtio-blk.h"
#include "virtio-balloon.h"
#include "virtio-console.h"
#include "hpet_emul.h"
...
...
@@ -1136,7 +1135,7 @@ static void pc_init1(ram_addr_t ram_size,
int
unit_id
=
0
;
while
((
index
=
drive_get_index
(
IF_VIRTIO
,
0
,
unit_id
))
!=
-
1
)
{
virtio_blk_init
(
pci_bus
,
drives_table
[
index
].
bdrv
);
pci_create_simple
(
pci_bus
,
-
1
,
"virtio-blk"
);
unit_id
++
;
}
}
...
...
hw/pci-hotplug.c
浏览文件 @
07e3af9a
...
...
@@ -120,7 +120,8 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon, PCIBus *pci_bus,
opaque
=
pci_create_simple
(
pci_bus
,
-
1
,
"lsi53c895a"
);
break
;
case
IF_VIRTIO
:
opaque
=
virtio_blk_init
(
pci_bus
,
drives_table
[
drive_idx
].
bdrv
);
opaque
=
pci_create_simple
(
pci_bus
,
-
1
,
"virtio-blk"
);
qdev_init
(
opaque
);
break
;
}
...
...
hw/ppc440_bamboo.c
浏览文件 @
07e3af9a
...
...
@@ -16,7 +16,6 @@
#include "net.h"
#include "hw.h"
#include "pci.h"
#include "virtio-blk.h"
#include "virtio-console.h"
#include "boards.h"
#include "sysemu.h"
...
...
@@ -113,7 +112,7 @@ static void bamboo_init(ram_addr_t ram_size,
/* Add virtio block devices. */
while
((
i
=
drive_get_index
(
IF_VIRTIO
,
0
,
unit_id
))
!=
-
1
)
{
virtio_blk_init
(
pcibus
,
drives_table
[
i
].
bdrv
);
pci_create_simple
(
pcibus
,
-
1
,
"virtio-blk"
);
unit_id
++
;
}
...
...
hw/ppce500_mpc8544ds.c
浏览文件 @
07e3af9a
...
...
@@ -22,7 +22,6 @@
#include "hw.h"
#include "pc.h"
#include "pci.h"
#include "virtio-blk.h"
#include "boards.h"
#include "sysemu.h"
#include "kvm.h"
...
...
@@ -221,7 +220,7 @@ static void mpc8544ds_init(ram_addr_t ram_size,
/* Add virtio block devices. */
while
((
i
=
drive_get_index
(
IF_VIRTIO
,
0
,
unit_id
))
!=
-
1
)
{
virtio_blk_init
(
pci_bus
,
drives_table
[
i
].
bdrv
);
pci_create_simple
(
pci_bus
,
-
1
,
"virtio-blk"
);
unit_id
++
;
}
...
...
hw/virtio-blk.c
浏览文件 @
07e3af9a
...
...
@@ -348,19 +348,14 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int version_id)
return
0
;
}
void
*
virtio_blk_init
(
PCIBus
*
bus
,
BlockDriverState
*
bs
)
static
void
virtio_blk_init
(
PCIDevice
*
pci_dev
)
{
VirtIOBlock
*
s
;
int
cylinders
,
heads
,
secs
;
static
int
virtio_blk_id
;
PCIDevice
*
d
;
d
=
pci_register_device
(
bus
,
"virtio-blk"
,
sizeof
(
VirtIOBlock
),
-
1
,
NULL
,
NULL
);
if
(
!
d
)
return
NULL
;
BlockDriverState
*
bs
;
s
=
(
VirtIOBlock
*
)
virtio_init_pci
(
d
,
"virtio-blk"
,
s
=
(
VirtIOBlock
*
)
virtio_init_pci
(
pci_dev
,
"virtio-blk"
,
PCI_VENDOR_ID_REDHAT_QUMRANET
,
PCI_DEVICE_ID_VIRTIO_BLOCK
,
PCI_VENDOR_ID_REDHAT_QUMRANET
,
...
...
@@ -368,6 +363,7 @@ void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs)
PCI_CLASS_STORAGE_OTHER
,
0x00
,
sizeof
(
struct
virtio_blk_config
));
bs
=
qdev_init_bdrv
(
&
pci_dev
->
qdev
,
IF_VIRTIO
);
s
->
vdev
.
get_config
=
virtio_blk_update_config
;
s
->
vdev
.
get_features
=
virtio_blk_get_features
;
s
->
vdev
.
reset
=
virtio_blk_reset
;
...
...
@@ -382,6 +378,11 @@ void *virtio_blk_init(PCIBus *bus, BlockDriverState *bs)
qemu_add_vm_change_state_handler
(
virtio_blk_dma_restart_cb
,
s
);
register_savevm
(
"virtio-blk"
,
virtio_blk_id
++
,
2
,
virtio_blk_save
,
virtio_blk_load
,
s
);
}
return
s
;
static
void
virtio_blk_register_devices
(
void
)
{
pci_qdev_register
(
"virtio-blk"
,
sizeof
(
VirtIOBlock
),
virtio_blk_init
);
}
device_init
(
virtio_blk_register_devices
)
hw/virtio-blk.h
浏览文件 @
07e3af9a
...
...
@@ -82,6 +82,4 @@ struct virtio_scsi_inhdr
uint32_t
residual
;
};
void
*
virtio_blk_init
(
PCIBus
*
bus
,
BlockDriverState
*
bs
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录