]> xenbits.xensource.com Git - libvirt.git/commitdiff
cpu: Introduce virCPUDataNew
authorJiri Denemark <jdenemar@redhat.com>
Thu, 2 Feb 2017 11:09:52 +0000 (12:09 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 22 Feb 2017 11:09:00 +0000 (12:09 +0100)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/cpu/cpu.c
src/cpu/cpu.h
src/libvirt_private.syms

index 64419eee3c48311f7b535e9b84edf36ee0e8691c..3063f00eb6d7a55297208e2b66b5a0771c76157b 100644 (file)
@@ -311,6 +311,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:
  *
index 69c17e72a3441ecbd8aa237c2f1ec6d27687b48a..ceb1e7256066c0a8f3b568ac979e48a3f7516bbf 100644 (file)
@@ -162,6 +162,9 @@ cpuEncode   (virArch arch,
              virCPUDataPtr *vendor)
     ATTRIBUTE_NONNULL(2);
 
+virCPUDataPtr
+virCPUDataNew(virArch arch);
+
 void
 cpuDataFree (virCPUDataPtr data);
 
index e6ccd697d2074a3baf9594ce848c6fd3527b1959..07a35333b144626d2c1bebff4cf92fab103bbcc5 100644 (file)
@@ -994,6 +994,7 @@ virCPUCompareXML;
 virCPUConvertLegacy;
 virCPUDataCheckFeature;
 virCPUDataFormat;
+virCPUDataNew;
 virCPUDataParse;
 virCPUGetModels;
 virCPUTranslate;