From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, mst@redhat.com, amit.shah@redhat.com,
quintela@redhat.com
Cc: cornelia.huck@de.ibm.com, kraxel@redhat.com
Subject: [Qemu-devel] [PATCH v3 02/14] virtio-serial: Remove old migration version support
Date: Thu, 14 Jul 2016 18:22:44 +0100 [thread overview]
Message-ID: <1468516976-20140-3-git-send-email-dgilbert@redhat.com> (raw)
In-Reply-To: <1468516976-20140-1-git-send-email-dgilbert@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
virtio-serial-bus has had version 3 since 37f95bf3d0 in 0.13-rc0;
it's time to clean it up a bit.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
---
hw/char/virtio-serial-bus.c | 37 +++++++++++++++----------------------
1 file changed, 15 insertions(+), 22 deletions(-)
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index 6e5de6d..490b5ea 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -685,7 +685,7 @@ static void virtio_serial_post_load_timer_cb(void *opaque)
s->post_load = NULL;
}
-static int fetch_active_ports_list(QEMUFile *f, int version_id,
+static int fetch_active_ports_list(QEMUFile *f,
VirtIOSerial *s, uint32_t nr_active_ports)
{
uint32_t i;
@@ -702,6 +702,7 @@ static int fetch_active_ports_list(QEMUFile *f, int version_id,
/* Items in struct VirtIOSerialPort */
for (i = 0; i < nr_active_ports; i++) {
VirtIOSerialPort *port;
+ uint32_t elem_popped;
uint32_t id;
id = qemu_get_be32(f);
@@ -714,23 +715,19 @@ static int fetch_active_ports_list(QEMUFile *f, int version_id,
s->post_load->connected[i].port = port;
s->post_load->connected[i].host_connected = qemu_get_byte(f);
- if (version_id > 2) {
- uint32_t elem_popped;
-
- qemu_get_be32s(f, &elem_popped);
- if (elem_popped) {
- qemu_get_be32s(f, &port->iov_idx);
- qemu_get_be64s(f, &port->iov_offset);
+ qemu_get_be32s(f, &elem_popped);
+ if (elem_popped) {
+ qemu_get_be32s(f, &port->iov_idx);
+ qemu_get_be64s(f, &port->iov_offset);
- port->elem =
- qemu_get_virtqueue_element(f, sizeof(VirtQueueElement));
+ port->elem =
+ qemu_get_virtqueue_element(f, sizeof(VirtQueueElement));
- /*
- * Port was throttled on source machine. Let's
- * unthrottle it here so data starts flowing again.
- */
- virtio_serial_throttle_port(port, false);
- }
+ /*
+ * Port was throttled on source machine. Let's
+ * unthrottle it here so data starts flowing again.
+ */
+ virtio_serial_throttle_port(port, false);
}
}
timer_mod(s->post_load->timer, 1);
@@ -739,7 +736,7 @@ static int fetch_active_ports_list(QEMUFile *f, int version_id,
static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
{
- if (version_id > 3) {
+ if (version_id != 3) {
return -EINVAL;
}
@@ -756,10 +753,6 @@ static int virtio_serial_load_device(VirtIODevice *vdev, QEMUFile *f,
int ret;
uint32_t tmp;
- if (version_id < 2) {
- return 0;
- }
-
/* Unused */
qemu_get_be16s(f, (uint16_t *) &tmp);
qemu_get_be16s(f, (uint16_t *) &tmp);
@@ -781,7 +774,7 @@ static int virtio_serial_load_device(VirtIODevice *vdev, QEMUFile *f,
qemu_get_be32s(f, &nr_active_ports);
if (nr_active_ports) {
- ret = fetch_active_ports_list(f, version_id, s, nr_active_ports);
+ ret = fetch_active_ports_list(f, s, nr_active_ports);
if (ret) {
return ret;
}
--
2.7.4
next prev parent reply other threads:[~2016-07-14 17:23 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 17:22 [Qemu-devel] [PATCH v3 00/14] virtio migration: Flip outer layer to vmstate Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 01/14] virtio-net: Remove old migration version support Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` Dr. David Alan Gilbert (git) [this message]
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 03/14] virtio: Migration helper function and macro Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 04/14] virtio-scsi: Wrap in vmstate Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 05/14] virtio-blk: " Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 06/14] virtio-rng: " Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 07/14] virtio-balloon: " Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 08/14] virtio-net: " Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 09/14] virtio-serial: " Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 10/14] 9pfs: " Dr. David Alan Gilbert (git)
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 11/14] virtio-input: " Dr. David Alan Gilbert (git)
2016-07-15 9:56 ` Gerd Hoffmann
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 12/14] virtio-gpu: Use migrate_add_blocker for virgl migration blocking Dr. David Alan Gilbert (git)
2016-07-15 8:21 ` Cornelia Huck
2016-07-15 9:57 ` Gerd Hoffmann
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 13/14] virtio-gpu: Wrap in vmstate Dr. David Alan Gilbert (git)
2016-07-15 9:56 ` Gerd Hoffmann
2016-07-14 17:22 ` [Qemu-devel] [PATCH v3 14/14] virtio: Update migration docs Dr. David Alan Gilbert (git)
2016-07-15 8:23 ` [Qemu-devel] [PATCH v3 00/14] virtio migration: Flip outer layer to vmstate Cornelia Huck
2016-07-15 12:43 ` Amit Shah
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=1468516976-20140-3-git-send-email-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=amit.shah@redhat.com \
--cc=cornelia.huck@de.ibm.com \
--cc=kraxel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.