public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] device-assignment: Properly terminate vmsd.fields
@ 2011-01-17 17:17 Alex Williamson
  2011-01-19 15:40 ` Juan Quintela
  2011-01-20 16:08 ` Marcelo Tosatti
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Williamson @ 2011-01-17 17:17 UTC (permalink / raw)
  To: kvm; +Cc: alex.williamson, quintela, mst

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@redhat.com>
---

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)


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] device-assignment: Properly terminate vmsd.fields
  2011-01-17 17:17 [PATCH v2] device-assignment: Properly terminate vmsd.fields Alex Williamson
@ 2011-01-19 15:40 ` Juan Quintela
  2011-01-20 16:08 ` Marcelo Tosatti
  1 sibling, 0 replies; 3+ messages in thread
From: Juan Quintela @ 2011-01-19 15:40 UTC (permalink / raw)
  To: Alex Williamson; +Cc: kvm, mst

Alex Williamson <alex.williamson@redhat.com> wrote:
> 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@redhat.com>

Acked-by: Juan Quintela <quintela@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] device-assignment: Properly terminate vmsd.fields
  2011-01-17 17:17 [PATCH v2] device-assignment: Properly terminate vmsd.fields Alex Williamson
  2011-01-19 15:40 ` Juan Quintela
@ 2011-01-20 16:08 ` Marcelo Tosatti
  1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Tosatti @ 2011-01-20 16:08 UTC (permalink / raw)
  To: Alex Williamson; +Cc: kvm, quintela, mst

On Mon, Jan 17, 2011 at 10:17:49AM -0700, Alex Williamson wrote:
> 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@redhat.com>
> ---
> 
> 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(-)

Applied, thanks.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-20 22:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-17 17:17 [PATCH v2] device-assignment: Properly terminate vmsd.fields Alex Williamson
2011-01-19 15:40 ` Juan Quintela
2011-01-20 16:08 ` Marcelo Tosatti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox