mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
remote: in per-driver daemons ensure that state initialize succeeds
When running in libvirtd, we are happy for any of the drivers to simply skip their initialization in virStateInitialize, as other drivers are still potentially useful. When running in per-driver daemons though, we want the daemon to abort startup if the driver cannot initialize itself, as the daemon will be useless without it. Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
@@ -1816,14 +1816,14 @@ nodeStateInitialize(bool privileged,
|
||||
virThread enumThread;
|
||||
|
||||
if (VIR_ALLOC(driver) < 0)
|
||||
return -1;
|
||||
return VIR_DRV_STATE_INIT_ERROR;
|
||||
|
||||
driver->lockFD = -1;
|
||||
if (virMutexInit(&driver->lock) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("Unable to initialize mutex"));
|
||||
VIR_FREE(driver);
|
||||
return -1;
|
||||
return VIR_DRV_STATE_INIT_ERROR;
|
||||
}
|
||||
|
||||
driver->privileged = privileged;
|
||||
@@ -1919,11 +1919,11 @@ nodeStateInitialize(bool privileged,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return VIR_DRV_STATE_INIT_COMPLETE;
|
||||
|
||||
cleanup:
|
||||
nodeStateCleanup();
|
||||
return -1;
|
||||
return VIR_DRV_STATE_INIT_ERROR;
|
||||
|
||||
unlock:
|
||||
virObjectUnlock(priv);
|
||||
|
||||
Reference in New Issue
Block a user