mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
xen: add event channel interface for XenDevice-s
The legacy PV backend infrastructure provides functions to bind, unbind and send notifications to event channnels. Similar functionality will be required by XenDevice implementations so this patch adds the necessary support. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Reviewed-by: Anthony Perard <anthony.perard@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Patch squashed with: Patch "xen: add event channel interface for XenDevice-s" makes use of the type xenevtchn_port_or_error_t, but this isn't avaiable before Xen 4.7. Also the function xen_device_bind_event_channel assign the return value of xenevtchn_bind_interdomain to channel->local_port but check the result for error with xendev->local_port. Fix by: - removing local_port from struct XenDevice as it isn't use anywere. - adding a compatibility typedef for xenevtchn_port_or_error_t for Xen 4.6 and earlier. As extra, replace the type of XenEventChannel->local_port by evtchn_port_t. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
This commit is contained in:
parent
4b34b5b140
commit
a3d669c8bd
3 changed files with 121 additions and 0 deletions
|
@ -26,6 +26,8 @@ typedef struct XenDevice {
|
|||
XenWatch *frontend_state_watch;
|
||||
xengnttab_handle *xgth;
|
||||
bool feature_grant_copy;
|
||||
xenevtchn_handle *xeh;
|
||||
NotifierList event_notifiers;
|
||||
} XenDevice;
|
||||
|
||||
typedef char *(*XenDeviceGetName)(XenDevice *xendev, Error **errp);
|
||||
|
@ -104,4 +106,19 @@ void xen_device_copy_grant_refs(XenDevice *xendev, bool to_domain,
|
|||
XenDeviceGrantCopySegment segs[],
|
||||
unsigned int nr_segs, Error **errp);
|
||||
|
||||
typedef struct XenEventChannel XenEventChannel;
|
||||
|
||||
typedef void (*XenEventHandler)(void *opaque);
|
||||
|
||||
XenEventChannel *xen_device_bind_event_channel(XenDevice *xendev,
|
||||
unsigned int port,
|
||||
XenEventHandler handler,
|
||||
void *opaque, Error **errp);
|
||||
void xen_device_notify_event_channel(XenDevice *xendev,
|
||||
XenEventChannel *channel,
|
||||
Error **errp);
|
||||
void xen_device_unbind_event_channel(XenDevice *xendev,
|
||||
XenEventChannel *channel,
|
||||
Error **errp);
|
||||
|
||||
#endif /* HW_XEN_BUS_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue