Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
libvirt
提交
b29e08db
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看板
提交
b29e08db
编写于
5月 19, 2016
作者:
J
Jovanka Gulicoska
提交者:
Cole Robinson
5月 19, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More usage of virGetLastErrorMessage
Convert to virGetLastErrorMessage() in the rest of the code
上级
c66150ec
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
41 addition
and
93 deletion
+41
-93
daemon/libvirtd.c
daemon/libvirtd.c
+2
-6
examples/object-events/event-test.c
examples/object-events/event-test.c
+3
-6
src/bhyve/bhyve_driver.c
src/bhyve/bhyve_driver.c
+1
-2
src/conf/virsecretobj.c
src/conf/virsecretobj.c
+1
-4
src/libvirt.c
src/libvirt.c
+1
-2
src/libxl/libxl_domain.c
src/libxl/libxl_domain.c
+1
-2
src/libxl/libxl_driver.c
src/libxl/libxl_driver.c
+1
-3
src/locking/lock_daemon.c
src/locking/lock_daemon.c
+2
-6
src/logging/log_daemon.c
src/logging/log_daemon.c
+2
-6
src/lxc/lxc_container.c
src/lxc/lxc_container.c
+3
-6
src/lxc/lxc_controller.c
src/lxc/lxc_controller.c
+3
-6
src/lxc/lxc_domain.c
src/lxc/lxc_domain.c
+2
-2
src/lxc/lxc_process.c
src/lxc/lxc_process.c
+2
-4
src/rpc/virnettlscontext.c
src/rpc/virnettlscontext.c
+1
-2
src/storage/storage_driver.c
src/storage/storage_driver.c
+4
-12
src/uml/uml_driver.c
src/uml/uml_driver.c
+1
-2
src/util/iohelper.c
src/util/iohelper.c
+2
-8
src/util/virhook.c
src/util/virhook.c
+1
-2
src/util/virhostdev.c
src/util/virhostdev.c
+8
-12
未找到文件。
daemon/libvirtd.c
浏览文件 @
b29e08db
...
@@ -1315,12 +1315,8 @@ int main(int argc, char **argv) {
...
@@ -1315,12 +1315,8 @@ int main(int argc, char **argv) {
/* Read the config file if it exists*/
/* Read the config file if it exists*/
if
(
remote_config_file
&&
if
(
remote_config_file
&&
daemonConfigLoadFile
(
config
,
remote_config_file
,
implicit_conf
)
<
0
)
{
daemonConfigLoadFile
(
config
,
remote_config_file
,
implicit_conf
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Can't load config file: %s: %s"
),
if
(
err
&&
err
->
message
)
virGetLastErrorMessage
(),
remote_config_file
);
VIR_ERROR
(
_
(
"Can't load config file: %s: %s"
),
err
->
message
,
remote_config_file
);
else
VIR_ERROR
(
_
(
"Can't load config file: %s"
),
remote_config_file
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
...
examples/object-events/event-test.c
浏览文件 @
b29e08db
...
@@ -917,9 +917,8 @@ main(int argc, char **argv)
...
@@ -917,9 +917,8 @@ main(int argc, char **argv)
}
}
if
(
virEventRegisterDefaultImpl
()
<
0
)
{
if
(
virEventRegisterDefaultImpl
()
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
fprintf
(
stderr
,
"Failed to register event implementation: %s
\n
"
,
fprintf
(
stderr
,
"Failed to register event implementation: %s
\n
"
,
err
&&
err
->
message
?
err
->
message
:
"Unknown error"
);
virGetLastErrorMessage
()
);
goto
cleanup
;
goto
cleanup
;
}
}
...
@@ -972,17 +971,15 @@ main(int argc, char **argv)
...
@@ -972,17 +971,15 @@ main(int argc, char **argv)
goto
cleanup
;
goto
cleanup
;
if
(
virConnectSetKeepAlive
(
dconn
,
5
,
3
)
<
0
)
{
if
(
virConnectSetKeepAlive
(
dconn
,
5
,
3
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
fprintf
(
stderr
,
"Failed to start keepalive protocol: %s
\n
"
,
fprintf
(
stderr
,
"Failed to start keepalive protocol: %s
\n
"
,
err
&&
err
->
message
?
err
->
message
:
"Unknown error"
);
virGetLastErrorMessage
()
);
run
=
0
;
run
=
0
;
}
}
while
(
run
)
{
while
(
run
)
{
if
(
virEventRunDefaultImpl
()
<
0
)
{
if
(
virEventRunDefaultImpl
()
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
fprintf
(
stderr
,
"Failed to run event loop: %s
\n
"
,
fprintf
(
stderr
,
"Failed to run event loop: %s
\n
"
,
err
&&
err
->
message
?
err
->
message
:
"Unknown error"
);
virGetLastErrorMessage
()
);
}
}
}
}
...
...
src/bhyve/bhyve_driver.c
浏览文件 @
b29e08db
...
@@ -88,9 +88,8 @@ bhyveAutostartDomain(virDomainObjPtr vm, void *opaque)
...
@@ -88,9 +88,8 @@ bhyveAutostartDomain(virDomainObjPtr vm, void *opaque)
ret
=
virBhyveProcessStart
(
data
->
conn
,
data
->
driver
,
vm
,
ret
=
virBhyveProcessStart
(
data
->
conn
,
data
->
driver
,
vm
,
VIR_DOMAIN_RUNNING_BOOTED
,
0
);
VIR_DOMAIN_RUNNING_BOOTED
,
0
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to autostart VM '%s': %s"
),
VIR_ERROR
(
_
(
"Failed to autostart VM '%s': %s"
),
vm
->
def
->
name
,
err
?
err
->
message
:
_
(
"unknown error"
));
vm
->
def
->
name
,
virGetLastErrorMessage
(
));
}
}
}
}
virObjectUnlock
(
vm
);
virObjectUnlock
(
vm
);
...
...
src/conf/virsecretobj.c
浏览文件 @
b29e08db
...
@@ -990,11 +990,8 @@ virSecretLoadAllConfigs(virSecretObjListPtr secrets,
...
@@ -990,11 +990,8 @@ virSecretLoadAllConfigs(virSecretObjListPtr secrets,
continue
;
continue
;
if
(
!
(
secret
=
virSecretLoad
(
secrets
,
de
->
d_name
,
path
,
configDir
)))
{
if
(
!
(
secret
=
virSecretLoad
(
secrets
,
de
->
d_name
,
path
,
configDir
)))
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Error reading secret: %s"
),
VIR_ERROR
(
_
(
"Error reading secret: %s"
),
err
!=
NULL
?
err
->
message
:
_
(
"unknown error"
));
virGetLastErrorMessage
());
virResetError
(
err
);
VIR_FREE
(
path
);
VIR_FREE
(
path
);
continue
;
continue
;
}
}
...
...
src/libvirt.c
浏览文件 @
b29e08db
...
@@ -770,10 +770,9 @@ virStateInitialize(bool privileged,
...
@@ -770,10 +770,9 @@ virStateInitialize(bool privileged,
if
(
virStateDriverTab
[
i
]
->
stateInitialize
(
privileged
,
if
(
virStateDriverTab
[
i
]
->
stateInitialize
(
privileged
,
callback
,
callback
,
opaque
)
<
0
)
{
opaque
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Initialization of %s state driver failed: %s"
),
VIR_ERROR
(
_
(
"Initialization of %s state driver failed: %s"
),
virStateDriverTab
[
i
]
->
name
,
virStateDriverTab
[
i
]
->
name
,
err
&&
err
->
message
?
err
->
message
:
_
(
"Unknown problem"
));
virGetLastErrorMessage
(
));
return
-
1
;
return
-
1
;
}
}
}
}
...
...
src/libxl/libxl_domain.c
浏览文件 @
b29e08db
...
@@ -515,9 +515,8 @@ libxlDomainShutdownThread(void *opaque)
...
@@ -515,9 +515,8 @@ libxlDomainShutdownThread(void *opaque)
libxlDomainDestroyInternal
(
driver
,
vm
);
libxlDomainDestroyInternal
(
driver
,
vm
);
libxlDomainCleanup
(
driver
,
vm
);
libxlDomainCleanup
(
driver
,
vm
);
if
(
libxlDomainStartNew
(
driver
,
vm
,
false
)
<
0
)
{
if
(
libxlDomainStartNew
(
driver
,
vm
,
false
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to restart VM '%s': %s"
),
VIR_ERROR
(
_
(
"Failed to restart VM '%s': %s"
),
vm
->
def
->
name
,
err
?
err
->
message
:
_
(
"unknown error"
));
vm
->
def
->
name
,
virGetLastErrorMessage
(
));
}
}
endjob:
endjob:
...
...
src/libxl/libxl_driver.c
浏览文件 @
b29e08db
...
@@ -307,7 +307,6 @@ libxlAutostartDomain(virDomainObjPtr vm,
...
@@ -307,7 +307,6 @@ libxlAutostartDomain(virDomainObjPtr vm,
void
*
opaque
)
void
*
opaque
)
{
{
libxlDriverPrivatePtr
driver
=
opaque
;
libxlDriverPrivatePtr
driver
=
opaque
;
virErrorPtr
err
;
int
ret
=
-
1
;
int
ret
=
-
1
;
virObjectLock
(
vm
);
virObjectLock
(
vm
);
...
@@ -320,10 +319,9 @@ libxlAutostartDomain(virDomainObjPtr vm,
...
@@ -320,10 +319,9 @@ libxlAutostartDomain(virDomainObjPtr vm,
if
(
vm
->
autostart
&&
!
virDomainObjIsActive
(
vm
)
&&
if
(
vm
->
autostart
&&
!
virDomainObjIsActive
(
vm
)
&&
libxlDomainStartNew
(
driver
,
vm
,
false
)
<
0
)
{
libxlDomainStartNew
(
driver
,
vm
,
false
)
<
0
)
{
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to autostart VM '%s': %s"
),
VIR_ERROR
(
_
(
"Failed to autostart VM '%s': %s"
),
vm
->
def
->
name
,
vm
->
def
->
name
,
err
?
err
->
message
:
_
(
"unknown error"
));
virGetLastErrorMessage
(
));
goto
endjob
;
goto
endjob
;
}
}
...
...
src/locking/lock_daemon.c
浏览文件 @
b29e08db
...
@@ -1264,12 +1264,8 @@ int main(int argc, char **argv) {
...
@@ -1264,12 +1264,8 @@ int main(int argc, char **argv) {
/* Read the config file if it exists*/
/* Read the config file if it exists*/
if
(
remote_config_file
&&
if
(
remote_config_file
&&
virLockDaemonConfigLoadFile
(
config
,
remote_config_file
,
implicit_conf
)
<
0
)
{
virLockDaemonConfigLoadFile
(
config
,
remote_config_file
,
implicit_conf
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Can't load config file: %s: %s"
),
if
(
err
&&
err
->
message
)
virGetLastErrorMessage
(),
remote_config_file
);
VIR_ERROR
(
_
(
"Can't load config file: %s: %s"
),
err
->
message
,
remote_config_file
);
else
VIR_ERROR
(
_
(
"Can't load config file: %s"
),
remote_config_file
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
...
src/logging/log_daemon.c
浏览文件 @
b29e08db
...
@@ -1021,12 +1021,8 @@ int main(int argc, char **argv) {
...
@@ -1021,12 +1021,8 @@ int main(int argc, char **argv) {
/* Read the config file if it exists*/
/* Read the config file if it exists*/
if
(
remote_config_file
&&
if
(
remote_config_file
&&
virLogDaemonConfigLoadFile
(
config
,
remote_config_file
,
implicit_conf
)
<
0
)
{
virLogDaemonConfigLoadFile
(
config
,
remote_config_file
,
implicit_conf
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Can't load config file: %s: %s"
),
if
(
err
&&
err
->
message
)
virGetLastErrorMessage
(),
remote_config_file
);
VIR_ERROR
(
_
(
"Can't load config file: %s: %s"
),
err
->
message
,
remote_config_file
);
else
VIR_ERROR
(
_
(
"Can't load config file: %s"
),
remote_config_file
);
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
...
src/lxc/lxc_container.c
浏览文件 @
b29e08db
...
@@ -2290,12 +2290,9 @@ static int lxcContainerChild(void *data)
...
@@ -2290,12 +2290,9 @@ static int lxcContainerChild(void *data)
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
VIR_DEBUG
(
"Tearing down container"
);
VIR_DEBUG
(
"Tearing down container"
);
virErrorPtr
err
=
virGetLastError
();
fprintf
(
stderr
,
if
(
err
&&
err
->
message
)
_
(
"Failure in libvirt_lxc startup: %s
\n
"
),
fprintf
(
stderr
,
"%s
\n
"
,
err
->
message
);
virGetLastErrorMessage
());
else
fprintf
(
stderr
,
"%s
\n
"
,
_
(
"Unknown failure in libvirt_lxc startup"
));
}
}
virCommandFree
(
cmd
);
virCommandFree
(
cmd
);
...
...
src/lxc/lxc_controller.c
浏览文件 @
b29e08db
...
@@ -2736,12 +2736,9 @@ int main(int argc, char *argv[])
...
@@ -2736,12 +2736,9 @@ int main(int argc, char *argv[])
cleanup:
cleanup:
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
fprintf
(
stderr
,
if
(
err
&&
err
->
message
)
_
(
"Failure in libvirt_lxc startup: %s
\n
"
),
fprintf
(
stderr
,
"%s
\n
"
,
err
->
message
);
virGetLastErrorMessage
());
else
fprintf
(
stderr
,
"%s
\n
"
,
_
(
"Unknown failure in libvirt_lxc startup"
));
}
}
virPidFileDelete
(
LXC_STATE_DIR
,
name
);
virPidFileDelete
(
LXC_STATE_DIR
,
name
);
...
...
src/lxc/lxc_domain.c
浏览文件 @
b29e08db
...
@@ -353,8 +353,8 @@ virLXCDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
...
@@ -353,8 +353,8 @@ virLXCDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
unsigned
long
long
thepid
;
unsigned
long
long
thepid
;
if
(
virXPathULongLong
(
"string(./init[1]/@pid)"
,
ctxt
,
&
thepid
)
<
0
)
{
if
(
virXPathULongLong
(
"string(./init[1]/@pid)"
,
ctxt
,
&
thepid
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_WARN
(
"Failed to load init pid from state %s"
,
VIR_WARN
(
"Failed to load init pid from state %s"
,
err
?
err
->
message
:
"null"
);
virGetLastErrorMessage
()
);
priv
->
initpid
=
0
;
priv
->
initpid
=
0
;
}
else
{
}
else
{
priv
->
initpid
=
thepid
;
priv
->
initpid
=
thepid
;
...
...
src/lxc/lxc_process.c
浏览文件 @
b29e08db
...
@@ -756,10 +756,9 @@ static void virLXCProcessMonitorInitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED
...
@@ -756,10 +756,9 @@ static void virLXCProcessMonitorInitNotify(virLXCMonitorPtr mon ATTRIBUTE_UNUSED
priv
->
initpid
=
initpid
;
priv
->
initpid
=
initpid
;
if
(
virLXCProcessGetNsInode
(
initpid
,
"pid"
,
&
inode
)
<
0
)
{
if
(
virLXCProcessGetNsInode
(
initpid
,
"pid"
,
&
inode
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_WARN
(
"Cannot obtain pid NS inode for %llu: %s"
,
VIR_WARN
(
"Cannot obtain pid NS inode for %llu: %s"
,
(
unsigned
long
long
)
initpid
,
(
unsigned
long
long
)
initpid
,
err
&&
err
->
message
?
err
->
message
:
"<unknown>"
);
virGetLastErrorMessage
()
);
virResetLastError
();
virResetLastError
();
}
}
virDomainAuditInit
(
vm
,
initpid
,
inode
);
virDomainAuditInit
(
vm
,
initpid
,
inode
);
...
@@ -1618,10 +1617,9 @@ virLXCProcessAutostartDomain(virDomainObjPtr vm,
...
@@ -1618,10 +1617,9 @@ virLXCProcessAutostartDomain(virDomainObjPtr vm,
VIR_DOMAIN_RUNNING_BOOTED
);
VIR_DOMAIN_RUNNING_BOOTED
);
virDomainAuditStart
(
vm
,
"booted"
,
ret
>=
0
);
virDomainAuditStart
(
vm
,
"booted"
,
ret
>=
0
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to autostart VM '%s': %s"
),
VIR_ERROR
(
_
(
"Failed to autostart VM '%s': %s"
),
vm
->
def
->
name
,
vm
->
def
->
name
,
err
?
err
->
message
:
""
);
virGetLastErrorMessage
()
);
}
else
{
}
else
{
virObjectEventPtr
event
=
virObjectEventPtr
event
=
virDomainEventLifecycleNewFromObj
(
vm
,
virDomainEventLifecycleNewFromObj
(
vm
,
...
...
src/rpc/virnettlscontext.c
浏览文件 @
b29e08db
...
@@ -1141,8 +1141,7 @@ int virNetTLSContextCheckCertificate(virNetTLSContextPtr ctxt,
...
@@ -1141,8 +1141,7 @@ int virNetTLSContextCheckCertificate(virNetTLSContextPtr ctxt,
virObjectLock
(
ctxt
);
virObjectLock
(
ctxt
);
virObjectLock
(
sess
);
virObjectLock
(
sess
);
if
(
virNetTLSContextValidCertificate
(
ctxt
,
sess
)
<
0
)
{
if
(
virNetTLSContextValidCertificate
(
ctxt
,
sess
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_WARN
(
"Certificate check failed %s"
,
virGetLastErrorMessage
());
VIR_WARN
(
"Certificate check failed %s"
,
err
&&
err
->
message
?
err
->
message
:
"<unknown>"
);
if
(
ctxt
->
requireValidCert
)
{
if
(
ctxt
->
requireValidCert
)
{
virReportError
(
VIR_ERR_AUTH_FAILED
,
"%s"
,
virReportError
(
VIR_ERR_AUTH_FAILED
,
"%s"
,
_
(
"Failed to verify peer's certificate"
));
_
(
"Failed to verify peer's certificate"
));
...
...
src/storage/storage_driver.c
浏览文件 @
b29e08db
...
@@ -98,10 +98,8 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
...
@@ -98,10 +98,8 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
active
=
false
;
active
=
false
;
if
(
backend
->
checkPool
&&
if
(
backend
->
checkPool
&&
backend
->
checkPool
(
pool
,
&
active
)
<
0
)
{
backend
->
checkPool
(
pool
,
&
active
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to initialize storage pool '%s': %s"
),
VIR_ERROR
(
_
(
"Failed to initialize storage pool '%s': %s"
),
pool
->
def
->
name
,
err
?
err
->
message
:
pool
->
def
->
name
,
virGetLastErrorMessage
());
_
(
"no error message found"
));
goto
error
;
goto
error
;
}
}
...
@@ -112,12 +110,10 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
...
@@ -112,12 +110,10 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
if
(
active
)
{
if
(
active
)
{
virStoragePoolObjClearVols
(
pool
);
virStoragePoolObjClearVols
(
pool
);
if
(
backend
->
refreshPool
(
NULL
,
pool
)
<
0
)
{
if
(
backend
->
refreshPool
(
NULL
,
pool
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
if
(
backend
->
stopPool
)
if
(
backend
->
stopPool
)
backend
->
stopPool
(
NULL
,
pool
);
backend
->
stopPool
(
NULL
,
pool
);
VIR_ERROR
(
_
(
"Failed to restart storage pool '%s': %s"
),
VIR_ERROR
(
_
(
"Failed to restart storage pool '%s': %s"
),
pool
->
def
->
name
,
err
?
err
->
message
:
pool
->
def
->
name
,
virGetLastErrorMessage
());
_
(
"no error message found"
));
goto
error
;
goto
error
;
}
}
}
}
...
@@ -176,10 +172,8 @@ storageDriverAutostart(void)
...
@@ -176,10 +172,8 @@ storageDriverAutostart(void)
!
virStoragePoolObjIsActive
(
pool
))
{
!
virStoragePoolObjIsActive
(
pool
))
{
if
(
backend
->
startPool
&&
if
(
backend
->
startPool
&&
backend
->
startPool
(
conn
,
pool
)
<
0
)
{
backend
->
startPool
(
conn
,
pool
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to autostart storage pool '%s': %s"
),
VIR_ERROR
(
_
(
"Failed to autostart storage pool '%s': %s"
),
pool
->
def
->
name
,
err
?
err
->
message
:
pool
->
def
->
name
,
virGetLastErrorMessage
());
_
(
"no error message found"
));
virStoragePoolObjUnlock
(
pool
);
virStoragePoolObjUnlock
(
pool
);
continue
;
continue
;
}
}
...
@@ -195,14 +189,12 @@ storageDriverAutostart(void)
...
@@ -195,14 +189,12 @@ storageDriverAutostart(void)
if
(
!
stateFile
||
if
(
!
stateFile
||
virStoragePoolSaveState
(
stateFile
,
pool
->
def
)
<
0
||
virStoragePoolSaveState
(
stateFile
,
pool
->
def
)
<
0
||
backend
->
refreshPool
(
conn
,
pool
)
<
0
)
{
backend
->
refreshPool
(
conn
,
pool
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
if
(
stateFile
)
if
(
stateFile
)
unlink
(
stateFile
);
unlink
(
stateFile
);
if
(
backend
->
stopPool
)
if
(
backend
->
stopPool
)
backend
->
stopPool
(
conn
,
pool
);
backend
->
stopPool
(
conn
,
pool
);
VIR_ERROR
(
_
(
"Failed to autostart storage pool '%s': %s"
),
VIR_ERROR
(
_
(
"Failed to autostart storage pool '%s': %s"
),
pool
->
def
->
name
,
err
?
err
->
message
:
pool
->
def
->
name
,
virGetLastErrorMessage
());
_
(
"no error message found"
));
}
else
{
}
else
{
pool
->
active
=
true
;
pool
->
active
=
true
;
}
}
...
...
src/uml/uml_driver.c
浏览文件 @
b29e08db
...
@@ -188,9 +188,8 @@ umlAutostartDomain(virDomainObjPtr vm,
...
@@ -188,9 +188,8 @@ umlAutostartDomain(virDomainObjPtr vm,
ret
=
umlStartVMDaemon
(
data
->
conn
,
data
->
driver
,
vm
,
false
);
ret
=
umlStartVMDaemon
(
data
->
conn
,
data
->
driver
,
vm
,
false
);
virDomainAuditStart
(
vm
,
"booted"
,
ret
>=
0
);
virDomainAuditStart
(
vm
,
"booted"
,
ret
>=
0
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to autostart VM '%s': %s"
),
VIR_ERROR
(
_
(
"Failed to autostart VM '%s': %s"
),
vm
->
def
->
name
,
err
?
err
->
message
:
_
(
"unknown error"
));
vm
->
def
->
name
,
virGetLastErrorMessage
(
));
}
else
{
}
else
{
virObjectEventPtr
event
=
virObjectEventPtr
event
=
virDomainEventLifecycleNewFromObj
(
vm
,
virDomainEventLifecycleNewFromObj
(
vm
,
...
...
src/util/iohelper.c
浏览文件 @
b29e08db
...
@@ -218,7 +218,6 @@ int
...
@@ -218,7 +218,6 @@ int
main
(
int
argc
,
char
**
argv
)
main
(
int
argc
,
char
**
argv
)
{
{
const
char
*
path
;
const
char
*
path
;
virErrorPtr
err
;
unsigned
long
long
offset
;
unsigned
long
long
offset
;
unsigned
long
long
length
;
unsigned
long
long
length
;
int
oflags
=
-
1
;
int
oflags
=
-
1
;
...
@@ -303,12 +302,7 @@ main(int argc, char **argv)
...
@@ -303,12 +302,7 @@ main(int argc, char **argv)
return
0
;
return
0
;
error:
error:
err
=
virGetLastError
();
fprintf
(
stderr
,
_
(
"%s: failure with %s
\n
: %s"
),
if
(
err
)
{
program_name
,
path
,
virGetLastErrorMessage
());
fprintf
(
stderr
,
"%s: %s
\n
"
,
program_name
,
err
->
message
);
}
else
{
fprintf
(
stderr
,
_
(
"%s: unknown failure with %s
\n
"
),
program_name
,
path
);
}
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
src/util/virhook.c
浏览文件 @
b29e08db
...
@@ -297,9 +297,8 @@ virHookCall(int driver,
...
@@ -297,9 +297,8 @@ virHookCall(int driver,
ret
=
virCommandRun
(
cmd
,
NULL
);
ret
=
virCommandRun
(
cmd
,
NULL
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
/* Convert INTERNAL_ERROR into known error. */
/* Convert INTERNAL_ERROR into known error. */
virErrorPtr
err
=
virGetLastError
();
virReportError
(
VIR_ERR_HOOK_SCRIPT_FAILED
,
"%s"
,
virReportError
(
VIR_ERR_HOOK_SCRIPT_FAILED
,
"%s"
,
err
?
err
->
message
:
_
(
"unknown error"
));
virGetLastErrorMessage
(
));
}
}
virCommandFree
(
cmd
);
virCommandFree
(
cmd
);
...
...
src/util/virhostdev.c
浏览文件 @
b29e08db
...
@@ -782,10 +782,9 @@ virHostdevReattachPCIDevice(virHostdevManagerPtr mgr,
...
@@ -782,10 +782,9 @@ virHostdevReattachPCIDevice(virHostdevManagerPtr mgr,
VIR_DEBUG
(
"Reattaching PCI device %s"
,
virPCIDeviceGetName
(
actual
));
VIR_DEBUG
(
"Reattaching PCI device %s"
,
virPCIDeviceGetName
(
actual
));
if
(
virPCIDeviceReattach
(
actual
,
mgr
->
activePCIHostdevs
,
if
(
virPCIDeviceReattach
(
actual
,
mgr
->
activePCIHostdevs
,
mgr
->
inactivePCIHostdevs
)
<
0
)
{
mgr
->
inactivePCIHostdevs
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to re-attach PCI device: %s"
),
VIR_ERROR
(
_
(
"Failed to re-attach PCI device: %s"
),
err
?
err
->
message
:
_
(
"unknown error"
));
virGetLastErrorMessage
(
));
virReset
Error
(
err
);
virReset
LastError
(
);
}
}
}
}
...
@@ -810,10 +809,9 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr mgr,
...
@@ -810,10 +809,9 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr mgr,
virObjectLock
(
mgr
->
inactivePCIHostdevs
);
virObjectLock
(
mgr
->
inactivePCIHostdevs
);
if
(
!
(
pcidevs
=
virHostdevGetPCIHostDeviceList
(
hostdevs
,
nhostdevs
)))
{
if
(
!
(
pcidevs
=
virHostdevGetPCIHostDeviceList
(
hostdevs
,
nhostdevs
)))
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to allocate PCI device list: %s"
),
VIR_ERROR
(
_
(
"Failed to allocate PCI device list: %s"
),
err
?
err
->
message
:
_
(
"unknown error"
));
virGetLastErrorMessage
(
));
virReset
Error
(
err
);
virReset
LastError
(
);
goto
cleanup
;
goto
cleanup
;
}
}
...
@@ -864,10 +862,9 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr mgr,
...
@@ -864,10 +862,9 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr mgr,
if
(
!
actual
||
if
(
!
actual
||
virPCIDeviceListAdd
(
mgr
->
inactivePCIHostdevs
,
actual
)
<
0
)
{
virPCIDeviceListAdd
(
mgr
->
inactivePCIHostdevs
,
actual
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to add PCI device %s to the inactive list"
),
VIR_ERROR
(
_
(
"Failed to add PCI device %s to the inactive list"
),
err
?
err
->
message
:
_
(
"unknown error"
));
virGetLastErrorMessage
(
));
virReset
Error
(
err
);
virReset
LastError
(
);
}
}
}
}
...
@@ -909,10 +906,9 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr mgr,
...
@@ -909,10 +906,9 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr mgr,
VIR_DEBUG
(
"Resetting PCI device %s"
,
virPCIDeviceGetName
(
pci
));
VIR_DEBUG
(
"Resetting PCI device %s"
,
virPCIDeviceGetName
(
pci
));
if
(
virPCIDeviceReset
(
pci
,
mgr
->
activePCIHostdevs
,
if
(
virPCIDeviceReset
(
pci
,
mgr
->
activePCIHostdevs
,
mgr
->
inactivePCIHostdevs
)
<
0
)
{
mgr
->
inactivePCIHostdevs
)
<
0
)
{
virErrorPtr
err
=
virGetLastError
();
VIR_ERROR
(
_
(
"Failed to reset PCI device: %s"
),
VIR_ERROR
(
_
(
"Failed to reset PCI device: %s"
),
err
?
err
->
message
:
_
(
"unknown error"
));
virGetLastErrorMessage
(
));
virReset
Error
(
err
);
virReset
LastError
(
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录