pc: Set hw_version on all machine classes

In 2012, QEMU had a bug where it exposed QEMU version information to the
guest, meaning a QEMU upgrade would expose different hardware to the
guest OS even if the same machine-type is being used.

The bug was fixed by commit 93bfef4c6e4b23caea9d51e1099d06433d8835a4, on
all machines up to pc-1.0. But we kept introducing the same bug on all
newer machines since then. That means we are breaking guest ABI every
time QEMU was upgraded.

Fix this by setting the hw_version on all PC machines, making sure the
hardware won't change when upgrading QEMU.

Note that QEMU_VERSION was "1.0" in QEMU 1.0, but starting on QEMU
1.1.0, it started following the "x.y.0" pattern. We have to follow it,
to make sure we use the right QEMU_VERSION string from each QEMU
release.

The 2.5 machine classes could have hw_version unset, because the default
value for qemu_get_version() is QEMU_VERSION. But I decided to set it
explicitly to QEMU_VERSION so we don't forget to update it to "2.5.0"
after we release 2.5.0 and create a 2.6 machine class.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <1446233769-7892-2-git-send-email-ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 files changed
tree: 623745876ce8c9231fe02adda638c76947530be2
  1. audio/
  2. backends/
  3. block/
  4. bsd-user/
  5. contrib/
  6. crypto/
  7. default-configs/
  8. disas/
  9. docs/
  10. fpu/
  11. fsdev/
  12. gdb-xml/
  13. hw/
  14. include/
  15. libdecnumber/
  16. linux-headers/
  17. linux-user/
  18. migration/
  19. net/
  20. pc-bios/
  21. po/
  22. qapi/
  23. qga/
  24. qobject/
  25. qom/
  26. roms/
  27. scripts/
  28. slirp/
  29. stubs/
  30. target-alpha/
  31. target-arm/
  32. target-cris/
  33. target-i386/
  34. target-lm32/
  35. target-m68k/
  36. target-microblaze/
  37. target-mips/
  38. target-moxie/
  39. target-openrisc/
  40. target-ppc/
  41. target-s390x/
  42. target-sh4/
  43. target-sparc/
  44. target-tilegx/
  45. target-tricore/
  46. target-unicore32/
  47. target-xtensa/
  48. tcg/
  49. tests/
  50. trace/
  51. ui/
  52. util/
  53. .dir-locals.el
  54. .exrc
  55. .gitignore
  56. .gitmodules
  57. .mailmap
  58. .travis.yml
  59. accel.c
  60. aio-posix.c
  61. aio-win32.c
  62. arch_init.c
  63. async.c
  64. balloon.c
  65. block.c
  66. blockdev-nbd.c
  67. blockdev.c
  68. blockjob.c
  69. bootdevice.c
  70. bt-host.c
  71. bt-vhci.c
  72. Changelog
  73. CODING_STYLE
  74. configure
  75. COPYING
  76. COPYING.LIB
  77. cpu-exec-common.c
  78. cpu-exec.c
  79. cpus.c
  80. cputlb.c
  81. device-hotplug.c
  82. device_tree.c
  83. disas.c
  84. dma-helpers.c
  85. dump.c
  86. exec.c
  87. gdbstub.c
  88. HACKING
  89. hmp-commands-info.hx
  90. hmp-commands.hx
  91. hmp.c
  92. hmp.h
  93. iohandler.c
  94. ioport.c
  95. iothread.c
  96. kvm-all.c
  97. kvm-stub.c
  98. LICENSE
  99. main-loop.c
  100. MAINTAINERS
  101. Makefile
  102. Makefile.objs
  103. Makefile.target
  104. memory.c
  105. memory_mapping.c
  106. module-common.c
  107. monitor.c
  108. nbd.c
  109. numa.c
  110. os-posix.c
  111. os-win32.c
  112. page_cache.c
  113. qapi-schema.json
  114. qdev-monitor.c
  115. qdict-test-data.txt
  116. qemu-bridge-helper.c
  117. qemu-char.c
  118. qemu-doc.texi
  119. qemu-ga.texi
  120. qemu-img-cmds.hx
  121. qemu-img.c
  122. qemu-img.texi
  123. qemu-io-cmds.c
  124. qemu-io.c
  125. qemu-log.c
  126. qemu-nbd.c
  127. qemu-nbd.texi
  128. qemu-options-wrapper.h
  129. qemu-options.h
  130. qemu-options.hx
  131. qemu-seccomp.c
  132. qemu-tech.texi
  133. qemu-timer.c
  134. qemu.nsi
  135. qemu.sasl
  136. qjson.c
  137. qmp-commands.hx
  138. qmp.c
  139. qtest.c
  140. README
  141. rules.mak
  142. softmmu_template.h
  143. spice-qemu-char.c
  144. tcg-runtime.c
  145. tci.c
  146. thread-pool.c
  147. thunk.c
  148. tpm.c
  149. trace-events
  150. translate-all.c
  151. translate-all.h
  152. translate-common.c
  153. user-exec.c
  154. VERSION
  155. version.rc
  156. vl.c
  157. xen-common-stub.c
  158. xen-common.c
  159. xen-hvm-stub.c
  160. xen-hvm.c
  161. xen-mapcache.c