qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] virtio-serial NULL deference
@ 2010-03-09 13:15 Juan Quintela
  2010-03-09 15:29 ` [Qemu-devel] " Amit Shah
  0 siblings, 1 reply; 3+ messages in thread
From: Juan Quintela @ 2010-03-09 13:15 UTC (permalink / raw)
  To: qemu-devel, amit.shah


Hi Amit

Checking migration, I just found this problem:

I don't know what to put there.  a return -EINVAL or continue?
Looking more at the code, I am not sure what checks:

a- that bus->max_nr_ports is the same in both sides (or at least bigger
   on migration destination)
b- We sent the value of config.nr_ports, but ... we assign it back on
   destination, instead of checking that they are the same.
c- port->id is taken from nr_ports again, and nothing checks that ports
   appear in the same order in source and destination.

Throughts?

Later, Juan.

diff --cc configure
index cab1941,83f8b26..0000000
--- a/configure
+++ b/configure
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index d0e0219..7d2f0b9 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -429,6 +429,10 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
         id = qemu_get_be32(f);
         port = find_port_by_id(s, id);

+        if (port == NULL) {
+            return -EINVAL;
+        }
+
         port->guest_connected = qemu_get_byte(f);
     }

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

end of thread, other threads:[~2010-03-17 12:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-09 13:15 [Qemu-devel] virtio-serial NULL deference Juan Quintela
2010-03-09 15:29 ` [Qemu-devel] " Amit Shah
2010-03-17 12:13   ` Amit Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).