diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 1f4d2818497f6d7d6463a0a05d8b2af067ca1518..b97906b852389baebca4ef0e3cf49e3bd6081fe8 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2199,6 +2199,7 @@ virHostMemSetParameters; # util/virhostuptime.h +virHostBootTimeInit; virHostGetBootTime; diff --git a/src/util/virhostuptime.c b/src/util/virhostuptime.c index 8c49c3d40e652e3c0846cd282fb39c5060847b3e..661ed588cda9896a61553908f58c30801881b9ba 100644 --- a/src/util/virhostuptime.c +++ b/src/util/virhostuptime.c @@ -126,7 +126,7 @@ virHostGetBootTimeOnceInit(void) int virHostGetBootTime(unsigned long long *when) { - if (virOnce(&virHostGetBootTimeOnce, virHostGetBootTimeOnceInit) < 0) + if (virHostBootTimeInit() < 0) return -1; if (bootTimeErrno) { @@ -137,3 +137,13 @@ virHostGetBootTime(unsigned long long *when) *when = bootTime; return 0; } + + +int +virHostBootTimeInit(void) +{ + if (virOnce(&virHostGetBootTimeOnce, virHostGetBootTimeOnceInit) < 0) + return -1; + + return 0; +} diff --git a/src/util/virhostuptime.h b/src/util/virhostuptime.h index 7e2c4c0c814e159e735a21ae242595ffe7de4262..1ac638fd6e5e0045d727969d7af8dca08d7e8e13 100644 --- a/src/util/virhostuptime.h +++ b/src/util/virhostuptime.h @@ -25,3 +25,6 @@ int virHostGetBootTime(unsigned long long *when) G_GNUC_NO_INLINE; + +int +virHostBootTimeInit(void);