Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
413c5dbf
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,发现更多精彩内容 >>
提交
413c5dbf
编写于
8月 12, 2008
作者:
A
Atsushi SAKAI
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add _fd to stdin, stderr stdout in struct virDomainObj for compilation on MinGW
上级
43c7f972
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
24 addition
and
19 deletion
+24
-19
ChangeLog
ChangeLog
+5
-0
src/domain_conf.h
src/domain_conf.h
+3
-3
src/qemu_driver.c
src/qemu_driver.c
+16
-16
未找到文件。
ChangeLog
浏览文件 @
413c5dbf
Tue Aug 12 17:30:50 JST 2008 Atsushi SAKAI <sakaia@jp.fujitsu.com>
* src/domain_conf.h src/qemu_driver.c: name changing of
stdin, stdout, stderr to add _fd for compilation on MinGW
Tue Aug 12 17:20:36 JST 2008 Atsushi SAKAI <sakaia@jp.fujitsu.com>
Tue Aug 12 17:20:36 JST 2008 Atsushi SAKAI <sakaia@jp.fujitsu.com>
* src/domain.conf.c src/network_conf.c src/util.c src/virsh.c
* src/domain.conf.c src/network_conf.c src/util.c src/virsh.c
...
...
src/domain_conf.h
浏览文件 @
413c5dbf
...
@@ -444,9 +444,9 @@ struct _virDomainDef {
...
@@ -444,9 +444,9 @@ struct _virDomainDef {
typedef
struct
_virDomainObj
virDomainObj
;
typedef
struct
_virDomainObj
virDomainObj
;
typedef
virDomainObj
*
virDomainObjPtr
;
typedef
virDomainObj
*
virDomainObjPtr
;
struct
_virDomainObj
{
struct
_virDomainObj
{
int
stdin
;
int
stdin
_fd
;
int
stdout
;
int
stdout
_fd
;
int
stderr
;
int
stderr
_fd
;
int
monitor
;
int
monitor
;
int
logfile
;
int
logfile
;
int
pid
;
int
pid
;
...
...
src/qemu_driver.c
浏览文件 @
413c5dbf
...
@@ -636,7 +636,7 @@ static int qemudWaitForMonitor(virConnectPtr conn,
...
@@ -636,7 +636,7 @@ static int qemudWaitForMonitor(virConnectPtr conn,
virDomainObjPtr
vm
)
{
virDomainObjPtr
vm
)
{
char
buf
[
1024
];
/* Plenty of space to get startup greeting */
char
buf
[
1024
];
/* Plenty of space to get startup greeting */
int
ret
=
qemudReadMonitorOutput
(
conn
,
int
ret
=
qemudReadMonitorOutput
(
conn
,
driver
,
vm
,
vm
->
stderr
,
driver
,
vm
,
vm
->
stderr
_fd
,
buf
,
sizeof
(
buf
),
buf
,
sizeof
(
buf
),
qemudFindCharDevicePTYs
,
qemudFindCharDevicePTYs
,
"console"
);
"console"
);
...
@@ -950,7 +950,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
...
@@ -950,7 +950,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
errno
,
strerror
(
errno
));
errno
,
strerror
(
errno
));
ret
=
virExecNonBlock
(
conn
,
argv
,
&
vm
->
pid
,
ret
=
virExecNonBlock
(
conn
,
argv
,
&
vm
->
pid
,
vm
->
stdin
,
&
vm
->
stdout
,
&
vm
->
stderr
);
vm
->
stdin
_fd
,
&
vm
->
stdout_fd
,
&
vm
->
stderr_fd
);
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
vm
->
def
->
id
=
driver
->
nextvmid
++
;
vm
->
def
->
id
=
driver
->
nextvmid
++
;
vm
->
state
=
migrateFrom
?
VIR_DOMAIN_PAUSED
:
VIR_DOMAIN_RUNNING
;
vm
->
state
=
migrateFrom
?
VIR_DOMAIN_PAUSED
:
VIR_DOMAIN_RUNNING
;
...
@@ -968,11 +968,11 @@ static int qemudStartVMDaemon(virConnectPtr conn,
...
@@ -968,11 +968,11 @@ static int qemudStartVMDaemon(virConnectPtr conn,
}
}
if
(
ret
==
0
)
{
if
(
ret
==
0
)
{
if
((
virEventAddHandle
(
vm
->
stdout
,
if
((
virEventAddHandle
(
vm
->
stdout
_fd
,
POLLIN
|
POLLERR
|
POLLHUP
,
POLLIN
|
POLLERR
|
POLLHUP
,
qemudDispatchVMEvent
,
qemudDispatchVMEvent
,
driver
)
<
0
)
||
driver
)
<
0
)
||
(
virEventAddHandle
(
vm
->
stderr
,
(
virEventAddHandle
(
vm
->
stderr
_fd
,
POLLIN
|
POLLERR
|
POLLHUP
,
POLLIN
|
POLLERR
|
POLLHUP
,
qemudDispatchVMEvent
,
qemudDispatchVMEvent
,
driver
)
<
0
)
||
driver
)
<
0
)
||
...
@@ -1025,22 +1025,22 @@ static void qemudShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
...
@@ -1025,22 +1025,22 @@ static void qemudShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
kill
(
vm
->
pid
,
SIGTERM
);
kill
(
vm
->
pid
,
SIGTERM
);
qemudVMData
(
driver
,
vm
,
vm
->
stdout
);
qemudVMData
(
driver
,
vm
,
vm
->
stdout
_fd
);
qemudVMData
(
driver
,
vm
,
vm
->
stderr
);
qemudVMData
(
driver
,
vm
,
vm
->
stderr
_fd
);
virEventRemoveHandle
(
vm
->
stdout
);
virEventRemoveHandle
(
vm
->
stdout
_fd
);
virEventRemoveHandle
(
vm
->
stderr
);
virEventRemoveHandle
(
vm
->
stderr
_fd
);
if
(
close
(
vm
->
logfile
)
<
0
)
if
(
close
(
vm
->
logfile
)
<
0
)
qemudLog
(
QEMUD_WARN
,
_
(
"Unable to close logfile %d: %s
\n
"
),
qemudLog
(
QEMUD_WARN
,
_
(
"Unable to close logfile %d: %s
\n
"
),
errno
,
strerror
(
errno
));
errno
,
strerror
(
errno
));
close
(
vm
->
stdout
);
close
(
vm
->
stdout
_fd
);
close
(
vm
->
stderr
);
close
(
vm
->
stderr
_fd
);
if
(
vm
->
monitor
!=
-
1
)
if
(
vm
->
monitor
!=
-
1
)
close
(
vm
->
monitor
);
close
(
vm
->
monitor
);
vm
->
logfile
=
-
1
;
vm
->
logfile
=
-
1
;
vm
->
stdout
=
-
1
;
vm
->
stdout
_fd
=
-
1
;
vm
->
stderr
=
-
1
;
vm
->
stderr
_fd
=
-
1
;
vm
->
monitor
=
-
1
;
vm
->
monitor
=
-
1
;
if
(
waitpid
(
vm
->
pid
,
NULL
,
WNOHANG
)
!=
vm
->
pid
)
{
if
(
waitpid
(
vm
->
pid
,
NULL
,
WNOHANG
)
!=
vm
->
pid
)
{
...
@@ -1613,8 +1613,8 @@ static void qemudDispatchVMEvent(int fd, int events, void *opaque) {
...
@@ -1613,8 +1613,8 @@ static void qemudDispatchVMEvent(int fd, int events, void *opaque) {
while
(
vm
)
{
while
(
vm
)
{
if
(
virDomainIsActive
(
vm
)
&&
if
(
virDomainIsActive
(
vm
)
&&
(
vm
->
stdout
==
fd
||
(
vm
->
stdout
_fd
==
fd
||
vm
->
stderr
==
fd
))
vm
->
stderr
_fd
==
fd
))
break
;
break
;
vm
=
vm
->
next
;
vm
=
vm
->
next
;
...
@@ -2754,10 +2754,10 @@ static int qemudDomainRestore(virConnectPtr conn,
...
@@ -2754,10 +2754,10 @@ static int qemudDomainRestore(virConnectPtr conn,
}
}
/* Set the migration source and start it up. */
/* Set the migration source and start it up. */
vm
->
stdin
=
fd
;
vm
->
stdin
_fd
=
fd
;
ret
=
qemudStartVMDaemon
(
conn
,
driver
,
vm
,
"stdio"
);
ret
=
qemudStartVMDaemon
(
conn
,
driver
,
vm
,
"stdio"
);
close
(
fd
);
close
(
fd
);
vm
->
stdin
=
-
1
;
vm
->
stdin
_fd
=
-
1
;
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
qemudReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_OPERATION_FAILED
,
qemudReportError
(
conn
,
NULL
,
NULL
,
VIR_ERR_OPERATION_FAILED
,
"%s"
,
_
(
"failed to start VM"
));
"%s"
,
_
(
"failed to start VM"
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录