fix #6434: pmxcfs: add context to *_initialize errors
in case initializing fails with CS_ERR_LIBRARY, the connection to corosync failed - add that context to make the error message a bit less cryptic. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> Link: https://lore.proxmox.com/20250605141720.734781-2-f.gruenbichler@proxmox.com Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
9815c866e1
commit
c70839846a
3 changed files with 26 additions and 3 deletions
|
|
@ -221,7 +221,14 @@ static int service_cmap_initialize(cfs_service_t *service, gpointer context) {
|
|||
|
||||
result = cmap_initialize(&handle);
|
||||
if (result != CS_OK) {
|
||||
cfs_critical("cmap_initialize failed: %s", cs_strerror(result));
|
||||
if (result == CS_ERR_LIBRARY) {
|
||||
cfs_critical(
|
||||
"cmap_initialize failed: %s (failed to connect to corosync)",
|
||||
cs_strerror(result)
|
||||
);
|
||||
} else {
|
||||
cfs_critical("cmap_initialize failed: %s", cs_strerror(result));
|
||||
}
|
||||
private->handle = 0;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1351,7 +1351,16 @@ cs_error_t dfsm_initialize(dfsm_t *dfsm, int *fd) {
|
|||
|
||||
if (dfsm->cpg_handle == 0) {
|
||||
if ((result = cpg_initialize(&dfsm->cpg_handle, dfsm->cpg_callbacks)) != CS_OK) {
|
||||
cfs_dom_critical(dfsm->log_domain, "cpg_initialize failed: %s", cs_strerror(result));
|
||||
if (result == CS_ERR_LIBRARY) {
|
||||
cfs_dom_critical(
|
||||
dfsm->log_domain, "cpg_initialize failed: %s (failed to connect to corosync)",
|
||||
cs_strerror(result)
|
||||
);
|
||||
} else {
|
||||
cfs_dom_critical(
|
||||
dfsm->log_domain, "cpg_initialize failed: %s", cs_strerror(result)
|
||||
);
|
||||
}
|
||||
goto err_no_finalize;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,14 @@ static int service_quorum_initialize(cfs_service_t *service, gpointer context) {
|
|||
|
||||
result = quorum_initialize(&handle, &quorum_callbacks, &quorum_type);
|
||||
if (result != CS_OK) {
|
||||
cfs_critical("quorum_initialize failed: %s", cs_strerror(result));
|
||||
if (result == CS_ERR_LIBRARY) {
|
||||
cfs_critical(
|
||||
"quorum_initialize failed: %s (failed to connect to corosync)",
|
||||
cs_strerror(result)
|
||||
);
|
||||
} else {
|
||||
cfs_critical("quorum_initialize failed: %s", cs_strerror(result));
|
||||
}
|
||||
goto err_reset_handle;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue