mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 07:36:19 +00:00
conf: Introduce virCPUDefCopyWithoutModel
Useful for copying a CPU definition without model related parts (i.e., without model name, feature list, vendor). Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
b27adaed37
commit
bcf46ddb3f
@ -114,8 +114,9 @@ virCPUDefCopyModel(virCPUDefPtr dst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
virCPUDefPtr
|
||||
virCPUDefCopy(const virCPUDef *cpu)
|
||||
virCPUDefCopyWithoutModel(const virCPUDef *cpu)
|
||||
{
|
||||
virCPUDefPtr copy;
|
||||
|
||||
@ -131,6 +132,18 @@ virCPUDefCopy(const virCPUDef *cpu)
|
||||
copy->threads = cpu->threads;
|
||||
copy->arch = cpu->arch;
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
virCPUDefPtr
|
||||
virCPUDefCopy(const virCPUDef *cpu)
|
||||
{
|
||||
virCPUDefPtr copy;
|
||||
|
||||
if (!(copy = virCPUDefCopyWithoutModel(cpu)))
|
||||
return NULL;
|
||||
|
||||
if (virCPUDefCopyModel(copy, cpu, false) < 0)
|
||||
goto error;
|
||||
|
||||
@ -141,6 +154,7 @@ virCPUDefCopy(const virCPUDef *cpu)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
virCPUDefPtr
|
||||
virCPUDefParseXML(xmlNodePtr node,
|
||||
xmlXPathContextPtr ctxt,
|
||||
|
@ -126,6 +126,9 @@ virCPUDefCopyModel(virCPUDefPtr dst,
|
||||
virCPUDefPtr
|
||||
virCPUDefCopy(const virCPUDef *cpu);
|
||||
|
||||
virCPUDefPtr
|
||||
virCPUDefCopyWithoutModel(const virCPUDef *cpu);
|
||||
|
||||
virCPUDefPtr
|
||||
virCPUDefParseXML(xmlNodePtr node,
|
||||
xmlXPathContextPtr ctxt,
|
||||
|
@ -66,6 +66,7 @@ virCapabilitiesSetNetPrefix;
|
||||
virCPUDefAddFeature;
|
||||
virCPUDefCopy;
|
||||
virCPUDefCopyModel;
|
||||
virCPUDefCopyWithoutModel;
|
||||
virCPUDefFormat;
|
||||
virCPUDefFormatBuf;
|
||||
virCPUDefFree;
|
||||
|
Loading…
Reference in New Issue
Block a user