1. 26 3月, 2019 2 次提交
    • L
      qemu_hotplug: remove another erroneous qemuDomainDetachExtensionDevice() call · e18e9b72
      Laine Stump 提交于
      qemuDomainRemoveRNGDevice() calls qemuDomainDetachExtensionDevice().
      According to commit 1d1e264f that added this code, it should not be
      necessary to explicitly remove the zPCI extension device for a PCI
      device during unplug, because "QEMU implements an unplug callback
      which will unplug both PCI and zPCI device in a cascaded way". In
      fact, no other devices call qemuDomainDetachExtensionDevice() during
      their qemuDomainRemove*Device() function, so it should be removed from
      qemuDomainRemoveRNGDevice as well.
      Signed-off-by: NLaine Stump <laine@laine.org>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com>
      e18e9b72
    • L
      qemu_hotplug: remove erroneous call to qemuDomainDetachExtensionDevice() · 14329169
      Laine Stump 提交于
      qemuDomainDetachControllerDevice() calls
      qemuDomainDetachExtensionDevice() when the controller type is
      PCI. This is incorrect in multiple ways:
      
      * Any code that tears down a device should be in the
        qemuDomainRemove*Device() function (which is called after libvirt
        gets a DEVICE_DELETED event from qemu indicating that the guest is
        finished with the device on its end. The qemuDomainDetach*Device()
        functions should only contain code that ensures the requested
        operation is valid, and sends the command to qemu to initiate the
        unplug.
      
      * qemuDomainDetachExtensionDevice() is a function that applies to
        devices that plug into a PCI slot, *not* necessarily PCI controllers
        (which is what's being checked in the offending code). The proper
        way to check for this would be to see if the DeviceInfo for the
        controller device had a PCI address, not to check if the controller
        is a PCI controller (the code being removed was doing the latter).
      
      * According to commit 1d1e264f that added this code (and other
        support for hotplugging zPCI devices on s390), it's not necessary to
        explicitly detach the zPCI device when unplugging a PCI device. To
        quote:
      
             There's no need to implement hot unplug for zPCI as QEMU
             implements an unplug callback which will unplug both PCI and
             zPCI device in a cascaded way.
      
        and the evidence bears this out - all the other uses of
        qemuDomainDetachExtensionDevice() (except one, which I believe is
        also in error, and is being removed in a separate patch) are only to
        remove the zPCI extension device in cases where it was successfully
        added, but there was some other failure later in the hotplug process
        (so there was no regular PCI device to remove and trigger removal of
        the zPCI extension device).
      
      * PCI controllers are not hot pluggable, so this is dead code
        anyway. (The only controllers that can currently be
        hotplugged/unplugged are SCSI controllers).
      Signed-off-by: NLaine Stump <laine@laine.org>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      Reviewed-by: NBoris Fiuczynski <fiuczy@linux.ibm.com>
      14329169
  2. 15 3月, 2019 6 次提交
  3. 13 3月, 2019 1 次提交
  4. 07 3月, 2019 1 次提交
  5. 18 2月, 2019 1 次提交
  6. 14 2月, 2019 6 次提交
  7. 08 2月, 2019 2 次提交
  8. 31 1月, 2019 5 次提交
  9. 25 1月, 2019 2 次提交
  10. 19 1月, 2019 1 次提交
    • L
      qemu: fix i6300esb watchdog hotplug on Q35 · 40136bd3
      Laine Stump 提交于
      When commit 361c8dc1 added support for hotplugging the i6300esb
      watchdog device (first in libvirt-3.9.0), it accidentally contstructed
      the commandline for the device_add command before allocating a PCI
      address for the device. With no PCI address specified in the command,
      the watchdog would simply be placed at the lowest unused PCI slot.
      
      On a 440fx guest, this doesn't cause a problem, because libvirt's PCI
      address allocation algorithm would most likely give the same address
      anyway (usually a slot on pci-root), so nobody noticed the omission of
      address from the command.
      
      But on a Q35 guest, the lowest unused PCI slot is on pcie-root, which
      doesn't support hotplug; libvirt knows enough to assign a PCI address
      that is on a pcie-to-pci-bridge (because its slots *do* support
      hotplug), but qemu doesn't, so if there is no PCI address in the
      command, qemu just tries to plug the new device into pcie-root, and
      fails because it doesn't support hotplug, e.g.:
      
        error: Failed to attach device from watchdog.xml
        error: internal error: unable to execute QEMU command 'device_add':
        Bus 'pcie.0' does not support hotplugging
      
      The solution is simply to build the command string after assigning a
      PCI address, not before.
      
      Resolves: https://bugzilla.redhat.com/1666559Signed-off-by: NLaine Stump <laine@laine.org>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      40136bd3
  11. 18 1月, 2019 1 次提交
  12. 02 1月, 2019 1 次提交
  13. 14 12月, 2018 4 次提交
    • D
      Enforce a standard header file guard symbol name · 568a4172
      Daniel P. Berrangé 提交于
      Require that all headers are guarded by a symbol named
      
        LIBVIRT_$FILENAME
      
      where $FILENAME is the uppercased filename, with all characters
      outside a-z changed into '_'.
      
      Note we do not use a leading __ because that is technically a
      namespace reserved for the toolchain.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      568a4172
    • D
      Fix many mistakes & inconsistencies in header file layout · 4cfd7090
      Daniel P. Berrangé 提交于
      This introduces a syntax-check script that validates header files use a
      common layout:
      
        /*
         ...copyright header...
         */
        <one blank line>
        #ifndef SYMBOL
        # define SYMBOL
        ....content....
        #endif /* SYMBOL */
      
      For any file ending priv.h, before the #ifndef, we will require a
      guard to prevent bogus imports:
      
        #ifndef SYMBOL_ALLOW
        # error ....
        #endif /* SYMBOL_ALLOW */
        <one blank line>
      
      The many mistakes this script identifies are then fixed.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      4cfd7090
    • D
      fe2bd021
    • D
      Remove all Author(s): lines from source file headers · 60046283
      Daniel P. Berrangé 提交于
      In many files there are header comments that contain an Author:
      statement, supposedly reflecting who originally wrote the code.
      In a large collaborative project like libvirt, any non-trivial
      file will have been modified by a large number of different
      contributors. IOW, the Author: comments are quickly out of date,
      omitting people who have made significant contribitions.
      
      In some places Author: lines have been added despite the person
      merely being responsible for creating the file by moving existing
      code out of another file. IOW, the Author: lines give an incorrect
      record of authorship.
      
      With this all in mind, the comments are useless as a means to identify
      who to talk to about code in a particular file. Contributors will always
      be better off using 'git log' and 'git blame' if they need to  find the
      author of a particular bit of code.
      
      This commit thus deletes all Author: comments from the source and adds
      a rule to prevent them reappearing.
      
      The Copyright headers are similarly misleading and inaccurate, however,
      we cannot delete these as they have legal meaning, despite being largely
      inaccurate. In addition only the copyright holder is permitted to change
      their respective copyright statement.
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      60046283
  14. 13 12月, 2018 1 次提交
  15. 05 12月, 2018 2 次提交
  16. 15 11月, 2018 1 次提交
  17. 08 10月, 2018 3 次提交