提交 5705653f 编写于 作者: H Halil Pasic 提交者: Michael S. Tsirkin

virtio: cleanup VMSTATE_VIRTIO_DEVICE

Now all the usages of the old version of VMSTATE_VIRTIO_DEVICE are gone,
so we can get rid of the conditionals, and the old macro.
Signed-off-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 81cc8a65
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
* *
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "hw/virtio/virtio.h" #include "hw/virtio/virtio.h"
#include "qemu/sockets.h" #include "qemu/sockets.h"
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
* *
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h" #include "qapi/error.h"
#include "qemu-common.h" #include "qemu-common.h"
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
* GNU GPL, version 2 or (at your option) any later version. * GNU GPL, version 2 or (at your option) any later version.
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h" #include "qapi/error.h"
#include "qemu/iov.h" #include "qemu/iov.h"
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
* See the COPYING file in the top-level directory. * See the COPYING file in the top-level directory.
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qemu-common.h" #include "qemu-common.h"
#include "qemu/iov.h" #include "qemu/iov.h"
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
* top-level directory. * top-level directory.
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h" #include "qapi/error.h"
#include "qemu/iov.h" #include "qemu/iov.h"
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
* *
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qemu/iov.h" #include "qemu/iov.h"
#include "hw/virtio/virtio.h" #include "hw/virtio/virtio.h"
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
* *
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h" #include "qapi/error.h"
#include "standard-headers/linux/virtio_ids.h" #include "standard-headers/linux/virtio_ids.h"
......
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
* top-level directory. * top-level directory.
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "standard-headers/linux/virtio_vsock.h" #include "standard-headers/linux/virtio_vsock.h"
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
* *
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qemu/iov.h" #include "qemu/iov.h"
#include "qemu/timer.h" #include "qemu/timer.h"
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
* top-level directory. * top-level directory.
*/ */
#define VMSTATE_VIRTIO_DEVICE_USE_NEW
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/error.h" #include "qapi/error.h"
#include "qemu/iov.h" #include "qemu/iov.h"
......
...@@ -1639,12 +1639,6 @@ void virtio_save(VirtIODevice *vdev, QEMUFile *f) ...@@ -1639,12 +1639,6 @@ void virtio_save(VirtIODevice *vdev, QEMUFile *f)
vmstate_save_state(f, &vmstate_virtio, vdev, NULL); vmstate_save_state(f, &vmstate_virtio, vdev, NULL);
} }
/* A wrapper for use as a VMState .put function */
void virtio_vmstate_save(QEMUFile *f, void *opaque, size_t size)
{
virtio_save(VIRTIO_DEVICE(opaque), f);
}
/* A wrapper for use as a VMState .put function */ /* A wrapper for use as a VMState .put function */
static void virtio_device_put(QEMUFile *f, void *opaque, size_t size) static void virtio_device_put(QEMUFile *f, void *opaque, size_t size)
{ {
......
...@@ -177,12 +177,9 @@ bool virtio_should_notify(VirtIODevice *vdev, VirtQueue *vq); ...@@ -177,12 +177,9 @@ bool virtio_should_notify(VirtIODevice *vdev, VirtQueue *vq);
void virtio_notify(VirtIODevice *vdev, VirtQueue *vq); void virtio_notify(VirtIODevice *vdev, VirtQueue *vq);
void virtio_save(VirtIODevice *vdev, QEMUFile *f); void virtio_save(VirtIODevice *vdev, QEMUFile *f);
void virtio_vmstate_save(QEMUFile *f, void *opaque, size_t size);
extern const VMStateInfo virtio_vmstate_info; extern const VMStateInfo virtio_vmstate_info;
#ifdef VMSTATE_VIRTIO_DEVICE_USE_NEW
#define VMSTATE_VIRTIO_DEVICE \ #define VMSTATE_VIRTIO_DEVICE \
{ \ { \
.name = "virtio", \ .name = "virtio", \
...@@ -190,30 +187,6 @@ extern const VMStateInfo virtio_vmstate_info; ...@@ -190,30 +187,6 @@ extern const VMStateInfo virtio_vmstate_info;
.flags = VMS_SINGLE, \ .flags = VMS_SINGLE, \
} }
#else
/* TODO remove conditional as soon as all users are converted */
#define VMSTATE_VIRTIO_DEVICE(devname, v, getf, putf) \
static const VMStateDescription vmstate_virtio_ ## devname = { \
.name = "virtio-" #devname , \
.minimum_version_id = v, \
.version_id = v, \
.fields = (VMStateField[]) { \
{ \
.name = "virtio", \
.info = &(const VMStateInfo) {\
.name = "virtio", \
.get = getf, \
.put = putf, \
}, \
.flags = VMS_SINGLE, \
}, \
VMSTATE_END_OF_LIST() \
} \
}
#endif
int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id); int virtio_load(VirtIODevice *vdev, QEMUFile *f, int version_id);
void virtio_notify_config(VirtIODevice *vdev); void virtio_notify_config(VirtIODevice *vdev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册