[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 3/9] virtio: migrate vdev->broken flag
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH v4 3/9] virtio: migrate vdev->broken flag |
Date: |
Tue, 20 Sep 2016 15:49:32 +0100 |
Send a subsection if the vdev->broken flag is set. This allows live
migration of broken virtio devices.
The subsection is only sent if vdev->broken has been set. In most cases
the flag will be clear and no subsection will be sent.
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/virtio/virtio.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 448f789..a841640 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -1338,6 +1338,13 @@ static bool virtio_extra_state_needed(void *opaque)
k->has_extra_state(qbus->parent);
}
+static bool virtio_broken_needed(void *opaque)
+{
+ VirtIODevice *vdev = opaque;
+
+ return vdev->broken;
+}
+
static const VMStateDescription vmstate_virtqueue = {
.name = "virtqueue_state",
.version_id = 1,
@@ -1452,6 +1459,17 @@ static const VMStateDescription
vmstate_virtio_64bit_features = {
}
};
+static const VMStateDescription vmstate_virtio_broken = {
+ .name = "virtio/broken",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .needed = &virtio_broken_needed,
+ .fields = (VMStateField[]) {
+ VMSTATE_BOOL(broken, VirtIODevice),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static const VMStateDescription vmstate_virtio = {
.name = "virtio",
.version_id = 1,
@@ -1465,6 +1483,7 @@ static const VMStateDescription vmstate_virtio = {
&vmstate_virtio_64bit_features,
&vmstate_virtio_virtqueues,
&vmstate_virtio_ringsize,
+ &vmstate_virtio_broken,
&vmstate_virtio_extra_state,
NULL
}
--
2.7.4
- [Qemu-devel] [PATCH v4 0/9] virtio: avoid exit() when device enters invalid states, Stefan Hajnoczi, 2016/09/20
- [Qemu-devel] [PATCH v4 1/9] virtio: fix stray tab character, Stefan Hajnoczi, 2016/09/20
- [Qemu-devel] [PATCH v4 2/9] virtio: stop virtqueue processing if device is broken, Stefan Hajnoczi, 2016/09/20
- [Qemu-devel] [PATCH v4 3/9] virtio: migrate vdev->broken flag,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v4 4/9] virtio: handle virtqueue_map_desc() errors, Stefan Hajnoczi, 2016/09/20
- [Qemu-devel] [PATCH v4 6/9] virtio: use unsigned int for virtqueue_get_avail_bytes() index, Stefan Hajnoczi, 2016/09/20
- [Qemu-devel] [PATCH v4 7/9] virtio: handle virtqueue_read_next_desc() errors, Stefan Hajnoczi, 2016/09/20
- [Qemu-devel] [PATCH v4 5/9] virtio: handle virtqueue_get_avail_bytes() errors, Stefan Hajnoczi, 2016/09/20
- [Qemu-devel] [PATCH v4 8/9] virtio: handle virtqueue_num_heads() errors, Stefan Hajnoczi, 2016/09/20
- [Qemu-devel] [PATCH v4 9/9] virtio: handle virtqueue_get_head() errors, Stefan Hajnoczi, 2016/09/20
- Re: [Qemu-devel] [PATCH v4 0/9] virtio: avoid exit() when device enters invalid states, Cornelia Huck, 2016/09/21