From patchwork Wed Dec 2 12:04:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 40036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A6147B7BDB for ; Thu, 3 Dec 2009 01:10:25 +1100 (EST) Received: from localhost ([127.0.0.1]:34218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFpuQ-0003vP-QH for incoming@patchwork.ozlabs.org; Wed, 02 Dec 2009 09:10:22 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFnyD-0004a3-8T for qemu-devel@nongnu.org; Wed, 02 Dec 2009 07:06:09 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFny7-0004XM-Qr for qemu-devel@nongnu.org; Wed, 02 Dec 2009 07:06:08 -0500 Received: from [199.232.76.173] (port=42942 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFny7-0004XI-L0 for qemu-devel@nongnu.org; Wed, 02 Dec 2009 07:06:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34567) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFny7-0004Ev-7P for qemu-devel@nongnu.org; Wed, 02 Dec 2009 07:06:03 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB2C62ox018272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Dec 2009 07:06:02 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB2C5ILS029769; Wed, 2 Dec 2009 07:06:01 -0500 From: Juan Quintela To: qemu-devel@nongnu.org Date: Wed, 2 Dec 2009 13:04:28 +0100 Message-Id: <504bfa9bcd0d77c0858c72d3d93c63c4bc8163c5.1259754427.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: mst@redhat.com Subject: [Qemu-devel] [PATCH 30/41] virtio-net: use save/load type chek functions for has_vent_hdr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela --- hw/virtio-net.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 589ea80..c515e0e 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -718,7 +718,7 @@ static void virtio_net_save(QEMUFile *f, void *opaque) qemu_put_be32s(f, &n->mac_table.in_use); qemu_put_buffer(f, n->mac_table.macs, n->mac_table.in_use * ETH_ALEN); qemu_put_buffer(f, n->vlans, MAX_VLAN >> 3); - qemu_put_be32(f, n->has_vnet_hdr); + qemu_put_be32s(f, &n->has_vnet_hdr); qemu_put_8s(f, &n->mac_table.multi_overflow); qemu_put_8s(f, &n->mac_table.uni_overflow); qemu_put_8s(f, &n->alluni); @@ -765,7 +765,8 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id) qemu_get_buffer(f, n->vlans, MAX_VLAN >> 3); if (version_id >= 7) { - if (qemu_get_be32(f) && !peer_has_vnet_hdr(n)) { + qemu_get_be32s(f, &n->has_vnet_hdr); + if (n->has_vnet_hdr && !peer_has_vnet_hdr(n)) { qemu_error("virtio-net: saved image requires vnet_hdr=on\n"); return -1; }