diff options
author | Halil Pasic <pasic@linux.vnet.ibm.com> | 2016-10-06 14:55:47 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2016-10-10 02:21:43 +0300 |
commit | c5dc16b726e0279330233c0eb09fd1c708af978f (patch) | |
tree | 37d8b17819fa02f6f03f6f7693788e6d0e422b6c /hw | |
parent | f20476b9e444e11792d49438fe5ec53ac1470f33 (diff) | |
download | qemu-c5dc16b726e0279330233c0eb09fd1c708af978f.zip qemu-c5dc16b726e0279330233c0eb09fd1c708af978f.tar.gz qemu-c5dc16b726e0279330233c0eb09fd1c708af978f.tar.bz2 |
virtio-balloon: convert VMSTATE_VIRTIO_DEVICE
Use the new VMSTATE_VIRTIO_DEVICE macro.
Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/virtio/virtio-balloon.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index eb572e6..2c68d3d 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -13,6 +13,8 @@ * */ +#define VMSTATE_VIRTIO_DEVICE_USE_NEW + #include "qemu/osdep.h" #include "qemu/iov.h" #include "qemu/timer.h" @@ -402,11 +404,6 @@ static void virtio_balloon_save_device(VirtIODevice *vdev, QEMUFile *f) qemu_put_be32(f, s->actual); } -static int virtio_balloon_load(QEMUFile *f, void *opaque, size_t size) -{ - return virtio_load(VIRTIO_DEVICE(opaque), f, 1); -} - static int virtio_balloon_load_device(VirtIODevice *vdev, QEMUFile *f, int version_id) { @@ -492,7 +489,15 @@ static void virtio_balloon_instance_init(Object *obj) NULL, s, NULL); } -VMSTATE_VIRTIO_DEVICE(balloon, 1, virtio_balloon_load, virtio_vmstate_save); +static const VMStateDescription vmstate_virtio_balloon = { + .name = "virtio-balloon", + .minimum_version_id = 1, + .version_id = 1, + .fields = (VMStateField[]) { + VMSTATE_VIRTIO_DEVICE, + VMSTATE_END_OF_LIST() + }, +}; static Property virtio_balloon_properties[] = { DEFINE_PROP_BIT("deflate-on-oom", VirtIOBalloon, host_features, |