memory: check address space when a listener is registered

This patch resolves a bug in memory listener registration.
"range_add" callback  was called on each section of the both
address space (IO and memory space) even if it doesn't match
the address space filter.

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