> --- a/hw/input/virtio-input-hid.c > +++ b/hw/input/virtio-input-hid.c
> + .instance_finalize = virtio_input_finalize, > --- a/hw/input/virtio-input.c > +++ b/hw/input/virtio-input.c > +void virtio_input_finalize(Object *obj) > +{ > + VirtIOInput *vinput = VIRTIO_INPUT(obj); > + VirtIOInputConfig *cfg, *next; > + > + QTAILQ_FOREACH_SAFE(cfg, &vinput->cfg_list, node, next) { > + QTAILQ_REMOVE(&vinput->cfg_list, cfg, node); > + g_free(cfg); > + } > +} I think you can keep this local to virtio-input.c and simply hook it into the abstract base class (TYPE_VIRTIO_INPUT). Other than that it looks fine to me. cheers, Gerd