summaryrefslogtreecommitdiffstats
path: root/src/hardware/utils.h
diff options
context:
space:
mode:
authorPeter Schiffer <pschiffe@redhat.com>2013-05-07 19:49:41 +0200
committerPeter Schiffer <pschiffe@redhat.com>2013-05-07 19:49:41 +0200
commit1c3bd366f82d4f53c76b89f8fff9359356781622 (patch)
tree2f7dbc5d915daf47391af01abd43f5c87b775c87 /src/hardware/utils.h
parent7f5607358182d779cf5d3355d4f8d0e3a3f8e607 (diff)
downloadopenlmi-providers-1c3bd366f82d4f53c76b89f8fff9359356781622.tar.gz
openlmi-providers-1c3bd366f82d4f53c76b89f8fff9359356781622.tar.xz
openlmi-providers-1c3bd366f82d4f53c76b89f8fff9359356781622.zip
Hardware: Better support for multi CPU systems and kvm guests.
Changes: * Fixed problem when CPU ID from dmidecode is not unique * Use cache info from sysfs if dmi cpu info is available, but not dmi cache * When using sysfs cache, create all caches for every CPU * Fixed physical memory tag when serial number field is missing in dmidecode output * Tiny clean-up Hardware provider was tested in kvm guest with pegasus and this patch is result of the test. Now, thanks to the all fallback options, hardware provider works fine in this environment with and without selinux enabled.
Diffstat (limited to 'src/hardware/utils.h')
-rw-r--r--src/hardware/utils.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/hardware/utils.h b/src/hardware/utils.h
index 933c042..2a1a690 100644
--- a/src/hardware/utils.h
+++ b/src/hardware/utils.h
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <stdarg.h>
#include "globals.h"
#define LONG_INT_LEN 21 /* 64 bit unsigned int can has 20 decimals + \0 */
@@ -109,5 +110,15 @@ char *trim(const char *str, const char *delims);
*/
short explode(const char *str, const char *delims, char ***buffer, unsigned *buffer_size);
+/*
+ * Append strings to the first string parameter.
+ * @param str string where the rest of params will be appended. Can be NULL.
+ * When appending, str will be reallocated to the correct size.
+ * Last parameter must be NULL.
+ * @return pointer to the final string (same as str, if it wasn't NULL). In case
+ * of any problem, NULL is returned.
+ */
+char *append_str(char *str, ...);
+
#endif /* UTILS_H_ */