From: Eric Bollengier Date: Mon, 20 Jul 2020 08:42:22 +0000 (+0200) Subject: gpfs: Add GPFS in status client output (debug level > 0) X-Git-Tag: Release-11.3.2~1369 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39939b679ea5255a04d584bdd2f48f7c79ddf2d4;p=thirdparty%2Fbacula.git gpfs: Add GPFS in status client output (debug level > 0) --- diff --git a/bacula/src/filed/bacgpfs.h b/bacula/src/filed/bacgpfs.h index 201a19aa2a..a752ddae6c 100644 --- a/bacula/src/filed/bacgpfs.h +++ b/bacula/src/filed/bacgpfs.h @@ -89,8 +89,14 @@ class GPFSLIB : public SMARTALLOC bRC_GPFSLIB _gpfs_backup_acl_data(JCR *jcr, FF_PKT *ff_pkt, unsigned char acl_type, POOLMEM *content, uint32_t &content_len); bRC_GPFSLIB _gpfs_restore_acl_data(JCR *jcr, int stream, POOLMEM *content, uint32_t content_len); + public: + /* Check if the library is loaded */ + static bool enabled() { + return Get()._gpfs_getacl != NULL; + }; + /** * @brief Destroy the GPFSLIB object * @@ -156,4 +162,4 @@ public: }; -#endif /* _BAC_GPFS_H_ */ \ No newline at end of file +#endif /* _BAC_GPFS_H_ */ diff --git a/bacula/src/filed/filed.c b/bacula/src/filed/filed.c index d4c742f0fa..cfc0840e9b 100644 --- a/bacula/src/filed/filed.c +++ b/bacula/src/filed/filed.c @@ -281,6 +281,8 @@ int main (int argc, char *argv[]) events_send_msg(NULL, "FD0001", EVENTS_TYPE_DAEMON, "*Daemon*", (intptr_t)get_first_port_host_order(me->FDaddrs), "Filed startup"); + + /* Load the GPFS library if installed */ GPFSLIB::Init(); server_tid = pthread_self(); diff --git a/bacula/src/filed/status.c b/bacula/src/filed/status.c index 91594744b5..0e21990979 100644 --- a/bacula/src/filed/status.c +++ b/bacula/src/filed/status.c @@ -124,6 +124,7 @@ static void api_list_status_header(STATUS_PKT *sp) OT_STRING, "pkidigest", NPRTB(digest), OT_INT32, "fips", crypto_get_fips(), OT_STRING, "crypto", crypto_get_version(), + OT_BOOL, "gpfs", GPFSLIB::enabled(), OT_END); p = wt.end_group(); sendit(p, strlen(p), sp); @@ -205,6 +206,7 @@ static void list_status_header(STATUS_PKT *sp) p_GetVolumeNameForVolumeMountPointW?"":"!", have_lzo?"":"!", (BEEF>0)?"":"!"); + ); sendit(msg.c_str(), len, sp); } #endif @@ -233,6 +235,11 @@ static void list_status_header(STATUS_PKT *sp) len = Mmsg(msg, " Crypto: fips=%s crypto=%s\n", crypto_get_fips_enabled(), crypto_get_version()); sendit(msg.c_str(), len, sp); + if (chk_dbglvl(1)) { + len = Mmsg(msg, " APIs: %sGPFS\n", GPFSLIB::enabled()?"":"!"); + sendit(msg.c_str(), len, sp); + } + if (b_plugin_list && b_plugin_list->size() > 0) { Plugin *plugin; int len, maxlen=80;