[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 09/13] vfio/ccw: get irqs info and set the ev
From: |
Dong Jia Shi |
Subject: |
Re: [Qemu-devel] [PATCH v6 09/13] vfio/ccw: get irqs info and set the eventfd fd |
Date: |
Tue, 2 May 2017 14:49:41 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
* Dong Jia Shi <address@hidden> [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