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

View File

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