[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 19/37] virtio-blk: implement per-device migration cal
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 19/37] virtio-blk: implement per-device migration calls |
Date: |
Sun, 29 Jun 2014 19:59:11 +0300 |
From: Greg Kurz <address@hidden>
Signed-off-by: Greg Kurz <address@hidden>
Reviewed-by: Alexander Graf <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/block/virtio-blk.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 5e2693a..b06af8c 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -611,12 +611,16 @@ static void virtio_blk_set_status(VirtIODevice *vdev,
uint8_t status)
static void virtio_blk_save(QEMUFile *f, void *opaque)
{
- VirtIOBlock *s = opaque;
- VirtIODevice *vdev = VIRTIO_DEVICE(s);
- VirtIOBlockReq *req = s->rq;
+ VirtIODevice *vdev = VIRTIO_DEVICE(opaque);
virtio_save(vdev, f);
+}
+static void virtio_blk_save_device(VirtIODevice *vdev, QEMUFile *f)
+{
+ VirtIOBlock *s = VIRTIO_BLK(vdev);
+ VirtIOBlockReq *req = s->rq;
+
while (req) {
qemu_put_sbyte(f, 1);
qemu_put_buffer(f, (unsigned char *)req->elem,
@@ -630,15 +634,17 @@ static int virtio_blk_load(QEMUFile *f, void *opaque, int
version_id)
{
VirtIOBlock *s = opaque;
VirtIODevice *vdev = VIRTIO_DEVICE(s);
- int ret;
if (version_id != 2)
return -EINVAL;
- ret = virtio_load(vdev, f, version_id);
- if (ret) {
- return ret;
- }
+ return virtio_load(vdev, f, version_id);
+}
+
+static int virtio_blk_load_device(VirtIODevice *vdev, QEMUFile *f,
+ int version_id)
+{
+ VirtIOBlock *s = VIRTIO_BLK(vdev);
while (qemu_get_sbyte(f)) {
VirtIOBlockReq *req = virtio_blk_alloc_request(s);
@@ -799,6 +805,8 @@ static void virtio_blk_class_init(ObjectClass *klass, void
*data)
vdc->get_features = virtio_blk_get_features;
vdc->set_status = virtio_blk_set_status;
vdc->reset = virtio_blk_reset;
+ vdc->save = virtio_blk_save_device;
+ vdc->load = virtio_blk_load_device;
}
static const TypeInfo virtio_device_info = {
--
MST
- [Qemu-devel] [PULL 09/37] Allow mismatched virtio config-len, (continued)
- [Qemu-devel] [PULL 09/37] Allow mismatched virtio config-len, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 11/37] numa: Reject duplicate node IDs, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 10/37] numa: Keep track of NUMA nodes present on the command-line, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 12/37] numa: Reject configuration if not all node IDs are present, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 13/37] vhost-user: fix regions provied with VHOST_USER_SET_MEM_TABLE message, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 14/37] vhost-user: typo fixups, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 15/37] virtio-net: byteswap virtio-net header, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 17/37] virtio: introduce device specific migration calls, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 16/37] virtio-serial: don't migrate the config space, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 18/37] virtio-net: implement per-device migration calls, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 19/37] virtio-blk: implement per-device migration calls,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 20/37] virtio-serial: implement per-device migration calls, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 21/37] virtio-balloon: implement per-device migration calls, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 22/37] virtio-rng: implement per-device migration calls, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 23/37] virtio: add subsections to the migration stream, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 24/37] exec: introduce target_words_bigendian() helper, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 25/37] cpu: introduce CPUClass::virtio_is_big_endian(), Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 26/37] virtio: add endian-ambivalent support to VirtIODevice, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 27/37] virtio: memory accessors for endian-ambivalent targets, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 28/37] virtio: allow byte swapping for vring, Michael S. Tsirkin, 2014/06/29
- [Qemu-devel] [PULL 29/37] virtio-net: use virtio wrappers to access headers, Michael S. Tsirkin, 2014/06/29