Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
498cc578
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,发现更多精彩内容 >>
提交
498cc578
编写于
6月 26, 2007
作者:
D
Daniel P. Berrange
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Updated to use virError object & APIs for error reporting
上级
2dd21783
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
220 addition
and
182 deletion
+220
-182
ChangeLog
ChangeLog
+8
-1
qemud/Makefile.am
qemud/Makefile.am
+4
-1
qemud/conf.c
qemud/conf.c
+99
-93
qemud/dispatch.c
qemud/dispatch.c
+10
-6
qemud/driver.c
qemud/driver.c
+93
-75
qemud/driver.h
qemud/driver.h
+4
-2
qemud/internal.h
qemud/internal.h
+0
-2
qemud/qemud.c
qemud/qemud.c
+2
-2
未找到文件。
ChangeLog
浏览文件 @
498cc578
Tue Jun 26 16:41:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
Tue Jun 26 16:50:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* qemud/Makefile.am, qemud/conf.c, qemud/dispatch.c, qemud/driver.c,
qemud/driver.h, qemud/internal.h, qemud/qemud.c: Switch over to
use regular libvirt virError objects & APIs for QEMU error
reporting purposes
Tue Jun 26 16:43:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* qemud/driver.c, qemud/driver.h, qemud/qemud.c: Move code
* qemud/driver.c, qemud/driver.h, qemud/qemud.c: Move code
handling global startup, shutdown & reload into driver.c
handling global startup, shutdown & reload into driver.c
...
...
qemud/Makefile.am
浏览文件 @
498cc578
...
@@ -17,6 +17,7 @@ libvirt_qemud_SOURCES = \
...
@@ -17,6 +17,7 @@ libvirt_qemud_SOURCES = \
protocol.h protocol.c
\
protocol.h protocol.c
\
remote_protocol.h remote_protocol.c
\
remote_protocol.h remote_protocol.c
\
remote.c
\
remote.c
\
../src/virterror.c
\
event.c event.h
event.c event.h
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
#-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_POSIX_C_SOURCE=199506L
libvirt_qemud_CFLAGS
=
\
libvirt_qemud_CFLAGS
=
\
...
@@ -24,7 +25,9 @@ libvirt_qemud_CFLAGS = \
...
@@ -24,7 +25,9 @@ libvirt_qemud_CFLAGS = \
$(WARN_CFLAGS)
-DLOCAL_STATE_DIR
=
"
\"
$(localstatedir)
\"
"
\
$(WARN_CFLAGS)
-DLOCAL_STATE_DIR
=
"
\"
$(localstatedir)
\"
"
\
-DSYSCONF_DIR
=
"
\"
$(sysconfdir)
\"
"
\
-DSYSCONF_DIR
=
"
\"
$(sysconfdir)
\"
"
\
-DQEMUD_PID_FILE
=
"
\"
$(QEMUD_PID_FILE)
\"
"
\
-DQEMUD_PID_FILE
=
"
\"
$(QEMUD_PID_FILE)
\"
"
\
-DREMOTE_PID_FILE
=
"
\"
$(REMOTE_PID_FILE)
\"
"
-DREMOTE_PID_FILE
=
"
\"
$(REMOTE_PID_FILE)
\"
"
\
-DGETTEXT_PACKAGE
=
\"
$(PACKAGE)
\"
libvirt_qemud_LDFLAGS
=
$(WARN_CFLAGS)
$(LIBXML_LIBS)
$(SYSFS_LIBS)
libvirt_qemud_LDFLAGS
=
$(WARN_CFLAGS)
$(LIBXML_LIBS)
$(SYSFS_LIBS)
libvirt_qemud_DEPENDENCIES
=
../src/libvirt.la
libvirt_qemud_DEPENDENCIES
=
../src/libvirt.la
libvirt_qemud_LDADD
=
../src/libvirt.la
libvirt_qemud_LDADD
=
../src/libvirt.la
...
...
qemud/conf.c
浏览文件 @
498cc578
此差异已折叠。
点击以展开。
qemud/dispatch.c
浏览文件 @
498cc578
...
@@ -39,9 +39,14 @@
...
@@ -39,9 +39,14 @@
static
int
qemudDispatchFailure
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
static
int
qemudDispatchFailure
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
struct
qemud_client
*
client
ATTRIBUTE_UNUSED
,
struct
qemud_packet_server_data
*
out
)
{
struct
qemud_packet_server_data
*
out
)
{
virErrorPtr
err
=
virGetLastError
();
out
->
type
=
QEMUD_SERVER_PKT_FAILURE
;
out
->
type
=
QEMUD_SERVER_PKT_FAILURE
;
out
->
qemud_packet_server_data_u
.
failureReply
.
code
=
server
->
errorCode
;
strcpy
(
out
->
qemud_packet_server_data_u
.
failureReply
.
message
,
server
->
errorMessage
);
out
->
qemud_packet_server_data_u
.
failureReply
.
code
=
err
->
code
;
strncpy
(
out
->
qemud_packet_server_data_u
.
failureReply
.
message
,
err
->
message
,
QEMUD_MAX_ERROR_LEN
-
1
);
out
->
qemud_packet_server_data_u
.
failureReply
.
message
[
QEMUD_MAX_ERROR_LEN
-
1
]
=
'\0'
;
return
0
;
return
0
;
}
}
...
@@ -90,7 +95,7 @@ qemudDispatchGetCapabilities (struct qemud_server *server,
...
@@ -90,7 +95,7 @@ qemudDispatchGetCapabilities (struct qemud_server *server,
char
*
xml
=
qemudGetCapabilities
(
server
);
char
*
xml
=
qemudGetCapabilities
(
server
);
if
(
strlen
(
xml
)
>
QEMUD_MAX_XML_LEN
)
{
if
(
strlen
(
xml
)
>
QEMUD_MAX_XML_LEN
)
{
qemudReportError
(
server
,
VIR_ERR_XML_ERROR
,
NULL
);
qemudReportError
(
NULL
,
NULL
,
NULL
,
VIR_ERR_XML_ERROR
,
NULL
);
qemudDispatchFailure
(
server
,
client
,
out
);
qemudDispatchFailure
(
server
,
client
,
out
);
free
(
xml
);
free
(
xml
);
return
0
;
return
0
;
...
@@ -784,8 +789,7 @@ int qemudDispatch(struct qemud_server *server, struct qemud_client *client,
...
@@ -784,8 +789,7 @@ int qemudDispatch(struct qemud_server *server, struct qemud_client *client,
qemudDebug
(
"> Dispatching request type %d, readonly ? %d"
,
qemudDebug
(
"> Dispatching request type %d, readonly ? %d"
,
in
->
type
,
client
->
readonly
);
in
->
type
,
client
->
readonly
);
server
->
errorCode
=
0
;
virResetLastError
();
server
->
errorMessage
[
0
]
=
'\0'
;
memset
(
out
,
0
,
sizeof
(
*
out
));
memset
(
out
,
0
,
sizeof
(
*
out
));
...
@@ -801,7 +805,7 @@ int qemudDispatch(struct qemud_server *server, struct qemud_client *client,
...
@@ -801,7 +805,7 @@ int qemudDispatch(struct qemud_server *server, struct qemud_client *client,
if
(
!
funcs
[
type
])
{
if
(
!
funcs
[
type
])
{
qemudDebug
(
"Illegal operation requested"
);
qemudDebug
(
"Illegal operation requested"
);
qemudReportError
(
server
,
VIR_ERR_OPERATION_DENIED
,
NULL
);
qemudReportError
(
NULL
,
NULL
,
NULL
,
VIR_ERR_OPERATION_DENIED
,
NULL
);
qemudDispatchFailure
(
server
,
client
,
out
);
qemudDispatchFailure
(
server
,
client
,
out
);
}
else
{
}
else
{
if
((
funcs
[
type
])(
server
,
client
,
in
,
out
)
<
0
)
{
if
((
funcs
[
type
])(
server
,
client
,
in
,
out
)
<
0
)
{
...
...
qemud/driver.c
浏览文件 @
498cc578
此差异已折叠。
点击以展开。
qemud/driver.h
浏览文件 @
498cc578
...
@@ -43,9 +43,11 @@ int qemudStartup(struct qemud_server *server);
...
@@ -43,9 +43,11 @@ int qemudStartup(struct qemud_server *server);
void
qemudReload
(
struct
qemud_server
*
server
);
void
qemudReload
(
struct
qemud_server
*
server
);
void
qemudShutdown
(
struct
qemud_server
*
server
);
void
qemudShutdown
(
struct
qemud_server
*
server
);
void
qemudReportError
(
struct
qemud_server
*
server
,
void
qemudReportError
(
virConnectPtr
conn
,
virDomainPtr
dom
,
virNetworkPtr
net
,
int
code
,
const
char
*
fmt
,
...)
int
code
,
const
char
*
fmt
,
...)
ATTRIBUTE_FORMAT
(
printf
,
3
,
4
);
ATTRIBUTE_FORMAT
(
printf
,
5
,
6
);
int
qemudGetNodeInfo
(
unsigned
int
*
memory
,
int
qemudGetNodeInfo
(
unsigned
int
*
memory
,
char
*
cpuModel
,
int
cpuModelLength
,
char
*
cpuModel
,
int
cpuModelLength
,
...
...
qemud/internal.h
浏览文件 @
498cc578
...
@@ -352,8 +352,6 @@ struct qemud_server {
...
@@ -352,8 +352,6 @@ struct qemud_server {
char
*
networkConfigDir
;
char
*
networkConfigDir
;
char
*
networkAutostartDir
;
char
*
networkAutostartDir
;
char
logDir
[
PATH_MAX
];
char
logDir
[
PATH_MAX
];
char
errorMessage
[
QEMUD_MAX_ERROR_LEN
];
int
errorCode
;
unsigned
int
shutdown
:
1
;
unsigned
int
shutdown
:
1
;
};
};
...
...
qemud/qemud.c
浏览文件 @
498cc578
...
@@ -1484,7 +1484,7 @@ static void qemudDispatchServerEvent(int fd, int events, void *opaque) {
...
@@ -1484,7 +1484,7 @@ static void qemudDispatchServerEvent(int fd, int events, void *opaque) {
}
}
static
int
qemudOneLoop
(
struct
qemud_server
*
server
ATTRIBUTE_UNUSED
)
{
static
int
qemudOneLoop
(
void
)
{
sig_atomic_t
errors
;
sig_atomic_t
errors
;
if
(
virEventRunOnce
()
<
0
)
if
(
virEventRunOnce
()
<
0
)
...
@@ -1506,7 +1506,7 @@ static int qemudOneLoop(struct qemud_server *server ATTRIBUTE_UNUSED) {
...
@@ -1506,7 +1506,7 @@ static int qemudOneLoop(struct qemud_server *server ATTRIBUTE_UNUSED) {
static
int
qemudRunLoop
(
struct
qemud_server
*
server
)
{
static
int
qemudRunLoop
(
struct
qemud_server
*
server
)
{
int
ret
;
int
ret
;
while
((
ret
=
qemudOneLoop
(
server
))
==
0
&&
!
server
->
shutdown
)
while
((
ret
=
qemudOneLoop
())
==
0
&&
!
server
->
shutdown
)
;
;
return
ret
==
-
1
?
-
1
:
0
;
return
ret
==
-
1
?
-
1
:
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录