* Dong Jia Shi <bjsdj...@linux.vnet.ibm.com> [2017-05-02 13:37:38 +0800]:

[...]
> > > +static void vfio_ccw_unregister_io_notifier(VFIOCCWDevice *vcdev)
> > > +{
> > > +    struct vfio_irq_set *irq_set;
> > > +    size_t argsz;
> > > +    int32_t *pfd;
> > > +
> > > +    argsz = sizeof(*irq_set) + sizeof(*pfd);
> > > +    irq_set = g_malloc0(argsz);
> > > +    irq_set->argsz = argsz;
> > > +    irq_set->flags = VFIO_IRQ_SET_DATA_EVENTFD |
> > > +                     VFIO_IRQ_SET_ACTION_TRIGGER;
> > > +    irq_set->index = VFIO_CCW_IO_IRQ_INDEX;
> > > +    irq_set->start = 0;
> > > +    irq_set->count = 1;
> > > +    pfd = (int32_t *) &irq_set->data;
> > > +    *pfd = -1;
> > > +
> > > +    if (ioctl(vcdev->vdev.fd, VFIO_DEVICE_SET_IRQS, irq_set)) {
> > > +        error_report("vfio: Failed to de-assign device io fd");
> > ditto
> 
> error_report("vfio: Failed to de-assign device io fd: %s",
>              strerror(drrno));
> 
Or:
error_report("vfio: Failed to de-assign device io fd: %m");

> > > +    }
> > > +
> > > +    qemu_set_fd_handler(event_notifier_get_fd(&vcdev->io_notifier),
> > > +                        NULL, NULL, vcdev);
> > > +    event_notifier_cleanup(&vcdev->io_notifier);
> > > +
> > > +    g_free(irq_set);
> > > +}
> > > +
> > >  static void vfio_ccw_get_region(VFIOCCWDevice *vcdev, Error **errp)
> > >  {
> > >      VFIODevice *vdev = &vcdev->vdev;
[...]

-- 
Dong Jia Shi


Reply via email to