1. 14 12月, 2018 9 次提交
    • 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
    • E
      remote: Fix the build by explicitly casting the obj pointer for xdr_free · 76ddd01e
      Erik Skultety 提交于
      For some reason, xdr_free uses char * instead of void * for its 2nd
      argument which is passed to a custom free routine. Commit
      dc54b3ec missed this detail which made the build fail on a number of
      platforms. Fix it by explicitly casting the object pointer to char *
      just like we do in other places throughout the code base.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      76ddd01e
    • P
      vircgroupv2: fix virCgroupV2ValidateMachineGroup · 634bd528
      Pavel Hrdina 提交于
      When libvirt is reconnecting to running domain that uses cgroup v2
      the QEMU process reports cgroup for the emulator directory because the
      main thread is in that cgroup.  We need to remove the "/emulator" part
      in order to match with the root cgroup directory name for that domain.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      634bd528
    • P
      vircgroup: introduce virCgroupKillRecursiveCB · b5325468
      Pavel Hrdina 提交于
      The rewrite to support cgroup v2 missed this function.  In cgroup v2
      we have different files to track tasks.
      
      We would fail to remove cgroup on non-systemd OSes if there is any
      extra process assigned to guest cgroup because we would not kill any
      process form the guest cgroup.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      b5325468
    • J
      storage: Fix build issue with MOUNT and VGCHANGE commands · e6f53e7a
      John Ferlan 提交于
      Turns out there some build platforms that must not define MOUNT
      or VGCHANGE in config.h... So moving the commands from the storage
      backend specific module into a common storage_util module causes
      issues for those platforms.
      
      So instead of assuming they are there, let's just pass the command
      string to the storage util API's from the storage backend specific
      code (as would have been successful before).  Also modify the test
      to determine whether the MOUNT and/or VGCHANGE doesn't exist and
      just define it to (for example) what Fedora has for the path. Could
      have just used "mount" and "vgchange" in the call, but that defeats
      the purpose of adding the call to virTestClearCommandPath.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      e6f53e7a
    • D
      fe2bd021
    • D
      remote: check & report OOM in make_nonnull_XXX methods · dc54b3ec
      Daniel P. Berrangé 提交于
      The make_nonnull_XXX methods can all fail due to OOM but this was being
      silently ignored and thus also not checked by callers. Make the methods
      propagate errors and use ATTRIBUTE_RETURN_CHECK to force callers to deal
      with it.
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      dc54b3ec
    • 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
  2. 13 12月, 2018 15 次提交
  3. 12 12月, 2018 6 次提交
  4. 11 12月, 2018 6 次提交
  5. 09 12月, 2018 2 次提交
    • L
      lxc: don't forbid <interface type='direct'> · c55ff370
      Laine Stump 提交于
      Commit 017dfa27 changed a few switch statements in the LXC code to
      have all possible enum values, and in the process changed the switch
      statement in virLXCControllerGetNICIndexes() to return an error status
      for unsupported interface types, but it erroneously put type='direct'
      on the list of unsupported types.
      
      type='direct' (implemented with a macvlan interface) is supported on
      LXC, but it's interface shouldn't be placed on the list of interfaces
      given to CreateMachineWithNetwork() because the interface is put
      inside the container, while CreateMachineWithNetwork() only wants to
      know about the parent veths of veth pairs (the parent veth remains on
      the host side, while the child veth is put into the container).
      
      Resolves: https://bugzilla.redhat.com/1656463Signed-off-by: NLaine Stump <laine@laine.org>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      c55ff370
    • L
      lxc: check actual type of interface not config type · 59603b62
      Laine Stump 提交于
      virLXCControllerGetNICIndexes() was deciding whether or not to add the
      ifindex for an interface's ifname to the list of ifindexes sent to
      CreateMachineWithNetwork based on the interface type stored in the
      config. This would be incorrect in the case of <interface
      type='network'> where the network was giving out macvlan interfaces
      tied to a physical device (i.e. when the actual interface type was
      "direct").
      
      Instead of checking the setting of "net->type", we should be checking
      the setting of virDomainNetGetActualType(net).
      
      I don't think this caused any actual misbehavior, it was just
      technically wrong.
      Signed-off-by: NLaine Stump <laine@laine.org>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      59603b62
  6. 07 12月, 2018 2 次提交