1. 15 5月, 2019 1 次提交
    • J
      qemu: Don't cache microcode version · cb6bcb03
      Jiri Denemark 提交于
      My earlier commit be46f613 was incomplete. It removed caching of
      microcode version in the CPU driver, which means the capabilities XML
      will see the correct microcode version. But it is also cached in the
      QEMU capabilities cache where it is used to detect whether we need to
      reprobe QEMU. By missing the second place, the original commit
      be46f613 made the situation even worse since libvirt would report
      correct microcode version while still using the old host CPU model
      (visible in domain capabilities XML).
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      (cherry picked from commit 673c62a3)
      
      CVE-2018-12126, CVE-2018-12127, CVE-2018-12130
      
      Conflicts:
      	src/qemu/qemu_capabilities.c
                  - virQEMUCapsCacheLookupByArch refactoring (commits
                    7948ad41 and 1a3de670) are missing
                  - commit a7424faf "Force QMP capability probing" is
                    missing downstream
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      cb6bcb03
  2. 28 2月, 2018 1 次提交
    • Z
      qemu: fix memory leak of @vporttype during migration. · f7399de1
      Zhangzijian 提交于
      12 bytes in 1 blocks are definitely lost in loss record 188 of 1,145
      at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      by 0x5D2CD77: xmlStrndup (in /lib/x86_64-linux-gnu/libxml2.so.2.7.8)
      by 0x514E137: virXMLPropString (virxml.c:506)
      by 0x234F51: qemuMigrationCookieNetworkXMLParse qemu_migration.c:1001)
      by 0x235FF8: qemuMigrationCookieXMLParse (qemu_migration.c:1333)
      by 0x236214: qemuMigrationCookieXMLParseStr (qemu_migration.c:1372)
      by 0x2365D2: qemuMigrationEatCookie (qemu_migration.c:1456)
      by 0x243DBA: qemuMigrationFinish (qemu_migration.c:6381)
      by 0x204032: qemuDomainMigrateFinish3 (qemu_driver.c:13228)
      by 0x521CCBB: virDomainMigrateFinish3 (libvirt-domain.c:4788)
      by 0x1936DE: remoteDispatchDomainMigrateFinish3 (remote.c:4580)
      by 0x16DBB1: remoteDispatchDomainMigrateFinish3Helper(remote_dispatch.h:7582)
      Signed-off-by: NZhangZijian <zhang.zijian@h3c.com>
      f7399de1
  3. 26 2月, 2018 3 次提交
  4. 23 2月, 2018 3 次提交
  5. 22 2月, 2018 9 次提交
  6. 20 2月, 2018 5 次提交
    • D
      Fix build with GCC 8 new switch fallthrough warnings · 75f4813c
      Daniel P. Berrangé 提交于
      GCC 8 became more fussy about detecting switch
      fallthroughs. First it doesn't like it if you have
      a fallthrough attribute that is not before a case
      statement. e.g.
      
         FOO:
         BAR:
         WIZZ:
            ATTRIBUTE_FALLTHROUGH;
      
      Is unacceptable as there's no final case statement,
      so while FOO & BAR are falling through, WIZZ is
      not falling through. IOW, GCC wants us to write
      
        FOO:
        BAR:
          ATTRIBUTE_FALLTHROUGH;
        WIZZ:
      
      Second, it will report risk of fallthrough even if you
      have a case statement for every single enum value, but
      only if the switch is nested inside another switch and
      the outer case statement has no final break. This is
      is arguably valid because despite the fact that we have
      cast from "int" to the enum typedef, nothing guarantees
      that the variable we're switching on only contains values
      that have corresponding switch labels. e.g.
      
         int domstate = 87539319;
         switch ((virDomainState)domstate) {
            ...
         }
      
      will not match enum value, but also not raise any kind
      of compiler warning. So it is right to complain about
      risk of fallthrough if no default: is present.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      75f4813c
    • D
      conf: add enum constants for default controller models · a302480d
      Daniel P. Berrangé 提交于
      The controller model is slightly unusual in that the default value is
      -1, not 0. As a result the default value is not covered by any of the
      existing enum cases. This in turn means that any switch() statements
      that think they have covered all cases, will in fact not match the
      default value at all. In the qemuDomainDeviceCalculatePCIConnectFlags()
      method this has caused a serious mistake where we fallthrough from the
      SCSI controller case, to the VirtioSerial controller case, and from
      the USB controller case to the IDE controller case.
      
      By adding explicit enum constant starting at -1, we can ensure switches
      remember to handle the default case.
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      a302480d
    • A
      qemu: Simplify modelName stringification · cbd1eba8
      Andrea Bolognani 提交于
      There's no need to perform checks before conversion, we can just
      call virDomainControllerPCIModelNameTypeToString() and check the
      results later on.
      
      Since the variables involved are only used for PCI controllers,
      we can declare them in the 'case' scope rather than in the
      function scope to make everything a bit nicer while at it.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      cbd1eba8
    • A
      qemu: Move skip for implicit PHB of pSeries guests · 35e9c02c
      Andrea Bolognani 提交于
      Performing the skip earlier will help us making the function
      nicer later on. We also make the condition for the skip a bit
      more precise, though that'a more for self-documenting purposes
      and doesn't change anything in practice.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      35e9c02c
    • A
      qemu: Move 'done' label in qemuBuildControllerDevStr() · 3424de62
      Andrea Bolognani 提交于
      Even when we skip part of the processing, we still want error
      checking on the buffer.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      3424de62
  7. 19 2月, 2018 9 次提交
  8. 17 2月, 2018 1 次提交
  9. 14 2月, 2018 3 次提交
  10. 13 2月, 2018 5 次提交