[libvirt PATCH v2 13/20] cpu_arm: Implement virCPUDataNewCopy for arm

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/cpu/cpu_arm.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c
index c9114d53bf..51a3c1f3ee 100644
--- a/src/cpu/cpu_arm.c
+++ b/src/cpu/cpu_arm.c
@@ -150,6 +150,25 @@ virCPUarmDataIsIdentical(const virCPUData *a,
     return VIR_CPU_COMPARE_IDENTICAL;
 }
 
+static virCPUData *
+virCPUarmDataCopyNew(virCPUData *data)
+{
+    virCPUData *copy;
+    size_t i;
+
+    if (!data)
+        return NULL;
+
+    copy = virCPUDataNew(data->arch);
+    copy->data.arm.pvr = data->data.arm.pvr;
+    copy->data.arm.vendor_id = data->data.arm.vendor_id;
+    copy->data.arm.features = g_new0(char *, MAX_CPU_FLAGS + 1);
+    for (i = 0; i < MAX_CPU_FLAGS; ++i)
+        copy->data.arm.features[i] = g_strdup(data->data.arm.features[i]);
+
+    return copy;
+}
+
 static void
 virCPUarmDataFree(virCPUData *cpuData)
 {
@@ -696,6 +715,7 @@ struct cpuArchDriver cpuDriverArm = {
 #endif
     .decode = NULL,
     .encode = NULL,
+    .dataCopyNew = virCPUarmDataCopyNew,
     .dataFree = virCPUarmDataFree,
     .baseline = virCPUarmBaseline,
     .update = virCPUarmUpdate,
-- 
2.31.1




[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