aboutsummaryrefslogtreecommitdiff
path: root/hw/char/virtio-serial-bus.c
diff options
context:
space:
mode:
authorHalil Pasic <pasic@linux.vnet.ibm.com>2016-10-06 14:55:43 +0200
committerMichael S. Tsirkin <mst@redhat.com>2016-10-10 02:21:43 +0300
commit97eed24ff1144fb0718c2fdf600742b5167e87a3 (patch)
treedbaf628312509e69696ca8a055e1cff8365e7839 /hw/char/virtio-serial-bus.c
parentdcaf8dda4bc6046c5ecc2bff2076a9449192f937 (diff)
virtio-serial: 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/char/virtio-serial-bus.c')
-rw-r--r--hw/char/virtio-serial-bus.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
index 3955f0f741..c9b0fc8325 100644
--- a/hw/char/virtio-serial-bus.c
+++ b/hw/char/virtio-serial-bus.c
@@ -18,6 +18,8 @@
* GNU GPL, version 2 or (at your option) any later version.
*/
+#define VMSTATE_VIRTIO_DEVICE_USE_NEW
+
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/iov.h"
@@ -778,12 +780,6 @@ static int fetch_active_ports_list(QEMUFile *f,
return 0;
}
-static int virtio_serial_load(QEMUFile *f, void *opaque, size_t size)
-{
- /* The virtio device */
- return virtio_load(VIRTIO_DEVICE(opaque), f, 3);
-}
-
static int virtio_serial_load_device(VirtIODevice *vdev, QEMUFile *f,
int version_id)
{
@@ -1129,7 +1125,15 @@ static void virtio_serial_device_unrealize(DeviceState *dev, Error **errp)
}
/* Note: 'console' is used for backwards compatibility */
-VMSTATE_VIRTIO_DEVICE(console, 3, virtio_serial_load, virtio_vmstate_save);
+static const VMStateDescription vmstate_virtio_console = {
+ .name = "virtio-console",
+ .minimum_version_id = 3,
+ .version_id = 3,
+ .fields = (VMStateField[]) {
+ VMSTATE_VIRTIO_DEVICE,
+ VMSTATE_END_OF_LIST()
+ },
+};
static Property virtio_serial_properties[] = {
DEFINE_PROP_UINT32("max_ports", VirtIOSerial, serial.max_virtserial_ports,