1. 16 4月, 2019 1 次提交
    • D
      network: restrict usage of port management APIs · dd52444f
      Daniel P. Berrangé 提交于
      The port allocation APIs are currently called unconditionally for all
      types of NIC, but (mostly) only do anything for NICs with type=network.
      
      The exception is the port allocate API which does some validation even
      for NICs with type!=network. Relying on this validation is flawed,
      however, since the network driver may not even be installed. IOW virt
      drivers must not delegate validation to the network driver for NICs
      with type != network.
      
      This change allows us to report errors when the virtual network driver
      is not registered.
      Reviewed-by: NCole Robinson <crobinso@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      dd52444f
  2. 12 4月, 2019 2 次提交
  3. 10 4月, 2019 4 次提交
  4. 18 3月, 2019 1 次提交
  5. 14 3月, 2019 1 次提交
  6. 08 3月, 2019 1 次提交
  7. 06 3月, 2019 1 次提交
  8. 04 3月, 2019 1 次提交
  9. 25 2月, 2019 5 次提交
  10. 20 2月, 2019 1 次提交
    • E
      domain: Fix unknown flags diagnosis in virDomainGetXMLDesc · 27c8fd74
      Eric Blake 提交于
      Many drivers had a comment that they did not validate the incoming
      'flags' to virDomainGetXMLDesc() because they were relying on
      virDomainDefFormat() to do it instead. This used to be the case
      (at least since 461e0f1a and friends in 0.9.4 added unknown flag
      checking in general), but regressed in commit 0ecd6851 (1.2.12),
      when all of the drivers were changed to pass 'flags' through the
      new helper virDomainDefFormatConvertXMLFlags(). Since this helper
      silently ignores unknown flags, we need to implement flag checking
      in each driver instead.
      
      Annoyingly, this means that any new flag values added will silently
      be ignored when targeting an older libvirt, rather than our usual
      practice of loudly diagnosing an unsupported flag.  Add comments
      in domain_conf.[ch] to remind us to be extra vigilant about the
      impact when adding flags (a new flag to add data is safe if the
      older server omitting the requested data doesn't break things in
      the newer client; a new flag to suppress data rather than enhancing
      the existing VIR_DOMAIN_XML_SECURE may form a data leak or even a
      security hole).
      
      In the qemu driver, there are multiple callers all funnelling to
      qemuDomainDefFormatBufInternal(); many of them already validated
      flags (and often only a subset of the full set of possible flags),
      but for ease of maintenance, we can also check flags at the common
      helper function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
      27c8fd74
  11. 14 2月, 2019 1 次提交
  12. 07 2月, 2019 4 次提交
  13. 04 2月, 2019 3 次提交
  14. 31 1月, 2019 1 次提交
  15. 09 1月, 2019 1 次提交
  16. 17 12月, 2018 1 次提交
  17. 14 12月, 2018 3 次提交
    • 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
      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
  18. 12 12月, 2018 1 次提交
  19. 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
  20. 05 12月, 2018 1 次提交
  21. 16 11月, 2018 1 次提交
  22. 15 11月, 2018 1 次提交
  23. 08 11月, 2018 1 次提交
  24. 02 10月, 2018 1 次提交