Fix some issues with QEMUFile

This patch allows QEMUFile's read and write operations to return 
negative error codes.  This is necessary to detect things like closed 
streams during live migration.

It also removes unused code for QEMUFileFD write path.  Finally, it 
makes sure to avoid attempting to flush an output buffer if the file
is only being used for input.  This was spotted by Uri Lublin.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5474 c046a42c-6fe2-441c-8c8c-71466251a162
2 files changed
tree: e7f554ea48fd462199e312911d391061e2762fdb
  1. audio/
  2. darwin-user/
  3. fpu/
  4. gdb-xml/
  5. hw/
  6. keymaps/
  7. linux-user/
  8. pc-bios/
  9. slirp/
  10. target-alpha/
  11. target-arm/
  12. target-cris/
  13. target-i386/
  14. target-m68k/
  15. target-mips/
  16. target-ppc/
  17. target-sh4/
  18. target-sparc/
  19. tcg/
  20. tests/
  21. .gitignore
  22. a.out.h
  23. aes.c
  24. aes.h
  25. aio.c
  26. alpha-dis.c
  27. alpha.ld
  28. arm-dis.c
  29. arm-semi.c
  30. arm.ld
  31. block-bochs.c
  32. block-cloop.c
  33. block-cow.c
  34. block-dmg.c
  35. block-nbd.c
  36. block-parallels.c
  37. block-qcow.c
  38. block-qcow2.c
  39. block-raw-posix.c
  40. block-raw-win32.c
  41. block-vmdk.c
  42. block-vpc.c
  43. block-vvfat.c
  44. block.c
  45. block.h
  46. block_int.h
  47. bswap.h
  48. bt-host.c
  49. bt-vhci.c
  50. Changelog
  51. check_ops.sh
  52. cocoa.m
  53. configure
  54. console.c
  55. console.h
  56. COPYING
  57. COPYING.LIB
  58. cpu-all.h
  59. cpu-defs.h
  60. cpu-exec.c
  61. cris-dis.c
  62. curses.c
  63. curses_keys.h
  64. cutils.c
  65. d3des.c
  66. d3des.h
  67. dis-asm.h
  68. disas.c
  69. disas.h
  70. dyngen-exec.h
  71. dyngen.c
  72. elf.h
  73. elf_ops.h
  74. exec-all.h
  75. exec.c
  76. feature_to_c.sh
  77. gdbstub.c
  78. gdbstub.h
  79. gen-icount.h
  80. host-utils.c
  81. host-utils.h
  82. hostregs_helper.h
  83. hpet.h
  84. hppa-dis.c
  85. hppa.ld
  86. i386-dis.c
  87. i386.ld
  88. ia64.ld
  89. keymaps.c
  90. kqemu.c
  91. kqemu.h
  92. LICENSE
  93. loader.c
  94. m68k-dis.c
  95. m68k-semi.c
  96. m68k.ld
  97. MAINTAINERS
  98. Makefile
  99. Makefile.target
  100. mips-dis.c
  101. mips.ld
  102. mipsel.ld
  103. monitor.c
  104. nbd.c
  105. nbd.h
  106. net-checksum.c
  107. net.h
  108. osdep.c
  109. osdep.h
  110. ppc-dis.c
  111. ppc.ld
  112. ppc64.ld
  113. qemu-aio.h
  114. qemu-binfmt-conf.sh
  115. qemu-char.h
  116. qemu-common.h
  117. qemu-doc.texi
  118. qemu-img.c
  119. qemu-img.texi
  120. qemu-lock.h
  121. qemu-log.h
  122. qemu-malloc.c
  123. qemu-nbd.c
  124. qemu-nbd.texi
  125. qemu-tech.texi
  126. qemu-timer.h
  127. qemu-tool.c
  128. qemu_socket.h
  129. readline.c
  130. README
  131. s390-dis.c
  132. s390.ld
  133. sdl.c
  134. sdl_keysym.h
  135. sh4-dis.c
  136. softmmu-semi.h
  137. softmmu_defs.h
  138. softmmu_exec.h
  139. softmmu_header.h
  140. softmmu_template.h
  141. sparc-dis.c
  142. sparc.ld
  143. sparc64.ld
  144. sys-queue.h
  145. sysemu.h
  146. tap-win32.c
  147. texi2pod.pl
  148. thunk.c
  149. thunk.h
  150. TODO
  151. translate-all.c
  152. uboot_image.h
  153. usb-linux.c
  154. VERSION
  155. vgafont.h
  156. vl.c
  157. vnc.c
  158. vnc_keysym.h
  159. vnchextile.h
  160. x86_64.ld
  161. x_keymap.c