2010-11-05 14:22:13 +00:00
|
|
|
/*
|
2012-12-13 15:31:53 +00:00
|
|
|
* virsysinfo.h: get SMBIOS/sysinfo information from the host
|
2010-11-05 14:22:13 +00:00
|
|
|
*
|
2011-02-07 23:16:04 +00:00
|
|
|
* Copyright (C) 2010-2011 Red Hat, Inc.
|
2010-11-05 14:22:13 +00:00
|
|
|
* Copyright (C) 2010 Daniel Veillard
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2010-11-05 14:22:13 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIR_SYSINFOS_H__
|
|
|
|
# define __VIR_SYSINFOS_H__
|
|
|
|
|
|
|
|
# include "internal.h"
|
2012-12-13 17:44:57 +00:00
|
|
|
# include "virutil.h"
|
2012-12-04 12:04:07 +00:00
|
|
|
# include "virbuffer.h"
|
2010-11-05 14:22:13 +00:00
|
|
|
|
2014-04-27 00:15:22 +00:00
|
|
|
typedef enum {
|
2011-05-27 09:47:30 +00:00
|
|
|
VIR_SYSINFO_SMBIOS,
|
2010-11-05 14:22:13 +00:00
|
|
|
|
2011-05-27 09:47:30 +00:00
|
|
|
VIR_SYSINFO_LAST
|
2014-04-27 00:15:22 +00:00
|
|
|
} virSysinfoType;
|
2010-11-05 14:22:13 +00:00
|
|
|
|
2011-06-27 07:39:34 +00:00
|
|
|
typedef struct _virSysinfoProcessorDef virSysinfoProcessorDef;
|
|
|
|
typedef virSysinfoProcessorDef *virSysinfoProcessorDefPtr;
|
|
|
|
struct _virSysinfoProcessorDef {
|
2011-06-24 05:42:02 +00:00
|
|
|
char *processor_socket_destination;
|
|
|
|
char *processor_type;
|
|
|
|
char *processor_family;
|
|
|
|
char *processor_manufacturer;
|
|
|
|
char *processor_signature;
|
|
|
|
char *processor_version;
|
|
|
|
char *processor_external_clock;
|
|
|
|
char *processor_max_speed;
|
|
|
|
char *processor_status;
|
|
|
|
char *processor_serial_number;
|
|
|
|
char *processor_part_number;
|
|
|
|
};
|
|
|
|
|
2011-06-27 07:39:34 +00:00
|
|
|
typedef struct _virSysinfoMemoryDef virSysinfoMemoryDef;
|
|
|
|
typedef virSysinfoMemoryDef *virSysinfoMemoryDefPtr;
|
|
|
|
struct _virSysinfoMemoryDef {
|
2011-06-24 06:05:48 +00:00
|
|
|
char *memory_size;
|
|
|
|
char *memory_form_factor;
|
|
|
|
char *memory_locator;
|
|
|
|
char *memory_bank_locator;
|
|
|
|
char *memory_type;
|
|
|
|
char *memory_type_detail;
|
|
|
|
char *memory_speed;
|
|
|
|
char *memory_manufacturer;
|
|
|
|
char *memory_serial_number;
|
|
|
|
char *memory_part_number;
|
|
|
|
};
|
|
|
|
|
2015-05-12 10:02:29 +00:00
|
|
|
typedef struct _virSysinfoBIOSDef virSysinfoBIOSDef;
|
|
|
|
typedef virSysinfoBIOSDef *virSysinfoBIOSDefPtr;
|
|
|
|
struct _virSysinfoBIOSDef {
|
|
|
|
char *vendor;
|
|
|
|
char *version;
|
|
|
|
char *date;
|
|
|
|
char *release;
|
|
|
|
};
|
|
|
|
|
2015-05-12 12:33:12 +00:00
|
|
|
typedef struct _virSysinfoSystemDef virSysinfoSystemDef;
|
|
|
|
typedef virSysinfoSystemDef *virSysinfoSystemDefPtr;
|
|
|
|
struct _virSysinfoSystemDef {
|
|
|
|
char *manufacturer;
|
|
|
|
char *product;
|
|
|
|
char *version;
|
|
|
|
char *serial;
|
|
|
|
char *uuid;
|
|
|
|
char *sku;
|
|
|
|
char *family;
|
|
|
|
};
|
|
|
|
|
2015-05-12 14:47:49 +00:00
|
|
|
typedef struct _virSysinfoBaseBoardDef virSysinfoBaseBoardDef;
|
|
|
|
typedef virSysinfoBaseBoardDef *virSysinfoBaseBoardDefPtr;
|
|
|
|
struct _virSysinfoBaseBoardDef {
|
|
|
|
char *manufacturer;
|
|
|
|
char *product;
|
|
|
|
char *version;
|
|
|
|
char *serial;
|
|
|
|
char *asset;
|
|
|
|
char *location;
|
|
|
|
/* XXX board type */
|
|
|
|
};
|
|
|
|
|
2018-02-14 09:22:38 +00:00
|
|
|
typedef struct _virSysinfoChassisDef virSysinfoChassisDef;
|
|
|
|
typedef virSysinfoChassisDef *virSysinfoChassisDefPtr;
|
|
|
|
struct _virSysinfoChassisDef {
|
|
|
|
char *manufacturer;
|
|
|
|
char *version;
|
|
|
|
char *serial;
|
|
|
|
char *asset;
|
|
|
|
char *sku;
|
|
|
|
};
|
|
|
|
|
2017-10-28 13:56:51 +00:00
|
|
|
typedef struct _virSysinfoOEMStringsDef virSysinfoOEMStringsDef;
|
|
|
|
typedef virSysinfoOEMStringsDef *virSysinfoOEMStringsDefPtr;
|
|
|
|
struct _virSysinfoOEMStringsDef {
|
|
|
|
size_t nvalues;
|
|
|
|
char **values;
|
|
|
|
};
|
|
|
|
|
2010-11-05 14:22:13 +00:00
|
|
|
typedef struct _virSysinfoDef virSysinfoDef;
|
|
|
|
typedef virSysinfoDef *virSysinfoDefPtr;
|
|
|
|
struct _virSysinfoDef {
|
|
|
|
int type;
|
|
|
|
|
2015-05-12 10:02:29 +00:00
|
|
|
virSysinfoBIOSDefPtr bios;
|
2015-05-12 12:33:12 +00:00
|
|
|
virSysinfoSystemDefPtr system;
|
2011-06-24 05:42:02 +00:00
|
|
|
|
2015-05-12 14:47:49 +00:00
|
|
|
size_t nbaseBoard;
|
|
|
|
virSysinfoBaseBoardDefPtr baseBoard;
|
|
|
|
|
2018-02-14 09:22:38 +00:00
|
|
|
virSysinfoChassisDefPtr chassis;
|
|
|
|
|
2011-06-24 05:42:02 +00:00
|
|
|
size_t nprocessor;
|
2011-06-27 07:39:34 +00:00
|
|
|
virSysinfoProcessorDefPtr processor;
|
2011-06-24 06:05:48 +00:00
|
|
|
|
|
|
|
size_t nmemory;
|
2011-06-27 07:39:34 +00:00
|
|
|
virSysinfoMemoryDefPtr memory;
|
2017-10-28 13:56:51 +00:00
|
|
|
|
|
|
|
virSysinfoOEMStringsDefPtr oemStrings;
|
2010-11-05 14:22:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
virSysinfoDefPtr virSysinfoRead(void);
|
|
|
|
|
2015-05-12 10:02:29 +00:00
|
|
|
void virSysinfoBIOSDefFree(virSysinfoBIOSDefPtr def);
|
2015-05-12 12:33:12 +00:00
|
|
|
void virSysinfoSystemDefFree(virSysinfoSystemDefPtr def);
|
2015-05-12 14:47:49 +00:00
|
|
|
void virSysinfoBaseBoardDefClear(virSysinfoBaseBoardDefPtr def);
|
2018-02-14 09:22:38 +00:00
|
|
|
void virSysinfoChassisDefFree(virSysinfoChassisDefPtr def);
|
2017-10-28 13:56:51 +00:00
|
|
|
void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDefPtr def);
|
2010-11-05 14:22:13 +00:00
|
|
|
void virSysinfoDefFree(virSysinfoDefPtr def);
|
|
|
|
|
2011-09-21 23:28:01 +00:00
|
|
|
int virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def)
|
2011-02-07 23:16:04 +00:00
|
|
|
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
|
|
|
|
|
2011-05-27 09:47:30 +00:00
|
|
|
bool virSysinfoIsEqual(virSysinfoDefPtr src,
|
|
|
|
virSysinfoDefPtr dst);
|
|
|
|
|
|
|
|
VIR_ENUM_DECL(virSysinfo)
|
|
|
|
|
2010-11-05 14:22:13 +00:00
|
|
|
#endif /* __VIR_SYSINFOS_H__ */
|