Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
72dc6d60
L
libvirt
项目概览
openeuler
/
libvirt
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libvirt
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
72dc6d60
编写于
5月 12, 2009
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove use of qemudSetNonBlock/SetCloseExec in favour of shared impl
上级
b8761bb2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
44 deletion
+22
-44
ChangeLog
ChangeLog
+6
-0
qemud/event.c
qemud/event.c
+6
-5
qemud/qemud.c
qemud/qemud.c
+10
-36
qemud/qemud.h
qemud/qemud.h
+0
-3
未找到文件。
ChangeLog
浏览文件 @
72dc6d60
Tue May 12 16:38:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
* qemud/qemud.c, qemud/qemud.h, qemud/event.c: Remove use
of qemudSetNonBock/SetCloseExec in favour of virSetNonBlock
and virSetCloseExec.
Tue May 12 16:38:22 BST 2009 Daniel P. Berrange <berrange@redhat.com>
Allow for quieter build with 'make -s'
...
...
qemud/event.c
浏览文件 @
72dc6d60
...
...
@@ -30,7 +30,8 @@
#include <errno.h>
#include <unistd.h>
#include "qemud.h"
#include "threads.h"
#include "logging.h"
#include "event.h"
#include "memory.h"
#include "util.h"
...
...
@@ -597,10 +598,10 @@ int virEventInit(void)
return
-
1
;
if
(
pipe
(
eventLoop
.
wakeupfd
)
<
0
||
qemud
SetNonBlock
(
eventLoop
.
wakeupfd
[
0
])
<
0
||
qemud
SetNonBlock
(
eventLoop
.
wakeupfd
[
1
])
<
0
||
qemud
SetCloseExec
(
eventLoop
.
wakeupfd
[
0
])
<
0
||
qemud
SetCloseExec
(
eventLoop
.
wakeupfd
[
1
])
<
0
)
vir
SetNonBlock
(
eventLoop
.
wakeupfd
[
0
])
<
0
||
vir
SetNonBlock
(
eventLoop
.
wakeupfd
[
1
])
<
0
||
vir
SetCloseExec
(
eventLoop
.
wakeupfd
[
0
])
<
0
||
vir
SetCloseExec
(
eventLoop
.
wakeupfd
[
1
])
<
0
)
return
-
1
;
if
(
virEventAddHandleImpl
(
eventLoop
.
wakeupfd
[
0
],
...
...
qemud/qemud.c
浏览文件 @
72dc6d60
...
...
@@ -371,32 +371,6 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED,
virMutexUnlock
(
&
server
->
lock
);
}
int
qemudSetCloseExec
(
int
fd
)
{
int
flags
;
if
((
flags
=
fcntl
(
fd
,
F_GETFD
))
<
0
)
goto
error
;
flags
|=
FD_CLOEXEC
;
if
((
fcntl
(
fd
,
F_SETFD
,
flags
))
<
0
)
goto
error
;
return
0
;
error:
VIR_ERROR0
(
_
(
"Failed to set close-on-exec file descriptor flag"
));
return
-
1
;
}
int
qemudSetNonBlock
(
int
fd
)
{
int
flags
;
if
((
flags
=
fcntl
(
fd
,
F_GETFL
))
<
0
)
goto
error
;
flags
|=
O_NONBLOCK
;
if
((
fcntl
(
fd
,
F_SETFL
,
flags
))
<
0
)
goto
error
;
return
0
;
error:
VIR_ERROR0
(
_
(
"Failed to set non-blocking file descriptor flag"
));
return
-
1
;
}
static
int
qemudGoDaemon
(
void
)
{
int
pid
=
fork
();
...
...
@@ -525,8 +499,8 @@ static int qemudListenUnix(struct qemud_server *server,
goto
cleanup
;
}
if
(
qemud
SetCloseExec
(
sock
->
fd
)
<
0
||
qemud
SetNonBlock
(
sock
->
fd
)
<
0
)
if
(
vir
SetCloseExec
(
sock
->
fd
)
<
0
||
vir
SetNonBlock
(
sock
->
fd
)
<
0
)
goto
cleanup
;
memset
(
&
addr
,
0
,
sizeof
(
addr
));
...
...
@@ -687,8 +661,8 @@ remoteListenTCP (struct qemud_server *server,
else
sock
->
port
=
-
1
;
if
(
qemud
SetCloseExec
(
sock
->
fd
)
<
0
||
qemud
SetNonBlock
(
sock
->
fd
)
<
0
)
if
(
vir
SetCloseExec
(
sock
->
fd
)
<
0
||
vir
SetNonBlock
(
sock
->
fd
)
<
0
)
goto
cleanup
;
if
(
listen
(
sock
->
fd
,
30
)
<
0
)
{
...
...
@@ -1273,8 +1247,8 @@ static int qemudDispatchServer(struct qemud_server *server, struct qemud_socket
setsockopt
(
fd
,
IPPROTO_TCP
,
TCP_NODELAY
,
(
void
*
)
&
no_slow_start
,
sizeof
no_slow_start
);
if
(
qemud
SetCloseExec
(
fd
)
<
0
||
qemud
SetNonBlock
(
fd
)
<
0
)
{
if
(
vir
SetCloseExec
(
fd
)
<
0
||
vir
SetNonBlock
(
fd
)
<
0
)
{
close
(
fd
);
return
-
1
;
}
...
...
@@ -2872,10 +2846,10 @@ int main(int argc, char **argv) {
goto
error1
;
if
(
pipe
(
sigpipe
)
<
0
||
qemud
SetNonBlock
(
sigpipe
[
0
])
<
0
||
qemud
SetNonBlock
(
sigpipe
[
1
])
<
0
||
qemud
SetCloseExec
(
sigpipe
[
0
])
<
0
||
qemud
SetCloseExec
(
sigpipe
[
1
])
<
0
)
{
vir
SetNonBlock
(
sigpipe
[
0
])
<
0
||
vir
SetNonBlock
(
sigpipe
[
1
])
<
0
||
vir
SetCloseExec
(
sigpipe
[
0
])
<
0
||
vir
SetCloseExec
(
sigpipe
[
1
])
<
0
)
{
char
ebuf
[
1024
];
VIR_ERROR
(
_
(
"Failed to create pipe: %s"
),
virStrerror
(
errno
,
ebuf
,
sizeof
ebuf
));
...
...
qemud/qemud.h
浏览文件 @
72dc6d60
...
...
@@ -198,9 +198,6 @@ void qemudLog(int priority, const char *fmt, ...)
ATTRIBUTE_FORMAT
(
printf
,
2
,
3
);
int
qemudSetCloseExec
(
int
fd
);
int
qemudSetNonBlock
(
int
fd
);
int
remoteDispatchClientRequest
(
struct
qemud_server
*
server
,
struct
qemud_client
*
client
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录