]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Copy missing QEMU caps elements
authorJiri Denemark <jdenemar@redhat.com>
Thu, 4 Aug 2016 14:48:40 +0000 (16:48 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 5 Aug 2016 08:06:01 +0000 (10:06 +0200)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_capabilities.c

index 3361a40fe2361aa19b69660dfa02c4dd0769564e..6c80d59613cdd673d6519d59d87ff2fe298a5d42 100644 (file)
@@ -354,6 +354,8 @@ struct virQEMUCapsMachineType {
  * correctly. It does not have to be ABI-stable, as
  * the cache will be discarded & repopulated if the
  * timestamp on the libvirtd binary changes.
+ *
+ * And don't forget to update virQEMUCapsNewCopy.
  */
 struct _virQEMUCaps {
     virObject object;
@@ -2016,6 +2018,11 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps)
 
     ret->usedQMP = qemuCaps->usedQMP;
 
+    if (VIR_STRDUP(ret->binary, qemuCaps->binary) < 0)
+        goto error;
+
+    ret->ctime = qemuCaps->ctime;
+
     virBitmapCopy(ret->flags, qemuCaps->flags);
 
     ret->version = qemuCaps->version;
@@ -2044,6 +2051,12 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps)
         ret->machineTypes[i].maxCpus = qemuCaps->machineTypes[i].maxCpus;
     }
 
+    if (VIR_ALLOC_N(ret->gicCapabilities, qemuCaps->ngicCapabilities) < 0)
+        goto error;
+    ret->ngicCapabilities = qemuCaps->ngicCapabilities;
+    for (i = 0; i < qemuCaps->ngicCapabilities; i++)
+        ret->gicCapabilities[i] = qemuCaps->gicCapabilities[i];
+
     return ret;
 
  error: