1. 15 10月, 2019 2 次提交
  2. 11 10月, 2019 1 次提交
  3. 10 10月, 2019 7 次提交
  4. 30 9月, 2019 1 次提交
  5. 19 9月, 2019 1 次提交
  6. 10 9月, 2019 1 次提交
    • D
      util: activate directory override when used from library · b1b878c5
      Daniel P. Berrangé 提交于
      The Perl bindings for libvirt use the test driver for unit tests. This
      tries to load the cpu_map/index.xml file, and when run from an
      uninstalled build will fail.
      
      The problem is that virFileActivateDirOverride is called by our various
      binaries like libvirtd, virsh, but is not called when a 3rd party app
      uses libvirt.so
      
      To deal with this we allow the LIBVIRT_DIR_OVERRIDE=1 env variable to be
      set and make virInitialize look for this. The 'run' script will set it,
      so now build using this script to run against an uninstalled tree we
      will correctly resolve files to the source tree.
      Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      b1b878c5
  7. 27 8月, 2019 1 次提交
  8. 19 8月, 2019 2 次提交
    • A
      virt-aa-helper: Call virCommandRawStatus() · b194c3d9
      Andrea Bolognani 提交于
      The way we're processing the return status, using WIFEXITED() and
      friends, only works when we have the raw return status; however,
      virCommand defaults to processing the return status for us. Call
      virCommandRawStatus() before virCommandRun() so that we get the raw
      return status and the logic can actually work.
      
      This results in guest startup failures caused by AppArmor issues
      being reported much earlier: for example, if virt-aa-helper exits
      with an error we're now reporting
      
        error: internal error: cannot load AppArmor profile 'libvirt-b20e9a8e-091a-45e0-8823-537119e98bc6'
      
      instead of the misleading
      
        error: internal error: Process exited prior to exec: libvirt:
        error : unable to set AppArmor profile 'libvirt-b20e9a8e-091a-45e0-8823-537119e98bc6'
        for '/usr/bin/qemu-system-x86_64': No such file or directory
      Suggested-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      b194c3d9
    • A
      virt-aa-helper: Use virCommand APIs directly · 7d3a0f56
      Andrea Bolognani 提交于
      Right now we're using the virRun() convenience API, but that
      doesn't allow the kind of control we want. Use the virCommand
      APIs directly instead.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      7d3a0f56
  9. 16 5月, 2019 1 次提交
  10. 17 4月, 2019 2 次提交
  11. 06 3月, 2019 2 次提交
  12. 25 2月, 2019 1 次提交
  13. 28 1月, 2019 1 次提交
    • M
      lib: Use more of VIR_STEAL_PTR() · 5772885d
      Michal Privoznik 提交于
      We have this very handy macro called VIR_STEAL_PTR() which steals
      one pointer into the other and sets the other to NULL. The
      following coccinelle patch was used to create this commit:
      
        @ rule1 @
        identifier a, b;
        @@
      
        - b = a;
          ...
        - a = NULL;
        + VIR_STEAL_PTR(b, a);
      
      Some places were clean up afterwards to make syntax-check happy
      (e.g. some curly braces were removed where the body become a one
      liner).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      5772885d
  14. 25 1月, 2019 1 次提交
  15. 23 1月, 2019 1 次提交
  16. 14 12月, 2018 1 次提交
    • 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
  17. 05 12月, 2018 1 次提交
  18. 22 11月, 2018 1 次提交
  19. 20 9月, 2018 2 次提交
  20. 23 7月, 2018 1 次提交
    • A
      src: Make virStr*cpy*() functions return an int · 6c0d0210
      Andrea Bolognani 提交于
      Currently, the functions return a pointer to the
      destination buffer on success or NULL on failure.
      
      Not only does this kind of error handling look quite
      alien in the context of libvirt, where most functions
      return zero on success and a negative int on failure,
      but it's also somewhat pointless because unless there's
      been a failure the returned pointer will be the same
      one passed in by the user, thus offering no additional
      value.
      
      Change the functions so that they return an int
      instead.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      6c0d0210
  21. 28 6月, 2018 1 次提交
  22. 08 6月, 2018 2 次提交
  23. 04 5月, 2018 1 次提交
  24. 25 4月, 2018 1 次提交
  25. 22 3月, 2018 2 次提交
  26. 19 3月, 2018 1 次提交
    • C
      virt-aa-helper: resolve file symlinks · 77cd862f
      Christian Ehrhardt 提交于
      In a recent change b932ed69: "virt-aa-helper: resolve yet to be created
      paths" several cases with symlinks in paths were fixed, but it regressed
      cases where the file being last element of the path was the actual link.
      
      In the case of the last element being the symlink realpath can (and shall)
      be called on the full path that was passed.
      
      Examples would be zfs/lvm block devices like:
       <disk type='block' device='disk'>
          <driver name='qemu' type='raw'/>
          <source dev='/dev/mapper/testlvm-testvol1'/>
          <target dev='vdd' bus='virtio'/>
       </disk>
      With the target being:
       /dev/mapper/testlvm-testvol1 -> ../dm-0
      
      That currently is rendered as
       "/dev/mapper/testlvm-testvol1" rwk,
      but instead should be (and is with the fix):
       "/dev/dm-0" rwk,
      
      Fixes: b932ed69: "virt-aa-helper: resolve yet to be created paths"
      Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1756394Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      77cd862f
  27. 08 3月, 2018 1 次提交
    • C
      virt-aa-helper: resolve yet to be created paths · b932ed69
      Christian Ehrhardt 提交于
      In certain cases a xml contains paths that do not yet exist, but
      are valid as qemu will create them later on - for example
      vhostuser mode=server sockets.
      
      In any such cases so far the check to virFileExists failed and due to
      that the paths stayed non-resolved in regard to symlinks.
      
      But for apparmor those non-resolved rules are non functional as they
      are evaluated after resolving any symlinks.
      
      Therefore for non-existent files and partially non-existent paths
      resolve as much as possible to get valid rules.
      
      Example:
         <interface type='vhostuser'>
             <model type='virtio'/>
             <source type='unix' path='/var/run/symlinknet' mode='server'/>
         </interface>
      
      Got rendered as:
        "/var/run/symlinknet" rw,
      
      But correct with "/var/run" being a symlink to "/run" is:
        "/run/symlinknet" rw,
      Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
      Acked-by: NMichal Privoznik <mprivozn@redhat.com>
      b932ed69