event_notifier: enable it to use pipes

This takes the eventfd emulation code from the main loop.  When the
EventNotifier is used for the main loop too, we need this compatibility
code.

Without CONFIG_EVENTFD, event_notifier_get_fd is only usable for the
"read" side of the notifier, for example to set a select() handler.

The return value of event_notifier_set changes to the cleaner 0/-errno.
No caller is actually checking the return value.

Reviewed-by: Anthony Liguori <anthony@codemonkey.ws>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 files changed
tree: e062dcd177512bc99491396c207a5eea3ac7326c
  1. audio/
  2. block/
  3. bsd-user/
  4. default-configs/
  5. docs/
  6. fpu/
  7. fsdev/
  8. gdb-xml/
  9. hw/
  10. include/
  11. libcacard/
  12. linux-headers/
  13. linux-user/
  14. net/
  15. pc-bios/
  16. qapi/
  17. qga/
  18. QMP/
  19. qom/
  20. roms/
  21. scripts/
  22. slirp/
  23. sysconfigs/
  24. target-alpha/
  25. target-arm/
  26. target-cris/
  27. target-i386/
  28. target-lm32/
  29. target-m68k/
  30. target-microblaze/
  31. target-mips/
  32. target-openrisc/
  33. target-ppc/
  34. target-s390x/
  35. target-sh4/
  36. target-sparc/
  37. target-unicore32/
  38. target-xtensa/
  39. tcg/
  40. tests/
  41. trace/
  42. ui/
  43. .exrc
  44. .gitignore
  45. .gitmodules
  46. .mailmap
  47. a.out.h
  48. acl.c
  49. acl.h
  50. aes.c
  51. aes.h
  52. aio.c
  53. alpha-dis.c
  54. alpha.ld
  55. arch_init.c
  56. arch_init.h
  57. arm-dis.c
  58. arm.ld
  59. async.c
  60. balloon.c
  61. balloon.h
  62. bitmap.c
  63. bitmap.h
  64. bitops.c
  65. bitops.h
  66. block-migration.c
  67. block-migration.h
  68. block.c
  69. block.h
  70. block_int.h
  71. blockdev-nbd.c
  72. blockdev.c
  73. blockdev.h
  74. blockjob.c
  75. blockjob.h
  76. bswap.h
  77. bt-host.c
  78. bt-host.h
  79. bt-vhci.c
  80. buffered_file.c
  81. buffered_file.h
  82. cache-utils.c
  83. cache-utils.h
  84. Changelog
  85. cmd.c
  86. cmd.h
  87. CODING_STYLE
  88. compatfd.c
  89. compatfd.h
  90. compiler.h
  91. config.h
  92. configure
  93. console.c
  94. console.h
  95. COPYING
  96. COPYING.LIB
  97. coroutine-gthread.c
  98. coroutine-sigaltstack.c
  99. coroutine-ucontext.c
  100. coroutine-win32.c
  101. cpu-all.h
  102. cpu-common.h
  103. cpu-defs.h
  104. cpu-exec.c
  105. cpus.c
  106. cpus.h
  107. cputlb.c
  108. cputlb.h
  109. cris-dis.c
  110. cursor.c
  111. cursor_hidden.xpm
  112. cursor_left_ptr.xpm
  113. cutils.c
  114. def-helper.h
  115. device_tree.c
  116. device_tree.h
  117. dis-asm.h
  118. disas.c
  119. disas.h
  120. dma-helpers.c
  121. dma.h
  122. dump-stub.c
  123. dump.c
  124. dump.h
  125. elf.h
  126. envlist.c
  127. envlist.h
  128. error.c
  129. error.h
  130. event_notifier-posix.c
  131. event_notifier-win32.c
  132. event_notifier.h
  133. exec-all.h
  134. exec-memory.h
  135. exec.c
  136. gdbstub.c
  137. gdbstub.h
  138. gen-icount.h
  139. HACKING
  140. hmp-commands.hx
  141. hmp.c
  142. hmp.h
  143. host-utils.c
  144. host-utils.h
  145. hppa-dis.c
  146. hppa.ld
  147. hwaddr.h
  148. i386-dis.c
  149. i386.ld
  150. ia64-dis.c
  151. ia64.ld
  152. input.c
  153. int128.h
  154. iohandler.c
  155. ioport.c
  156. ioport.h
  157. iorange.h
  158. iov.c
  159. iov.h
  160. json-lexer.c
  161. json-lexer.h
  162. json-parser.c
  163. json-parser.h
  164. json-streamer.c
  165. json-streamer.h
  166. kvm-all.c
  167. kvm-stub.c
  168. kvm.h
  169. libfdt_env.h
  170. LICENSE
  171. linux-aio.c
  172. lm32-dis.c
  173. m68k-dis.c
  174. m68k.ld
  175. main-loop.c
  176. main-loop.h
  177. MAINTAINERS
  178. Makefile
  179. Makefile.dis
  180. Makefile.objs
  181. Makefile.target
  182. Makefile.user
  183. memory-internal.h
  184. memory.c
  185. memory.h
  186. memory_mapping-stub.c
  187. memory_mapping.c
  188. memory_mapping.h
  189. microblaze-dis.c
  190. migration-exec.c
  191. migration-fd.c
  192. migration-tcp.c
  193. migration-unix.c
  194. migration.c
  195. migration.h
  196. mips-dis.c
  197. mips.ld
  198. module.c
  199. module.h
  200. monitor.c
  201. monitor.h
  202. nbd.c
  203. nbd.h
  204. net.c
  205. net.h
  206. notify.c
  207. notify.h
  208. os-posix.c
  209. os-win32.c
  210. osdep.c
  211. osdep.h
  212. oslib-posix.c
  213. oslib-win32.c
  214. page_cache.c
  215. path.c
  216. pci-ids.txt
  217. pflib.c
  218. pflib.h
  219. poison.h
  220. posix-aio-compat.c
  221. ppc-dis.c
  222. ppc.ld
  223. ppc64.ld
  224. qapi-schema-guest.json
  225. qapi-schema-test.json
  226. qapi-schema.json
  227. qbool.c
  228. qbool.h
  229. qdict-test-data.txt
  230. qdict.c
  231. qdict.h
  232. qemu-aio.h
  233. qemu-barrier.h
  234. qemu-bridge-helper.c
  235. qemu-char.c
  236. qemu-char.h
  237. qemu-common.h
  238. qemu-config.c
  239. qemu-config.h
  240. qemu-coroutine-int.h
  241. qemu-coroutine-io.c
  242. qemu-coroutine-lock.c
  243. qemu-coroutine-sleep.c
  244. qemu-coroutine.c
  245. qemu-coroutine.h
  246. qemu-doc.texi
  247. qemu-error.c
  248. qemu-error.h
  249. qemu-file.h
  250. qemu-ga.c
  251. qemu-img-cmds.hx
  252. qemu-img.c
  253. qemu-img.texi
  254. qemu-io.c
  255. qemu-lock.h
  256. qemu-log.c
  257. qemu-log.h
  258. qemu-nbd.c
  259. qemu-nbd.texi
  260. qemu-objects.h
  261. qemu-option-internal.h
  262. qemu-option.c
  263. qemu-option.h
  264. qemu-options-wrapper.h
  265. qemu-options.h
  266. qemu-options.hx
  267. qemu-os-posix.h
  268. qemu-os-win32.h
  269. qemu-progress.c
  270. qemu-queue.h
  271. qemu-seccomp.c
  272. qemu-seccomp.h
  273. qemu-sockets.c
  274. qemu-tech.texi
  275. qemu-thread-posix.c
  276. qemu-thread-posix.h
  277. qemu-thread-win32.c
  278. qemu-thread-win32.h
  279. qemu-thread.h
  280. qemu-timer-common.c
  281. qemu-timer.c
  282. qemu-timer.h
  283. qemu-tls.h
  284. qemu-tool.c
  285. qemu-user.c
  286. qemu-x509.h
  287. qemu-xattr.h
  288. qemu.sasl
  289. qemu_socket.h
  290. qerror.c
  291. qerror.h
  292. qfloat.c
  293. qfloat.h
  294. qint.c
  295. qint.h
  296. qjson.c
  297. qjson.h
  298. qlist.c
  299. qlist.h
  300. qmp-commands.hx
  301. qmp.c
  302. qobject.h
  303. qstring.c
  304. qstring.h
  305. qtest.c
  306. qtest.h
  307. range.h
  308. readline.c
  309. readline.h
  310. README
  311. rules.mak
  312. s390-dis.c
  313. s390.ld
  314. savevm.c
  315. sh4-dis.c
  316. softmmu-semi.h
  317. softmmu_defs.h
  318. softmmu_exec.h
  319. softmmu_header.h
  320. softmmu_template.h
  321. sparc-dis.c
  322. sparc.ld
  323. sparc64.ld
  324. spice-qemu-char.c
  325. sysemu.h
  326. tcg-runtime.c
  327. tci-dis.c
  328. tci.c
  329. thunk.c
  330. thunk.h
  331. TODO
  332. trace-events
  333. translate-all.c
  334. uboot_image.h
  335. uri.c
  336. uri.h
  337. user-exec.c
  338. VERSION
  339. version.rc
  340. vgafont.h
  341. vl.c
  342. vmstate.h
  343. x86_64.ld
  344. xen-all.c
  345. xen-mapcache.c
  346. xen-mapcache.h
  347. xen-stub.c