From: Alex Williamson <alex.williamson@hp.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm-devel <kvm@vger.kernel.org>, Mark McLoughlin <markmc@redhat.com>
Subject: Re: [PATCH] virtio-net: Fix save/load
Date: Wed, 06 May 2009 10:01:15 -0600 [thread overview]
Message-ID: <1241625675.26045.42.camel@lappy> (raw)
In-Reply-To: <4A013A75.9050405@redhat.com>
On Wed, 2009-05-06 at 10:21 +0300, Avi Kivity wrote:
> Alex Williamson wrote:
> > We can't rely on build switches to tell us if a save image
> > includes a given field. We also need to save status since
> > it's visible to the guest. Draw another line in the sand
> > for broken save versions. The version number should always
> > be updated when new values are saved and load should make
> > an attempt to set reasonable defaults for lower version save
> > images.
> >
>
> I applied the the first part of this ancient patch. Can't tell from the
> thread what the consensus is for the rest.
Thanks Avi, I think you got the important bits. I might recommend the
following change to keep this contained to a version_id 7 load and bail
if vnet header support is required, but not available. Thanks,
Alex
kvm: virtio-net: Cleanup load from vnet header saved image
Bail if the saved image requires vnet header support.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
---
hw/virtio-net.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 6dfe758..4beb16d 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -663,14 +663,15 @@ static int virtio_net_load(QEMUFile *f, void *opaque, int version_id)
if (version_id >= 6)
qemu_get_buffer(f, (uint8_t *)n->vlans, MAX_VLAN >> 3);
-#ifdef TAP_VNET_HDR
if (version_id == 7 && qemu_get_be32(f)) {
+#ifdef TAP_VNET_HDR
tap_using_vnet_hdr(n->vc->vlan->first_client, 1);
- }
#else
- /* FIXME: error out if nonzero? */
- qemu_get_be32(f);
+ fprintf(stderr,
+ "virtio-net: saved image requires vnet header support\n");
+ exit(1);
#endif
+ }
if (n->tx_timer_active) {
qemu_mod_timer(n->tx_timer,
next prev parent reply other threads:[~2009-05-06 16:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-15 18:05 [PATCH] virtio-net: Fix save/load Alex Williamson
2009-01-15 18:21 ` Mark McLoughlin
2009-01-15 18:39 ` Alex Williamson
2009-01-15 18:51 ` Mark McLoughlin
2009-05-06 7:21 ` Avi Kivity
2009-05-06 13:46 ` Anthony Liguori
2009-05-06 14:09 ` Avi Kivity
2009-05-06 16:01 ` Alex Williamson [this message]
2009-05-07 10:11 ` Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1241625675.26045.42.camel@lappy \
--to=alex.williamson@hp.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=markmc@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox