1. 04 2月, 2020 1 次提交
  2. 30 1月, 2020 1 次提交
    • L
      qemu: add capabilities flag for failover feature · cad65f22
      Laine Stump 提交于
      Presence of the virtio-net-pci option called "failover" indicates
      support in a qemu binary of a simplistic bonding of a virtio-net
      device with another PCI device. This feature allows migration of
      guests that have a network device assigned to a guest with VFIO, by
      creating a network bond device in the guest consisting of the
      VFIO-assigned device and a virtio-net-pci device, then temporarily
      (and automatically) unplugging the VFIO net device prior to migration
      (and hotplugging an equivalent device on the migration
      destination). (The feature is called "failover" because the bond
      device uses the vfio-pci netdev for normal guest networking, but
      "fails over" to the virtio-net-pci netdev once the vfio-pci device is
      unplugged for migration.)
      
      Full functioning of the feature also requires support in the
      virtio-net driver in the guest OS (since that is where the bond device
      resides), but if the "failover" commandline option is present for the
      virtio-net-pci device in qemu, at least the qemu part of the feature
      is available, and libvirt can add the proper options to both the
      virtio-net-pci and vfio-pci device commandlines to indicate qemu
      should attempt doing the failover during migration.
      
      This patch just adds the qemu capabilities flag "virtio-net.failover".
      Signed-off-by: NLaine Stump <laine@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      cad65f22
  3. 27 1月, 2020 4 次提交
  4. 25 1月, 2020 2 次提交
  5. 24 1月, 2020 2 次提交
    • M
      qemu_capabilities: Rework domain caps cache · c7600931
      Michal Privoznik 提交于
      Since v5.6.0-48-g270583ed we try to cache domain capabilities,
      i.e. store filled virDomainCaps in a hash table in virQEMUCaps
      for future use. However, there's a race condition in the way it's
      implemented. We use virQEMUCapsGetDomainCapsCache() to obtain the
      pointer to the hash table, then we search the hash table for
      cached data and if none is found the domcaps is constructed and
      put into the table. Problem is that this is all done without any
      locking, so if there are two threads trying to do the same, one
      will succeed and the other will fail inserting the data into the
      table.
      
      Also, the API looks a bit fishy - obtaining pointer to the hash
      table is dangerous.
      
      The solution is to use a mutex that guards the whole operation
      with the hash table. Then, the API can be changes to return
      virDomainCapsPtr directly.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1791790Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
      c7600931
    • D
      qemu: fixing auto-detecting binary in domain capabilities · 6d786f95
      Daniel P. Berrangé 提交于
      The virConnectGetDomainCapabilities API accepts either a binary path
      to the emulator, or desired guest arch. If guest arch is not given,
      then the host arch is assumed.
      
      In the case where the binary is not given, the code tried to find the
      emulator binary in the existing list of cached emulator capabilities.
      This is not valid since we switched to lazy population of the cache in:
      
        commit 3dd91af0
        Author: Daniel P. Berrangé <berrange@redhat.com>
        Date:   Mon Dec 2 13:04:26 2019 +0000
      
          qemu: stop creating capabilities at driver startup
      
      As a result of this change, if there are no persistent guests defined
      using the requested guest architecture, virConnectGetDomainCapabilities
      will fail to find an emulator binary.
      
      The solution is to stop relying on the cached capabilities to find the
      binary and instead use the same logic we use to pick default a binary
      per arch when populating capabilities.
      Tested-by: NBoris Fiuczynski <fiuczy@linux.ibm.com>
      Tested-by: NRichard W.M. Jones <rjones@redhat.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      6d786f95
  6. 23 1月, 2020 1 次提交
  7. 17 1月, 2020 1 次提交
  8. 16 1月, 2020 1 次提交
  9. 13 1月, 2020 1 次提交
  10. 07 1月, 2020 1 次提交
  11. 24 12月, 2019 3 次提交
  12. 17 12月, 2019 1 次提交
  13. 10 12月, 2019 1 次提交
  14. 09 12月, 2019 8 次提交
  15. 03 12月, 2019 2 次提交
  16. 26 11月, 2019 1 次提交
    • M
      qemu_capabilities: Use proper free function for caps->cpuModels · 9b1d53d4
      Michal Privoznik 提交于
      The cpuModels member of _virQEMUCapsAccel struct is not a
      virObject but regular struct with a free function defined:
      qemuMonitorCPUDefsFree(). Use that when clearing parent structure
      instead of virObjectUnref() to avoid a memleak:
      
      ==212322== 57,275 (48 direct, 57,227 indirect) bytes in 3 blocks are definitely lost in loss record 623 of 627
      ==212322==    at 0x4838B86: calloc (vg_replace_malloc.c:762)
      ==212322==    by 0x554A158: g_malloc0 (in /usr/lib64/libglib-2.0.so.0.6000.6)
      ==212322==    by 0x17B14BF5: qemuMonitorCPUDefsNew (qemu_monitor.c:3587)
      ==212322==    by 0x17B27BA7: qemuMonitorJSONGetCPUDefinitions (qemu_monitor_json.c:5616)
      ==212322==    by 0x17B14B0B: qemuMonitorGetCPUDefinitions (qemu_monitor.c:3559)
      ==212322==    by 0x17A6AFBB: virQEMUCapsFetchCPUDefinitions (qemu_capabilities.c:2571)
      ==212322==    by 0x17A6B2CC: virQEMUCapsProbeQMPCPUDefinitions (qemu_capabilities.c:2629)
      ==212322==    by 0x17A70C00: virQEMUCapsInitQMPMonitorTCG (qemu_capabilities.c:4769)
      ==212322==    by 0x17A70DDF: virQEMUCapsInitQMPSingle (qemu_capabilities.c:4820)
      ==212322==    by 0x17A70E99: virQEMUCapsInitQMP (qemu_capabilities.c:4848)
      ==212322==    by 0x17A71044: virQEMUCapsNewForBinaryInternal (qemu_capabilities.c:4891)
      ==212322==    by 0x17A7119C: virQEMUCapsNewData (qemu_capabilities.c:4923)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      9b1d53d4
  17. 22 11月, 2019 5 次提交
  18. 21 11月, 2019 4 次提交