Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
9c678ccd
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看板
提交
9c678ccd
编写于
5月 24, 2010
作者:
A
Anthony Liguori
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'kwolf/for-anthony' into staging
上级
3853528a
3e89cb04
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
8 deletion
+48
-8
aio.c
aio.c
+3
-1
block.c
block.c
+22
-1
block/vvfat.c
block/vvfat.c
+7
-3
hw/virtio-blk.c
hw/virtio-blk.c
+16
-3
未找到文件。
aio.c
浏览文件 @
9c678ccd
...
...
@@ -113,7 +113,9 @@ void qemu_aio_flush(void)
qemu_aio_wait
();
QLIST_FOREACH
(
node
,
&
aio_handlers
,
node
)
{
ret
|=
node
->
io_flush
(
node
->
opaque
);
if
(
node
->
io_flush
)
{
ret
|=
node
->
io_flush
(
node
->
opaque
);
}
}
}
while
(
qemu_bh_poll
()
||
ret
>
0
);
}
...
...
block.c
浏览文件 @
9c678ccd
...
...
@@ -329,6 +329,11 @@ static BlockDriver *find_image_format(const char *filename)
ret
=
bdrv_file_open
(
&
bs
,
filename
,
0
);
if
(
ret
<
0
)
return
NULL
;
/* Return the raw BlockDriver * to scsi-generic devices */
if
(
bs
->
sg
)
return
bdrv_find_format
(
"raw"
);
ret
=
bdrv_pread
(
bs
,
0
,
buf
,
sizeof
(
buf
));
bdrv_delete
(
bs
);
if
(
ret
<
0
)
{
...
...
@@ -356,6 +361,10 @@ static int refresh_total_sectors(BlockDriverState *bs, int64_t hint)
{
BlockDriver
*
drv
=
bs
->
drv
;
/* Do not attempt drv->bdrv_getlength() on scsi-generic devices */
if
(
bs
->
sg
)
return
0
;
/* query actual device if possible, otherwise just trust the hint */
if
(
drv
->
bdrv_getlength
)
{
int64_t
length
=
drv
->
bdrv_getlength
(
bs
);
...
...
@@ -1929,7 +1938,19 @@ static void multiwrite_cb(void *opaque, int ret)
static
int
multiwrite_req_compare
(
const
void
*
a
,
const
void
*
b
)
{
return
(((
BlockRequest
*
)
a
)
->
sector
-
((
BlockRequest
*
)
b
)
->
sector
);
const
BlockRequest
*
req1
=
a
,
*
req2
=
b
;
/*
* Note that we can't simply subtract req2->sector from req1->sector
* here as that could overflow the return value.
*/
if
(
req1
->
sector
>
req2
->
sector
)
{
return
1
;
}
else
if
(
req1
->
sector
<
req2
->
sector
)
{
return
-
1
;
}
else
{
return
0
;
}
}
/*
...
...
block/vvfat.c
浏览文件 @
9c678ccd
...
...
@@ -1244,7 +1244,7 @@ static void print_direntry(const direntry_t* direntry)
int
j
=
0
;
char
buffer
[
1024
];
fprintf
(
stderr
,
"direntry
0x%x: "
,
(
int
)
direntry
);
fprintf
(
stderr
,
"direntry
%p: "
,
direntry
);
if
(
!
direntry
)
return
;
if
(
is_long_name
(
direntry
))
{
...
...
@@ -1273,7 +1273,11 @@ static void print_direntry(const direntry_t* direntry)
static
void
print_mapping
(
const
mapping_t
*
mapping
)
{
fprintf
(
stderr
,
"mapping (0x%x): begin, end = %d, %d, dir_index = %d, first_mapping_index = %d, name = %s, mode = 0x%x, "
,
(
int
)
mapping
,
mapping
->
begin
,
mapping
->
end
,
mapping
->
dir_index
,
mapping
->
first_mapping_index
,
mapping
->
path
,
mapping
->
mode
);
fprintf
(
stderr
,
"mapping (%p): begin, end = %d, %d, dir_index = %d, "
"first_mapping_index = %d, name = %s, mode = 0x%x, "
,
mapping
,
mapping
->
begin
,
mapping
->
end
,
mapping
->
dir_index
,
mapping
->
first_mapping_index
,
mapping
->
path
,
mapping
->
mode
);
if
(
mapping
->
mode
&
MODE_DIRECTORY
)
fprintf
(
stderr
,
"parent_mapping_index = %d, first_dir_index = %d
\n
"
,
mapping
->
info
.
dir
.
parent_mapping_index
,
mapping
->
info
.
dir
.
first_dir_index
);
else
...
...
@@ -2865,7 +2869,7 @@ static void checkpoint(void) {
return
;
/* avoid compiler warnings: */
hexdump
(
NULL
,
100
);
remove_mapping
(
vvv
,
NULL
);
remove_mapping
(
vvv
,
0
);
print_mapping
(
NULL
);
print_direntry
(
NULL
);
}
...
...
hw/virtio-blk.c
浏览文件 @
9c678ccd
...
...
@@ -105,8 +105,10 @@ static void virtio_blk_flush_complete(void *opaque, int ret)
static
VirtIOBlockReq
*
virtio_blk_alloc_request
(
VirtIOBlock
*
s
)
{
VirtIOBlockReq
*
req
=
qemu_malloc
z
(
sizeof
(
*
req
));
VirtIOBlockReq
*
req
=
qemu_malloc
(
sizeof
(
*
req
));
req
->
dev
=
s
;
req
->
qiov
.
size
=
0
;
req
->
next
=
NULL
;
return
req
;
}
...
...
@@ -238,10 +240,20 @@ static void do_multiwrite(BlockDriverState *bs, BlockRequest *blkreq,
}
}
static
void
virtio_blk_handle_flush
(
VirtIOBlockReq
*
req
)
static
void
virtio_blk_handle_flush
(
BlockRequest
*
blkreq
,
int
*
num_writes
,
VirtIOBlockReq
*
req
,
BlockDriverState
**
old_bs
)
{
BlockDriverAIOCB
*
acb
;
/*
* Make sure all outstanding writes are posted to the backing device.
*/
if
(
*
old_bs
!=
NULL
)
{
do_multiwrite
(
*
old_bs
,
blkreq
,
*
num_writes
);
}
*
num_writes
=
0
;
*
old_bs
=
req
->
dev
->
bs
;
acb
=
bdrv_aio_flush
(
req
->
dev
->
bs
,
virtio_blk_flush_complete
,
req
);
if
(
!
acb
)
{
virtio_blk_req_complete
(
req
,
VIRTIO_BLK_S_IOERR
);
...
...
@@ -314,7 +326,8 @@ static void virtio_blk_handle_request(VirtIOBlockReq *req,
req
->
in
=
(
void
*
)
req
->
elem
.
in_sg
[
req
->
elem
.
in_num
-
1
].
iov_base
;
if
(
req
->
out
->
type
&
VIRTIO_BLK_T_FLUSH
)
{
virtio_blk_handle_flush
(
req
);
virtio_blk_handle_flush
(
mrb
->
blkreq
,
&
mrb
->
num_writes
,
req
,
&
mrb
->
old_bs
);
}
else
if
(
req
->
out
->
type
&
VIRTIO_BLK_T_SCSI_CMD
)
{
virtio_blk_handle_scsi
(
req
);
}
else
if
(
req
->
out
->
type
&
VIRTIO_BLK_T_OUT
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录