mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
cpu_arm: Avoid use of 'unsigned long'
Covert all use of 'unsigned long' to 'unsigned long long'. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
423d93967a
commit
111a21c21f
@ -57,7 +57,7 @@ static const virArch archs[] = {
|
|||||||
typedef struct _virCPUarmVendor virCPUarmVendor;
|
typedef struct _virCPUarmVendor virCPUarmVendor;
|
||||||
struct _virCPUarmVendor {
|
struct _virCPUarmVendor {
|
||||||
char *name;
|
char *name;
|
||||||
unsigned long value;
|
unsigned long long value;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct _virCPUarmModel virCPUarmModel;
|
typedef struct _virCPUarmModel virCPUarmModel;
|
||||||
@ -266,7 +266,7 @@ virCPUarmMapFeatureParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED,
|
|||||||
|
|
||||||
static virCPUarmVendor *
|
static virCPUarmVendor *
|
||||||
virCPUarmVendorFindByID(virCPUarmMap *map,
|
virCPUarmVendorFindByID(virCPUarmMap *map,
|
||||||
unsigned long vendor_id)
|
unsigned long long vendor_id)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
@ -312,15 +312,13 @@ virCPUarmVendorParse(xmlXPathContextPtr ctxt,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virXPathULongHex("string(@value)", ctxt, &vendor->value) < 0) {
|
if (virXMLPropULongLong(ctxt->node, "value", 16, VIR_XML_PROP_REQUIRED,
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
&vendor->value) < 0)
|
||||||
"%s", _("Missing CPU vendor value"));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if (virCPUarmVendorFindByID(map, vendor->value)) {
|
if (virCPUarmVendorFindByID(map, vendor->value)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("CPU vendor value 0x%2lx already defined"),
|
_("CPU vendor value 0x%2llx already defined"),
|
||||||
vendor->value);
|
vendor->value);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -347,7 +345,7 @@ virCPUarmModelFind(virCPUarmMap *map,
|
|||||||
#if defined(__aarch64__)
|
#if defined(__aarch64__)
|
||||||
static virCPUarmModel *
|
static virCPUarmModel *
|
||||||
virCPUarmModelFindByPVR(virCPUarmMap *map,
|
virCPUarmModelFindByPVR(virCPUarmMap *map,
|
||||||
unsigned long pvr)
|
unsigned long long pvr)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
@ -367,7 +365,8 @@ virCPUarmModelParse(xmlXPathContextPtr ctxt,
|
|||||||
{
|
{
|
||||||
virCPUarmMap *map = data;
|
virCPUarmMap *map = data;
|
||||||
g_autoptr(virCPUarmModel) model = NULL;
|
g_autoptr(virCPUarmModel) model = NULL;
|
||||||
g_autofree char *vendor = NULL;
|
xmlNodePtr vendorNode = NULL;
|
||||||
|
xmlNodePtr pvrNode = NULL;
|
||||||
|
|
||||||
model = g_new0(virCPUarmModel, 1);
|
model = g_new0(virCPUarmModel, 1);
|
||||||
model->name = g_strdup(name);
|
model->name = g_strdup(name);
|
||||||
@ -379,14 +378,11 @@ virCPUarmModelParse(xmlXPathContextPtr ctxt,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virXPathBoolean("boolean(./vendor)", ctxt)) {
|
if ((vendorNode = virXPathNode("./vendor", ctxt))) {
|
||||||
vendor = virXPathString("string(./vendor/@name)", ctxt);
|
g_autofree char *vendor = NULL;
|
||||||
if (!vendor) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
if (!(vendor = virXMLPropStringRequired(vendorNode, "name")))
|
||||||
_("Invalid vendor element in CPU model %s"),
|
|
||||||
model->name);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if (!(model->vendor = virCPUarmVendorFindByName(map, vendor))) {
|
if (!(model->vendor = virCPUarmVendorFindByName(map, vendor))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -396,19 +392,16 @@ virCPUarmModelParse(xmlXPathContextPtr ctxt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virXPathBoolean("boolean(./pvr)", ctxt)) {
|
if (!(pvrNode = virXPathNode("./pvr", ctxt))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Missing PVR information for CPU model %s"),
|
_("Missing PVR information for CPU model %s"),
|
||||||
model->name);
|
model->name);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (virXPathULongHex("string(./pvr/@value)", ctxt, &model->data.pvr) < 0) {
|
if (virXMLPropULongLong(pvrNode, "value", 16, VIR_XML_PROP_REQUIRED,
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
&model->data.pvr) < 0)
|
||||||
_("Missing or invalid PVR value in CPU model %s"),
|
|
||||||
model->name);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
VIR_APPEND_ELEMENT(map->models, map->nmodels, model);
|
VIR_APPEND_ELEMENT(map->models, map->nmodels, model);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
typedef struct _virCPUarmData virCPUarmData;
|
typedef struct _virCPUarmData virCPUarmData;
|
||||||
struct _virCPUarmData {
|
struct _virCPUarmData {
|
||||||
unsigned long vendor_id;
|
unsigned long long vendor_id;
|
||||||
unsigned long pvr;
|
unsigned long long pvr;
|
||||||
char **features;
|
char **features;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user