[PATCH v2] device-assignment: Properly terminate vmsd.fields

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

 



The vmsd code expects the fields structure to be properly terminated,
not NULL.  An assigned device should never be saved or restored, and
recent qemu fixes to the no_migrate flag should ensure this, but let's
avoid setting the wrong precedent.

Signed-off-by: Alex Williamson <alex.williamson@xxxxxxxxxx>
---

v2:
 - Change to commit log only, was "device-assignment: Add fields to
   VMStateDescription".  Recent qemu.git no_migrate changes avoid
   potential segfault, but this should still be applied for correctness.

 hw/device-assignment.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index e97f565..0925fa8 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1697,7 +1697,10 @@ static void assigned_dev_unregister_msix_mmio(AssignedDevice *dev)
 }
 
 static const VMStateDescription vmstate_assigned_device = {
-    .name = "pci-assign"
+    .name = "pci-assign",
+    .fields = (VMStateField []) {
+        VMSTATE_END_OF_LIST()
+    }
 };
 
 static void reset_assigned_device(DeviceState *dev)

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux