[PATCH v2 13/33] cpu: Introduce virCPUDataNew

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---

Notes:
    Version 2:
    - no change

 src/cpu/cpu.c            | 19 +++++++++++++++++++
 src/cpu/cpu.h            |  3 +++
 src/libvirt_private.syms |  1 +
 3 files changed, 23 insertions(+)

diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
index 64419eee3..3063f00eb 100644
--- a/src/cpu/cpu.c
+++ b/src/cpu/cpu.c
@@ -312,6 +312,25 @@ cpuEncode(virArch arch,
 
 
 /**
+ * virCPUDataNew:
+ *
+ * Returns an allocated memory for virCPUData or NULL on error.
+ */
+virCPUDataPtr
+virCPUDataNew(virArch arch)
+{
+    virCPUDataPtr data;
+
+    if (VIR_ALLOC(data) < 0)
+        return NULL;
+
+    data->arch = arch;
+
+    return data;
+}
+
+
+/**
  * cpuDataFree:
  *
  * @data: CPU data structure to be freed
diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h
index 69c17e72a..ceb1e7256 100644
--- a/src/cpu/cpu.h
+++ b/src/cpu/cpu.h
@@ -162,6 +162,9 @@ cpuEncode   (virArch arch,
              virCPUDataPtr *vendor)
     ATTRIBUTE_NONNULL(2);
 
+virCPUDataPtr
+virCPUDataNew(virArch arch);
+
 void
 cpuDataFree (virCPUDataPtr data);
 
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 6bbb36b4e..a2bcc6241 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -997,6 +997,7 @@ virCPUCompareXML;
 virCPUConvertLegacy;
 virCPUDataCheckFeature;
 virCPUDataFormat;
+virCPUDataNew;
 virCPUDataParse;
 virCPUGetModels;
 virCPUTranslate;
-- 
2.11.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux