mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-12 22:51:29 +00:00
storage: Replace VIR_ERROR with standard vir*Error in state driver init
Replace VIR_ERROR with virReportError and virReportSystemError
This commit is contained in:
parent
1433c803c9
commit
580dbf06a4
@ -88,7 +88,8 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if ((backend = virStorageBackendForType(pool->def->type)) == NULL) {
|
if ((backend = virStorageBackendForType(pool->def->type)) == NULL) {
|
||||||
VIR_ERROR(_("Missing backend %d"), pool->def->type);
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Missing backend %d"), pool->def->type);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +99,8 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
|
|||||||
active = false;
|
active = false;
|
||||||
if (backend->checkPool &&
|
if (backend->checkPool &&
|
||||||
backend->checkPool(pool, &active) < 0) {
|
backend->checkPool(pool, &active) < 0) {
|
||||||
VIR_ERROR(_("Failed to initialize storage pool '%s': %s"),
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Failed to initialize storage pool '%s': %s"),
|
||||||
pool->def->name, virGetLastErrorMessage());
|
pool->def->name, virGetLastErrorMessage());
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -112,7 +114,8 @@ storagePoolUpdateState(virStoragePoolObjPtr pool)
|
|||||||
if (backend->refreshPool(NULL, pool) < 0) {
|
if (backend->refreshPool(NULL, pool) < 0) {
|
||||||
if (backend->stopPool)
|
if (backend->stopPool)
|
||||||
backend->stopPool(NULL, pool);
|
backend->stopPool(NULL, pool);
|
||||||
VIR_ERROR(_("Failed to restart storage pool '%s': %s"),
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Failed to restart storage pool '%s': %s"),
|
||||||
pool->def->name, virGetLastErrorMessage());
|
pool->def->name, virGetLastErrorMessage());
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
@ -172,7 +175,8 @@ storageDriverAutostart(void)
|
|||||||
!virStoragePoolObjIsActive(pool)) {
|
!virStoragePoolObjIsActive(pool)) {
|
||||||
if (backend->startPool &&
|
if (backend->startPool &&
|
||||||
backend->startPool(conn, pool) < 0) {
|
backend->startPool(conn, pool) < 0) {
|
||||||
VIR_ERROR(_("Failed to autostart storage pool '%s': %s"),
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Failed to autostart storage pool '%s': %s"),
|
||||||
pool->def->name, virGetLastErrorMessage());
|
pool->def->name, virGetLastErrorMessage());
|
||||||
virStoragePoolObjUnlock(pool);
|
virStoragePoolObjUnlock(pool);
|
||||||
continue;
|
continue;
|
||||||
@ -193,7 +197,8 @@ storageDriverAutostart(void)
|
|||||||
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"),
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Failed to autostart storage pool '%s': %s"),
|
||||||
pool->def->name, virGetLastErrorMessage());
|
pool->def->name, virGetLastErrorMessage());
|
||||||
} else {
|
} else {
|
||||||
pool->active = true;
|
pool->active = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user