From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKFhH-0003sH-9e for qemu-devel@nongnu.org; Tue, 06 Jan 2009 12:26:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKFhF-0003s4-RQ for qemu-devel@nongnu.org; Tue, 06 Jan 2009 12:26:31 -0500 Received: from [199.232.76.173] (port=42540 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKFhF-0003rz-Ke for qemu-devel@nongnu.org; Tue, 06 Jan 2009 12:26:29 -0500 Received: from mail-ew0-f32.google.com ([209.85.219.32]:51316) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKFhF-0007kU-9o for qemu-devel@nongnu.org; Tue, 06 Jan 2009 12:26:29 -0500 Received: by ewy13 with SMTP id 13so2649814ewy.10 for ; Tue, 06 Jan 2009 09:26:27 -0800 (PST) Message-ID: <4963943C.8060304@codemonkey.ws> Date: Tue, 06 Jan 2009 11:26:20 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1231242281-2597-1-git-send-email-markmc@redhat.com> In-Reply-To: <1231242281-2597-1-git-send-email-markmc@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] virtio-net migration fix Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark McLoughlin Cc: qemu-devel@nongnu.org Mark McLoughlin wrote: > We are failing to save whether the guest will supply us rx > buffers using the new mergeable format; this can cause a > migrated guest to crash with: > > virtio-net header not in first element > We should bump the version number so that we can gracefully fail migrations where the dest or source end is broken. I would make the virtio_net_load not accept version 1 saves too just to be on the safe side. Regards, Anthony Liguori > Signed-off-by: Mark McLoughlin > --- > hw/virtio-net.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/hw/virtio-net.c b/hw/virtio-net.c > index 1f45b2d..66d43d9 100644 > --- a/hw/virtio-net.c > +++ b/hw/virtio-net.c > @@ -275,6 +275,7 @@ static void virtio_net_save(QEMUFile *f, void *opaque) > > qemu_put_buffer(f, n->mac, 6); > qemu_put_be32(f, n->tx_timer_active); > + qemu_put_be32(f, n->mergeable_rx_bufs); > } > > static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) > @@ -288,6 +289,7 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) > > qemu_get_buffer(f, n->mac, 6); > n->tx_timer_active = qemu_get_be32(f); > + n->mergeable_rx_bufs = qemu_get_be32(f); > > if (n->tx_timer_active) { > qemu_mod_timer(n->tx_timer, >