qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 02/12] virtio-blk: convert to VIRTIO_DEF_DEVICE_VMSD


From: Halil Pasic
Subject: [Qemu-devel] [PATCH 02/12] virtio-blk: convert to VIRTIO_DEF_DEVICE_VMSD
Date: Fri, 30 Sep 2016 16:19:53 +0200

Refactor so the previously introduced VIRTIO_DEF_DEVICE_VMSD
replaces VMSTATE_VIRTIO_DEVICE.

Signed-off-by: Halil Pasic <address@hidden>
---
 hw/block/virtio-blk.c | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 3a6112f..c6f2838 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -803,13 +803,6 @@ static void virtio_blk_set_status(VirtIODevice *vdev, 
uint8_t status)
     }
 }
 
-static void virtio_blk_save(QEMUFile *f, void *opaque, size_t size)
-{
-    VirtIODevice *vdev = VIRTIO_DEVICE(opaque);
-
-    virtio_save(vdev, f);
-}
-    
 static void virtio_blk_save_device(VirtIODevice *vdev, QEMUFile *f)
 {
     VirtIOBlock *s = VIRTIO_BLK(vdev);
@@ -828,14 +821,6 @@ static void virtio_blk_save_device(VirtIODevice *vdev, 
QEMUFile *f)
     qemu_put_sbyte(f, 0);
 }
 
-static int virtio_blk_load(QEMUFile *f, void *opaque, size_t size)
-{
-    VirtIOBlock *s = opaque;
-    VirtIODevice *vdev = VIRTIO_DEVICE(s);
-
-    return virtio_load(vdev, f, 2);
-}
-
 static int virtio_blk_load_device(VirtIODevice *vdev, QEMUFile *f,
                                   int version_id)
 {
@@ -956,7 +941,7 @@ static void virtio_blk_instance_init(Object *obj)
                                   DEVICE(obj), NULL);
 }
 
-VMSTATE_VIRTIO_DEVICE(blk, 2, virtio_blk_load, virtio_blk_save);
+VIRTIO_DEF_DEVICE_VMSD(blk, 2)
 
 static Property virtio_blk_properties[] = {
     DEFINE_BLOCK_PROPERTIES(VirtIOBlock, conf.conf),
-- 
2.8.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]