1. 09 3月, 2020 1 次提交
    • M
      qemu: Tell secdrivers which images are top parent · 13eb6c14
      Michal Privoznik 提交于
      When preparing images for block jobs we modify their seclabels so
      that QEMU can open them. However, as mentioned in the previous
      commit, secdrivers base some it their decisions whether the image
      they are working on is top of of the backing chain. Fortunately,
      in places where we call secdrivers we know this and the
      information can be passed to secdrivers.
      
      The problem is the following: after the first blockcommit from
      the base to one of the parents the XATTRs on the base image are
      not cleared and therefore the second attempt to do another
      blockcommit fails. This is caused by blockcommit code calling
      qemuSecuritySetImageLabel() over the base image, possibly
      multiple times (to ensure RW/RO access). A naive fix would be to
      call the restore function. But this is not possible, because that
      would deny QEMU the access to the base image.  Fortunately, we
      can use the fact that seclabels are remembered only for the top
      of the backing chain and not for the rest of the backing chain.
      And thanks to the previous commit we can tell secdrivers which
      images are top of the backing chain.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1803551Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
      13eb6c14
  2. 04 3月, 2020 3 次提交
  3. 26 2月, 2020 2 次提交
  4. 25 2月, 2020 1 次提交
  5. 14 2月, 2020 7 次提交
  6. 07 2月, 2020 2 次提交
    • Z
      qemu: support Panic Crashloaded event handling · 26badd13
      zhenwei pi 提交于
      Pvpanic device supports bit 1 as crashloaded event, it means that
      guest actually panicked and run kexec to handle error by guest side.
      
      Handle crashloaded as a lifecyle event in libvirt.
      
      Test case:
      Guest side:
      before testing, we need make sure kdump is enabled,
      1, build new pvpanic driver (with commit from upstream
         e0b9a42735f2672ca2764cfbea6e55a81098d5ba
         191941692a3d1b6a9614502b279be062926b70f5)
      2, insmod new kmod
      3, enable crash_kexec_post_notifiers,
        # echo 1 > /sys/module/kernel/parameters/crash_kexec_post_notifiers
      4, trigger kernel panic
        # echo 1 > /proc/sys/kernel/sysrq
        # echo c > /proc/sysrq-trigger
      
      Host side:
      1, build new qemu with pvpanic patches (with commit from upstream
         600d7b47e8f5085919fd1d1157f25950ea8dbc11
         7dc58deea79a343ac3adc5cadb97215086054c86)
      2, build libvirt with this patch
      3, handle lifecycle event and trigger guest side panic
        # virsh event stretch --event lifecycle
        event 'lifecycle' for domain stretch: Crashed Crashloaded
        events received: 1
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: Nzhenwei pi <pizhenwei@bytedance.com>
      26badd13
    • J
      qemu: Pass machine type to virQEMUCapsIsCPUModeSupported · 80791859
      Jiri Denemark 提交于
      The usability of a specific CPU mode may depend on machine type, let's
      prepare for this by passing it to virQEMUCapsIsCPUModeSupported.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      80791859
  7. 06 2月, 2020 3 次提交
  8. 04 2月, 2020 2 次提交
  9. 02 2月, 2020 1 次提交
  10. 01 2月, 2020 1 次提交
    • J
      qemu: drop unused variable · 62d75cdc
      Ján Tomko 提交于
      The g_auto conversion made clang realize the variable is unused:
      ../../src/qemu/qemu_domain.c:10349:36: error: unused variable
          'cfg' [-Werror,-Wunused-variable]
          g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      Fixes: 20fa2bc6
      62d75cdc
  11. 31 1月, 2020 5 次提交
  12. 30 1月, 2020 2 次提交
    • J
      Add a space before ending a comment · 49882b33
      Ján Tomko 提交于
      Also add a space after the start in some of the cases.
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
      49882b33
    • L
      qemu: support interface <teaming> functionality · eb9f6cc4
      Laine Stump 提交于
      The QEMU driver uses the <teaming type='persistent|transient'
      persistent='blah'/> element to setup a "failover" pair of devices -
      the persistent device must be a virtio emulated NIC, with the only
      extra configuration being the addition of ",failover=on" to the device
      commandline, and the transient device must be a hostdev NIC
      (<interface type='hostdev'> or <interface type='network'> with a
      network that is a pool of SRIOV VFs) where the extra configuration is
      the addition of ",failover_pair_id=$aliasOfVirtio" to the device
      commandline. These new options are supported in QEMU 4.2.0 and later.
      
      Extra qemu-specific validation is added to ensure that the device
      type/model is appropriate and that the qemu binary supports these
      commandline options.
      
      The result of this will be:
      
      1) The virtio device presented to the guest will have an extra bit set
      in its PCI capabilities indicating that it can be used as a failover
      backup device. The virtio guest driver will need to be equipped to do
      something with this information - this is included in the Linux
      virtio-net driver in kernel 4.18 and above (and also backported to
      some older distro kernels). Unfortunately there is no way for libvirt
      to learn whether or not the guest driver supports failover - if it
      doesn't then the extra PCI capability will be ignored and the guest OS
      will just see two independent devices. (NB: the current virtio guest
      driver also requires that the MAC addresses of the two NICs match in
      order to pair them into a bond).
      
      2) When a migration is requested, QEMu will automatically unplug the
      transient/hostdev NIC from the guest on the source host before
      starting migration, and automatically re-plug a similar device after
      restarting the guest CPUs on the destination host. While the transient
      NIC is unplugged, all network traffic will go through the
      persistent/virtio device, but when the hostdev NIC is plugged in, it
      will get all the traffic. This means that in normal circumstances the
      guest gets the performance advantage of vfio-assigned "real hardware"
      networking, but it can still be migrated with the only downside being
      a performance penalty (due to using an emulated NIC) during the
      migration.
      Signed-off-by: NLaine Stump <laine@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      eb9f6cc4
  13. 27 1月, 2020 2 次提交
  14. 25 1月, 2020 1 次提交
  15. 24 1月, 2020 1 次提交
  16. 23 1月, 2020 1 次提交
  17. 17 1月, 2020 1 次提交
  18. 16 1月, 2020 2 次提交
  19. 13 1月, 2020 1 次提交
  20. 10 1月, 2020 1 次提交