iotests: ensure we print nbd server log on error
[qemu/ar7.git] / hw / s390x / vhost-vsock-ccw.c
blobcddc5cf6524c4f5083d014f8e749b119e75fb74d
1 /*
2 * vhost vsock ccw implementation
4 * This work is licensed under the terms of the GNU GPL, version 2 or (at
5 * your option) any later version. See the COPYING file in the top-level
6 * directory.
7 */
9 #include "qemu/osdep.h"
10 #include "hw/virtio/virtio.h"
11 #include "qapi/error.h"
12 #include "virtio-ccw.h"
14 static Property vhost_vsock_ccw_properties[] = {
15 DEFINE_PROP_UINT32("max_revision", VirtioCcwDevice, max_rev,
16 VIRTIO_CCW_MAX_REV),
17 DEFINE_PROP_END_OF_LIST(),
20 static void vhost_vsock_ccw_realize(VirtioCcwDevice *ccw_dev, Error **errp)
22 VHostVSockCCWState *dev = VHOST_VSOCK_CCW(ccw_dev);
23 DeviceState *vdev = DEVICE(&dev->vdev);
25 qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
26 object_property_set_bool(OBJECT(vdev), true, "realized", errp);
29 static void vhost_vsock_ccw_class_init(ObjectClass *klass, void *data)
31 DeviceClass *dc = DEVICE_CLASS(klass);
32 VirtIOCCWDeviceClass *k = VIRTIO_CCW_DEVICE_CLASS(klass);
34 k->realize = vhost_vsock_ccw_realize;
35 set_bit(DEVICE_CATEGORY_MISC, dc->categories);
36 dc->props = vhost_vsock_ccw_properties;
39 static void vhost_vsock_ccw_instance_init(Object *obj)
41 VHostVSockCCWState *dev = VHOST_VSOCK_CCW(obj);
43 virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev),
44 TYPE_VHOST_VSOCK);
47 static const TypeInfo vhost_vsock_ccw_info = {
48 .name = TYPE_VHOST_VSOCK_CCW,
49 .parent = TYPE_VIRTIO_CCW_DEVICE,
50 .instance_size = sizeof(VHostVSockCCWState),
51 .instance_init = vhost_vsock_ccw_instance_init,
52 .class_init = vhost_vsock_ccw_class_init,
55 static void vhost_vsock_ccw_register(void)
57 type_register_static(&vhost_vsock_ccw_info);
60 type_init(vhost_vsock_ccw_register)