本文整理汇总了C++中VirtioBusClass::ioeventfd_set_disabled方法的典型用法代码示例。如果您正苦于以下问题:C++ VirtioBusClass::ioeventfd_set_disabled方法的具体用法?C++ VirtioBusClass::ioeventfd_set_disabled怎么用?C++ VirtioBusClass::ioeventfd_set_disabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VirtioBusClass
的用法示例。
在下文中一共展示了VirtioBusClass::ioeventfd_set_disabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: virtio_bus_set_host_notifier
/*
* This function switches from/to the generic ioeventfd handler.
* assign==false means 'use generic ioeventfd handler'.
*/
int virtio_bus_set_host_notifier(VirtioBusState *bus, int n, bool assign)
{
VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(bus);
DeviceState *proxy = DEVICE(BUS(bus)->parent);
if (!k->ioeventfd_started) {
return -ENOSYS;
}
k->ioeventfd_set_disabled(proxy, assign);
if (assign) {
/*
* Stop using the generic ioeventfd, we are doing eventfd handling
* ourselves below
*
* FIXME: We should just switch the handler and not deassign the
* ioeventfd.
* Otherwise, there's a window where we don't have an
* ioeventfd and we may end up with a notification where
* we don't expect one.
*/
virtio_bus_stop_ioeventfd(bus);
}
return set_host_notifier_internal(proxy, bus, n, assign, false);
}