target/sparc: Make sparc_cpu_tlb_fill sysemu only
[qemu.git] / hw / s390x / vhost-user-fs-ccw.c
blob6c6f2692930110aebf8038061b259407238942bf
1 /*
2 * virtio ccw vhost-user-fs implementation
4 * Copyright 2020 IBM Corp.
6 * This work is licensed under the terms of the GNU GPL, version 2 or (at
7 * your option) any later version. See the COPYING file in the top-level
8 * directory.
9 */
10 #include "qemu/osdep.h"
11 #include "hw/qdev-properties.h"
12 #include "qapi/error.h"
13 #include "hw/virtio/vhost-user-fs.h"
14 #include "virtio-ccw.h"
16 typedef struct VHostUserFSCcw {
17 VirtioCcwDevice parent_obj;
18 VHostUserFS vdev;
19 } VHostUserFSCcw;
21 #define TYPE_VHOST_USER_FS_CCW "vhost-user-fs-ccw"
22 #define VHOST_USER_FS_CCW(obj) \
23 OBJECT_CHECK(VHostUserFSCcw, (obj), TYPE_VHOST_USER_FS_CCW)
26 static Property vhost_user_fs_ccw_properties[] = {
27 DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
28 VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
29 DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev,
30 VIRTIO_CCW_MAX_REV),
31 DEFINE_PROP_END_OF_LIST(),
34 static void vhost_user_fs_ccw_realize(VirtioCcwDevice *ccw_dev, Error **errp)
36 VHostUserFSCcw *dev = VHOST_USER_FS_CCW(ccw_dev);
37 DeviceState *vdev = DEVICE(&dev->vdev);
39 qdev_realize(vdev, BUS(&ccw_dev->bus), errp);
42 static void vhost_user_fs_ccw_instance_init(Object *obj)
44 VHostUserFSCcw *dev = VHOST_USER_FS_CCW(obj);
45 VirtioCcwDevice *ccw_dev = VIRTIO_CCW_DEVICE(obj);
47 ccw_dev->force_revision_1 = true;
48 virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
49 TYPE_VHOST_USER_FS);
52 static void vhost_user_fs_ccw_class_init(ObjectClass *klass, void *data)
54 DeviceClass *dc = DEVICE_CLASS(klass);
55 VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
57 k->realize = vhost_user_fs_ccw_realize;
58 device_class_set_props(dc, vhost_user_fs_ccw_properties);
59 set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
62 static const TypeInfo vhost_user_fs_ccw = {
63 .name = TYPE_VHOST_USER_FS_CCW,
64 .parent = TYPE_VIRTIO_CCW_DEVICE,
65 .instance_size = sizeof(VHostUserFSCcw),
66 .instance_init = vhost_user_fs_ccw_instance_init,
67 .class_init = vhost_user_fs_ccw_class_init,
70 static void vhost_user_fs_ccw_register(void)
72 type_register_static(&vhost_user_fs_ccw);
75 type_init(vhost_user_fs_ccw_register)