Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
128aa589
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看板
提交
128aa589
编写于
9月 21, 2011
作者:
P
Paolo Bonzini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move corking functions to osdep.c
Signed-off-by:
N
Paolo Bonzini
<
pbonzini@redhat.com
>
上级
3777b09f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
18 deletion
+12
-18
block/sheepdog.c
block/sheepdog.c
+2
-18
osdep.c
osdep.c
+9
-0
qemu_socket.h
qemu_socket.h
+1
-0
未找到文件。
block/sheepdog.c
浏览文件 @
128aa589
...
...
@@ -702,22 +702,6 @@ static int aio_flush_request(void *opaque)
return
!
QLIST_EMPTY
(
&
s
->
outstanding_aio_head
);
}
#if !defined(SOL_TCP) || !defined(TCP_CORK)
static
int
set_cork
(
int
fd
,
int
v
)
{
return
0
;
}
#else
static
int
set_cork
(
int
fd
,
int
v
)
{
return
setsockopt
(
fd
,
SOL_TCP
,
TCP_CORK
,
&
v
,
sizeof
(
v
));
}
#endif
static
int
set_nodelay
(
int
fd
)
{
int
ret
,
opt
;
...
...
@@ -923,7 +907,7 @@ static int coroutine_fn add_aio_request(BDRVSheepdogState *s, AIOReq *aio_req,
s
->
co_send
=
qemu_coroutine_self
();
qemu_aio_set_fd_handler
(
s
->
fd
,
co_read_response
,
co_write_request
,
aio_flush_request
,
NULL
,
s
);
set_cork
(
s
->
fd
,
1
);
s
ocket_s
et_cork
(
s
->
fd
,
1
);
/* send a header */
ret
=
qemu_co_send
(
s
->
fd
,
&
hdr
,
sizeof
(
hdr
));
...
...
@@ -942,7 +926,7 @@ static int coroutine_fn add_aio_request(BDRVSheepdogState *s, AIOReq *aio_req,
}
}
set_cork
(
s
->
fd
,
0
);
s
ocket_s
et_cork
(
s
->
fd
,
0
);
qemu_aio_set_fd_handler
(
s
->
fd
,
co_read_response
,
NULL
,
aio_flush_request
,
NULL
,
s
);
qemu_co_mutex_unlock
(
&
s
->
lock
);
...
...
osdep.c
浏览文件 @
128aa589
...
...
@@ -48,6 +48,15 @@ extern int madvise(caddr_t, size_t, int);
#include "trace.h"
#include "qemu_socket.h"
int
socket_set_cork
(
int
fd
,
int
v
)
{
#if defined(SOL_TCP) && defined(TCP_CORK)
return
setsockopt
(
fd
,
SOL_TCP
,
TCP_CORK
,
&
v
,
sizeof
(
v
));
#else
return
0
;
#endif
}
int
qemu_madvise
(
void
*
addr
,
size_t
len
,
int
advice
)
{
if
(
advice
==
QEMU_MADV_INVALID
)
{
...
...
qemu_socket.h
浏览文件 @
128aa589
...
...
@@ -35,6 +35,7 @@ int inet_aton(const char *cp, struct in_addr *ia);
/* misc helpers */
int
qemu_socket
(
int
domain
,
int
type
,
int
protocol
);
int
qemu_accept
(
int
s
,
struct
sockaddr
*
addr
,
socklen_t
*
addrlen
);
int
socket_set_cork
(
int
fd
,
int
v
);
void
socket_set_block
(
int
fd
);
void
socket_set_nonblock
(
int
fd
);
int
send_all
(
int
fd
,
const
void
*
buf
,
int
len1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录