On Wed, 8 Jul 2020 20:51:34 +0200 David Hildenbrand <da...@redhat.com> wrote:
> Add a proper CCW proxy device, similar to the PCI variant. > > Signed-off-by: David Hildenbrand <da...@redhat.com> > --- > hw/s390x/virtio-ccw-mem.c | 165 ++++++++++++++++++++++++++++++++++++++ > hw/s390x/virtio-ccw.h | 13 +++ > 2 files changed, 178 insertions(+) > create mode 100644 hw/s390x/virtio-ccw-mem.c (...) > +static void virtio_ccw_mem_instance_init(Object *obj) > +{ > + VirtIOMEMCcw *ccw_mem = VIRTIO_MEM_CCW(obj); > + VirtIOMEMClass *vmc; > + VirtIOMEM *vmem; > + I think you want ccw_dev->force_revision_1 = true; here (similar to forcing virtio-pci to modern-only.) > + virtio_instance_init_common(obj, &ccw_mem->vdev, sizeof(ccw_mem->vdev), > + TYPE_VIRTIO_MEM); > + > + ccw_mem->size_change_notifier.notify = virtio_ccw_mem_size_change_notify; > + vmem = VIRTIO_MEM(&ccw_mem->vdev); > + vmc = VIRTIO_MEM_GET_CLASS(vmem); > + /* > + * We never remove the notifier again, as we expect both devices to > + * disappear at the same time. > + */ > + vmc->add_size_change_notifier(vmem, &ccw_mem->size_change_notifier); > + > + object_property_add_alias(obj, VIRTIO_MEM_BLOCK_SIZE_PROP, > + OBJECT(&ccw_mem->vdev), > + VIRTIO_MEM_BLOCK_SIZE_PROP); > + object_property_add_alias(obj, VIRTIO_MEM_SIZE_PROP, > OBJECT(&ccw_mem->vdev), > + VIRTIO_MEM_SIZE_PROP); > + object_property_add_alias(obj, VIRTIO_MEM_REQUESTED_SIZE_PROP, > + OBJECT(&ccw_mem->vdev), > + VIRTIO_MEM_REQUESTED_SIZE_PROP); > +} (...) (have not looked at the rest yet)