mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
conf: cpu: Introduce virCPUDefListFeatures
The function returns a list of explicitly mentioned features in the CPU definition. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
909564c365
commit
577c4ca414
@ -982,6 +982,30 @@ virCPUDefFindFeature(const virCPUDef *def,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* virCPUDefListExplicitFeatures:
|
||||
* @def: CPU definition
|
||||
*
|
||||
* Provides a list of feature names explicitly mentioned in the CPU definition
|
||||
* regardless of the policy. The caller is responsible for freeing the list.
|
||||
*
|
||||
* Returns a NULL-terminated list of feature names.
|
||||
*/
|
||||
char **
|
||||
virCPUDefListExplicitFeatures(const virCPUDef *def)
|
||||
{
|
||||
char **list;
|
||||
size_t i;
|
||||
|
||||
list = g_new0(char *, def->nfeatures + 1);
|
||||
|
||||
for (i = 0; i < def->nfeatures; i++)
|
||||
list[i] = g_strdup(def->features[i].name);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
virCPUDefFilterFeatures(virCPUDef *cpu,
|
||||
virCPUDefFeatureFilter filter,
|
||||
|
@ -270,6 +270,9 @@ virCPUDefCheckFeatures(virCPUDef *cpu,
|
||||
void *opaque,
|
||||
char ***features);
|
||||
|
||||
char **
|
||||
virCPUDefListExplicitFeatures(const virCPUDef *def);
|
||||
|
||||
virCPUDef **
|
||||
virCPUDefListParse(const char **xmlCPUs,
|
||||
unsigned int ncpus,
|
||||
|
@ -111,6 +111,7 @@ virCPUDefFree;
|
||||
virCPUDefFreeFeatures;
|
||||
virCPUDefFreeModel;
|
||||
virCPUDefIsEqual;
|
||||
virCPUDefListExplicitFeatures;
|
||||
virCPUDefListFree;
|
||||
virCPUDefListParse;
|
||||
virCPUDefNew;
|
||||
|
Loading…
Reference in New Issue
Block a user