1. 21 8月, 2018 17 次提交
  2. 20 8月, 2018 3 次提交
    • E
      qemu: caps: Format SEV platform data into qemuCaps cache · 77f51ab5
      Erik Skultety 提交于
      Since we're not saving the platform-specific data into a cache, we're
      not going to populate the structure, which in turn will cause a crash
      upon calling virNodeGetSEVInfo because of a NULL pointer dereference.
      Ultimately, we should start caching this data along with host-specific
      capabilities like NUMA and SELinux stuff into a separate cache, but for
      the time being, this is a semi-proper fix for a potential crash.
      
      Backtrace (requires libvirtd restart to load qemu caps from cache):
          #0 qemuGetSEVInfoToParams
          #1 qemuNodeGetSEVInfo
          #2 virNodeGetSEVInfo
          #3 remoteDispatchNodeGetSevInfo
          #4 remoteDispatchNodeGetSevInfoHelper
          #5 virNetServerProgramDispatchCall
          #6 virNetServerProgramDispatch
          #7 virNetServerProcessMsg
          #8 virNetServerHandleJob
          #9 virThreadPoolWorker
          #10 virThreadHelper
      
      https: //bugzilla.redhat.com/show_bug.cgi?id=1612009
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      Acked-by: NPeter Krempa <pkrempa@redhat.com>
      Tested-by: NBrijesh Singh <brijesh.singh@amd.com>
      77f51ab5
    • E
      qemu: Fix probing of AMD SEV support · 764491c9
      Erik Skultety 提交于
      So the procedure to detect SEV support works like this:
      1) we detect that sev-guest is among the QOM types and set the cap flag
      2) we probe the monitor for SEV support
          - this is tricky, because QEMU with compiled SEV support will always
          report -object sev-guest and query-sev-capabilities command, that
          however doesn't mean SEV is supported
      3) depending on what the monitor returned, we either keep or clear the
      capability flag for SEV
      
      Commit a349c6c2 added an explicit check for "GenericError" in the
      monitor reply to prevent libvirtd to spam logs about missing
      'query-sev-capabilities' command. At the same time though, it returned
      success in this case which means that we didn't clear the capability
      flag afterwards and happily formatted SEV into qemuCaps. Therefore,
      adjust all the relevant callers to handle -1 on errors, 0 on SEV being
      unsupported and 1 on SEV being supported.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      Acked-by: NPeter Krempa <pkrempa@redhat.com>
      764491c9
    • E
      qemu: Define and use a auto cleanup function with virSEVCapability · d96eb28e
      Erik Skultety 提交于
      Keep with the recent effort of replacing as many explicit *Free
      functions with their automatic equivalents.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      Acked-by: NPeter Krempa <pkrempa@redhat.com>
      d96eb28e
  3. 17 8月, 2018 4 次提交
  4. 16 8月, 2018 1 次提交
    • M
      qemu_command: Fix memleak in qemuBuildFloppyCommandLineControllerOptions · 480d47cd
      Michal Privoznik 提交于
      There are some path where the buffer is not passed to
      virCommandAddArgBuffer and therefore the buffer might leak.
      
      ==191201== 1,010 bytes in 1 blocks are definitely lost in loss record 826 of 836
      ==191201==    at 0x4C2CE3F: malloc (vg_replace_malloc.c:298)
      ==191201==    by 0x4C2F1BF: realloc (vg_replace_malloc.c:785)
      ==191201==    by 0x5D39E82: virReallocN (viralloc.c:245)
      ==191201==    by 0x5D3E8F2: virBufferGrow (virbuffer.c:150)
      ==191201==    by 0x5D3E9C8: virBufferAdd (virbuffer.c:185)
      ==191201==    by 0x56EAC98: qemuBuildFloppyCommandLineControllerOptions (qemu_command.c:2162)
      ==191201==    by 0x56EB3E1: qemuBuildDisksCommandLine (qemu_command.c:2370)
      ==191201==    by 0x570055E: qemuBuildCommandLine (qemu_command.c:10315)
      ==191201==    by 0x575EA7F: qemuProcessCreatePretendCmd (qemu_process.c:6777)
      ==191201==    by 0x113DAB: testCompareXMLToArgv (qemuxml2argvtest.c:598)
      ==191201==    by 0x13A75B: virTestRun (testutils.c:180)
      ==191201==    by 0x138BE8: mymain (qemuxml2argvtest.c:2975)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      480d47cd
  5. 14 8月, 2018 1 次提交
  6. 13 8月, 2018 3 次提交
  7. 10 8月, 2018 2 次提交
  8. 09 8月, 2018 6 次提交
  9. 08 8月, 2018 1 次提交
  10. 07 8月, 2018 2 次提交
    • D
      qemu: ensure default machine types don't change if QEMU changes · 26cfb1a3
      Daniel P. Berrangé 提交于
      It is increasingly likely that some distro is going to change the
      default "x86" machine type in QEMU from "pc" to "q35". This will
      certainly break existing applications which write their XML on the
      assumption that it is using a "pc" machine by default. For example they'll
      lack a IDE CDROM and get PCIe instead of PCI which changes the topology
      radically.
      
      Libvirt promises to isolate applications from hypervisor changes that
      may cause incompatibilities, so we must ensure that we always use the
      "pc" machine type if it is available. Only use QEMU's own reported
      default machine type if "pc" does not exist.
      
      This issue is not x86-only, other arches are liable to change their
      default machine, while some arches don't report any default at all
      causing libvirt to pick the first machine in the list. Thus to
      guarantee stability to applications, declare a preferred default
      machine for all architectures we currently support with QEMU.
      
      Note this change assumes there will always be a "pc" alias as long as a
      versioned "pc-XXX" machine type exists. If QEMU were to ship a "pc-XXX"
      machine type but not provide the "pc" alias, it is too hard to decide
      which to default so. Versioned machine types are supposed to be
      considered opaque strings, so we can't apply any sensible ordering
      ourselves and QEMU isn't reporting the list of machines in any sensible
      ordering itself.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      26cfb1a3
    • B
      qemu: Add ccw support for vhost-vsock · 927ef9f2
      Boris Fiuczynski 提交于
      Add support and tests for vhost-vsock-ccw.
      Signed-off-by: NBoris Fiuczynski <fiuczy@linux.ibm.com>
      927ef9f2