sysinfo: cleanup function/struct names.

Fix lack of 'virSysinfo' prefix of functions/structs in src/util/sysinfo.[ch]
This commit is contained in:
Minoru Usui 2011-06-27 16:39:34 +09:00 committed by Eric Blake
parent a6c85d44e0
commit 0a755f66d5
2 changed files with 32 additions and 28 deletions

View File

@ -128,7 +128,7 @@ virSysinfoRead(void) {
#else /* !WIN32 */ #else /* !WIN32 */
static char * static char *
parseBIOSInfo(char *base, virSysinfoDefPtr ret) virSysinfoParseBIOS(char *base, virSysinfoDefPtr ret)
{ {
char *cur, *eol; char *cur, *eol;
@ -164,7 +164,7 @@ no_memory:
} }
static char * static char *
parseSystemInfo(char *base, virSysinfoDefPtr ret) virSysinfoParseSystem(char *base, virSysinfoDefPtr ret)
{ {
char *cur, *eol; char *cur, *eol;
@ -222,10 +222,10 @@ no_memory:
} }
static char * static char *
parseProcessorInfo(char *base, virSysinfoDefPtr ret) virSysinfoParseProcessor(char *base, virSysinfoDefPtr ret)
{ {
char *cur, *eol, *tmp_base; char *cur, *eol, *tmp_base;
virProcessorinfoDefPtr processor; virSysinfoProcessorDefPtr processor;
while((tmp_base = strstr(base, "Processor Information")) != NULL) { while((tmp_base = strstr(base, "Processor Information")) != NULL) {
base = tmp_base; base = tmp_base;
@ -323,10 +323,10 @@ no_memory:
} }
static char * static char *
parseMemoryDeviceInfo(char *base, virSysinfoDefPtr ret) virSysinfoParseMemory(char *base, virSysinfoDefPtr ret)
{ {
char *cur, *eol, *tmp_base; char *cur, *eol, *tmp_base;
virMemoryDeviceinfoDefPtr memory; virSysinfoMemoryDefPtr memory;
while ((tmp_base = strstr(base, "Memory Device")) != NULL) { while ((tmp_base = strstr(base, "Memory Device")) != NULL) {
base = tmp_base; base = tmp_base;
@ -452,20 +452,20 @@ virSysinfoRead(void) {
base = outbuf; base = outbuf;
if ((base = parseBIOSInfo(base, ret)) == NULL) if ((base = virSysinfoParseBIOS(base, ret)) == NULL)
goto no_memory; goto no_memory;
if ((base = parseSystemInfo(base, ret)) == NULL) if ((base = virSysinfoParseSystem(base, ret)) == NULL)
goto no_memory; goto no_memory;
ret->nprocessor = 0; ret->nprocessor = 0;
ret->processor = NULL; ret->processor = NULL;
if ((base = parseProcessorInfo(base, ret)) == NULL) if ((base = virSysinfoParseProcessor(base, ret)) == NULL)
goto no_memory; goto no_memory;
ret->nmemory = 0; ret->nmemory = 0;
ret->memory = NULL; ret->memory = NULL;
if ((base = parseMemoryDeviceInfo(base, ret)) == NULL) if ((base = virSysinfoParseMemory(base, ret)) == NULL)
goto no_memory; goto no_memory;
cleanup: cleanup:
@ -484,7 +484,8 @@ no_memory:
#endif /* !WIN32 */ #endif /* !WIN32 */
static void static void
BIOSInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf) virSysinfoBIOSFormat(virSysinfoDefPtr def, const char *prefix,
virBufferPtr buf)
{ {
int len = strlen(prefix); int len = strlen(prefix);
@ -522,7 +523,8 @@ BIOSInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf)
} }
static void static void
SystemInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf) virSysinfoSystemFormat(virSysinfoDefPtr def, const char *prefix,
virBufferPtr buf)
{ {
int len = strlen(prefix); int len = strlen(prefix);
@ -580,11 +582,12 @@ SystemInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf)
} }
static void static void
ProcessorInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf) virSysinfoProcessorFormat(virSysinfoDefPtr def, const char *prefix,
virBufferPtr buf)
{ {
int i; int i;
int len = strlen(prefix); int len = strlen(prefix);
virProcessorinfoDefPtr processor; virSysinfoProcessorDefPtr processor;
for (i = 0; i < def->nprocessor; i++) { for (i = 0; i < def->nprocessor; i++) {
processor = &def->processor[i]; processor = &def->processor[i];
@ -675,11 +678,12 @@ ProcessorInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf)
} }
static void static void
MemoryDeviceInfoFormat(virSysinfoDefPtr def, const char *prefix, virBufferPtr buf) virSysinfoMemoryFormat(virSysinfoDefPtr def, const char *prefix,
virBufferPtr buf)
{ {
int i; int i;
int len = strlen(prefix); int len = strlen(prefix);
virMemoryDeviceinfoDefPtr memory; virSysinfoMemoryDefPtr memory;
for (i = 0; i < def->nmemory; i++) { for (i = 0; i < def->nmemory; i++) {
memory = &def->memory[i]; memory = &def->memory[i];
@ -785,10 +789,10 @@ virSysinfoFormat(virSysinfoDefPtr def, const char *prefix)
virBufferAsprintf(&buf, "%s<sysinfo type='%s'>\n", prefix, type); virBufferAsprintf(&buf, "%s<sysinfo type='%s'>\n", prefix, type);
BIOSInfoFormat(def, prefix, &buf); virSysinfoBIOSFormat(def, prefix, &buf);
SystemInfoFormat(def, prefix, &buf); virSysinfoSystemFormat(def, prefix, &buf);
ProcessorInfoFormat(def, prefix, &buf); virSysinfoProcessorFormat(def, prefix, &buf);
MemoryDeviceInfoFormat(def, prefix, &buf); virSysinfoMemoryFormat(def, prefix, &buf);
virBufferAsprintf(&buf, "%s</sysinfo>\n", prefix); virBufferAsprintf(&buf, "%s</sysinfo>\n", prefix);

View File

@ -33,9 +33,9 @@ enum virSysinfoType {
VIR_SYSINFO_LAST VIR_SYSINFO_LAST
}; };
typedef struct _virProcessorinfoDef virProcessorinfoDef; typedef struct _virSysinfoProcessorDef virSysinfoProcessorDef;
typedef virProcessorinfoDef *virProcessorinfoDefPtr; typedef virSysinfoProcessorDef *virSysinfoProcessorDefPtr;
struct _virProcessorinfoDef { struct _virSysinfoProcessorDef {
char *processor_socket_destination; char *processor_socket_destination;
char *processor_type; char *processor_type;
char *processor_family; char *processor_family;
@ -49,9 +49,9 @@ struct _virProcessorinfoDef {
char *processor_part_number; char *processor_part_number;
}; };
typedef struct _virMemoryDeviceinfoDef virMemoryDeviceinfoDef; typedef struct _virSysinfoMemoryDef virSysinfoMemoryDef;
typedef virMemoryDeviceinfoDef *virMemoryDeviceinfoDefPtr; typedef virSysinfoMemoryDef *virSysinfoMemoryDefPtr;
struct _virMemoryDeviceinfoDef { struct _virSysinfoMemoryDef {
char *memory_size; char *memory_size;
char *memory_form_factor; char *memory_form_factor;
char *memory_locator; char *memory_locator;
@ -83,10 +83,10 @@ struct _virSysinfoDef {
char *system_family; char *system_family;
size_t nprocessor; size_t nprocessor;
virProcessorinfoDefPtr processor; virSysinfoProcessorDefPtr processor;
size_t nmemory; size_t nmemory;
virMemoryDeviceinfoDefPtr memory; virSysinfoMemoryDefPtr memory;
}; };
virSysinfoDefPtr virSysinfoRead(void); virSysinfoDefPtr virSysinfoRead(void);