qapi: modify visitor code generation for list iteration

Modify logic such that we never assign values to the list head argument
to progress through the list on subsequent iterations, instead rely only
on having our return value passed back in as an argument on the next
call. Also update QMP I/O visitors and test cases accordingly, and add a
missing test case for QmpOutputVisitor.

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