1. 27 3月, 2017 1 次提交
  2. 24 2月, 2017 1 次提交
  3. 11 2月, 2017 1 次提交
    • E
      util: Introduce virFileComparePaths · 87589424
      Erik Skultety 提交于
      So rather than comparing 2 paths (strings) as they are, which can very
      easily lead to unnecessary errors (e.g. in storage driver) that the paths
      are not the same when in fact they'd be e.g. just symlinks to the same
      location, we should put our best effort into resolving any symlinks and
      canonicalizing the path and only then compare the 2 paths for equality.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      87589424
  4. 07 2月, 2017 1 次提交
  5. 12 1月, 2017 1 次提交
  6. 05 1月, 2017 1 次提交
  7. 16 12月, 2016 1 次提交
  8. 15 12月, 2016 2 次提交
  9. 06 12月, 2016 1 次提交
    • M
      util: Introduce virFileRewriteStr · b9b664c5
      Michal Privoznik 提交于
      There are couple of places where we have a string and want to
      save it to a file. Atomically. In all those places we use
      virFileRewrite() but also implement the very same callback which
      takes the string and write it into temp file. This makes no
      sense. Unify the callbacks and move them to one place.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b9b664c5
  10. 01 12月, 2016 1 次提交
    • L
      util: new function virFileLength() · e026563f
      Laine Stump 提交于
      This new function just calls fstat() (if provided with a valid fd) or
      stat() (if fd is -1) and returns st_size (or -1 if there is an
      error). We may decide we want this function to be more complex, and
      handle things like block devices - this is a placeholder (that works)
      for any more complicated function.
      e026563f
  11. 25 11月, 2016 1 次提交
    • M
      virstring: Unify string list function names · c2a5a4e7
      Michal Privoznik 提交于
      We have couple of functions that operate over NULL terminated
      lits of strings. However, our naming sucks:
      
      virStringJoin
      virStringFreeList
      virStringFreeListCount
      virStringArrayHasString
      virStringGetFirstWithPrefix
      
      We can do better:
      
      virStringListJoin
      virStringListFree
      virStringListFreeCount
      virStringListHasString
      virStringListGetFirstWithPrefix
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      c2a5a4e7
  12. 24 11月, 2016 1 次提交
  13. 24 6月, 2016 8 次提交
  14. 20 6月, 2016 1 次提交
  15. 13 5月, 2016 1 次提交
  16. 03 5月, 2016 1 次提交
  17. 20 4月, 2016 1 次提交
    • C
      storage: remove support for /usr/bin/kvm-img · 487d211d
      Cole Robinson 提交于
      This an ubuntu/debian packaging convention. At one point it may have
      been an actually different binary, but at least as of ubuntu precise
      (the oldest supported ubuntu distro, released april 2012) kvm-img is
      just a symlink to qemu-img for back compat.
      
      I think it's safe to drop support for it
      487d211d
  18. 19 3月, 2016 1 次提交
  19. 10 3月, 2016 2 次提交
  20. 04 11月, 2015 1 次提交
  21. 21 10月, 2015 1 次提交
  22. 14 10月, 2015 2 次提交
    • J
      storage: On error rmdir created directory in virDirCreate[NoFork] · 21eb8972
      John Ferlan 提交于
      After a successful creation of a directory, if some other call results
      in returning a failure, let's remove the directory we created to
      prevent another round trip or confusion in the caller. In particular, this
      function can be called during a storage backend buildVol, so in order
      to ensure that caller doesn't need to distinguish between failed create
      or some other failure after create, just remove the directory we created.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      21eb8972
    • J
      storage: On error unlink created file in virFileOpen{As|Forked} · 69556215
      John Ferlan 提交于
      After a successful creation of a file, if some other call results
      in returning a failure, let's unlink the file we created to prevent
      another round trip or confusion in the caller. In particular, this
      function can be called during a storage backend buildVol, so in order
      to ensure that caller doesn't need to distinguish between failed create
      or some other failure after create, just remove the volume we created.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      69556215
  23. 05 10月, 2015 2 次提交
    • J
      virfile: Fix error path for forked virFileRemove · cb19cff4
      John Ferlan 提交于
      As it turns out the caller in this case expects a return < 0 for failure
      and to get/use "errno" rather than using the negative of returned status.
      Again different than the create path.
      
      If someone "deleted" a file from the pool without using virsh vol-delete,
      then the unlink/rmdir would return an error (-1) and set errno to ENOENT.
      The caller checks errno for ENOENT when determining whether to throw an
      error message indicating the failure.  Without the change, the error
      message is:
      
      error: Failed to delete vol $vol
      error: cannot unlink file '/$pathto/$vol': Success
      
      This patch thus allows the fork path to follow the non-fork path
      where unlink/rmdir return -1 and errno.
      cb19cff4
    • J
      virfile: Add extra check for direct delete in virFileRemove · c6b32d68
      John Ferlan 提交于
      Unlike create options, if the file to be removed is already in the
      pool, then the uid/gid will come from the pool. If it's the same as the
      currently running process, then just do the unlink/rmdir directly
      rather than going through the fork processing unnecessarily
      c6b32d68
  24. 21 9月, 2015 4 次提交
  25. 16 9月, 2015 1 次提交
    • J
      virfile: Check for existence of dir in virFileDeleteTree · b421a708
      John Ferlan 提交于
      Commit id 'f1f68ca3' added code to remove the directory paths for
      auto-generated sockets, but that code could be called before the
      paths were created resulting in generating error messages from
      virFileDeleteTree indicating that the file doesn't exist.
      
      Rather than "enforce" all callers to make the non-NULL and existence
      checks, modify the virFileDeleteTree API to silently ignore NULL on
      input and non-existent directory trees.
      b421a708
  26. 08 9月, 2015 1 次提交