提交 532fc7b7 编写于 作者: J Jiri Denemark

cpu_conf: Introduce virCPUDefFreeFeatures

Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 b101101d
......@@ -62,18 +62,27 @@ VIR_ENUM_IMPL(virCPUFeaturePolicy, VIR_CPU_FEATURE_LAST,
"disable",
"forbid")
void
virCPUDefFreeFeatures(virCPUDefPtr def)
{
size_t i;
for (i = 0; i < def->nfeatures; i++)
VIR_FREE(def->features[i].name);
VIR_FREE(def->features);
def->nfeatures = def->nfeatures_max = 0;
}
void ATTRIBUTE_NONNULL(1)
virCPUDefFreeModel(virCPUDefPtr def)
{
size_t i;
VIR_FREE(def->model);
VIR_FREE(def->vendor);
VIR_FREE(def->vendor_id);
for (i = 0; i < def->nfeatures; i++)
VIR_FREE(def->features[i].name);
VIR_FREE(def->features);
virCPUDefFreeFeatures(def);
}
void
......
......@@ -124,6 +124,9 @@ struct _virCPUDef {
};
void ATTRIBUTE_NONNULL(1)
virCPUDefFreeFeatures(virCPUDefPtr def);
void ATTRIBUTE_NONNULL(1)
virCPUDefFreeModel(virCPUDefPtr def);
......
......@@ -75,6 +75,7 @@ virCPUDefCopyWithoutModel;
virCPUDefFormat;
virCPUDefFormatBuf;
virCPUDefFree;
virCPUDefFreeFeatures;
virCPUDefFreeModel;
virCPUDefParseXML;
virCPUDefStealModel;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册