1. 14 1月, 2013 1 次提交
  2. 21 12月, 2012 5 次提交
  3. 13 12月, 2012 4 次提交
  4. 12 12月, 2012 1 次提交
  5. 22 11月, 2012 1 次提交
    • P
      qemu: Stop recursive detection of image chains when an image is missing · 58a54dc3
      Peter Krempa 提交于
      Commit e0c469e5 that fixes the detection
      of image chain wasn't complete. Iteration through the backing image
      chain has to stop at the last existing image if some of the images are
      missing otherwise the backing chain that is cached contains entries with
      paths being set to NULL resulting to:
      
      error: Unable to allow access for disk path (null): Bad address
      
      Fortunately stat() is kind enough not to crash when it's presented with
      a NULL argument. At least on Linux.
      58a54dc3
  6. 09 11月, 2012 1 次提交
    • P
      storage: fix broken backing chain · e0c469e5
      Philipp Hahn 提交于
      82507838 refactored the code to keep both the raw and canonicalized form
      of the backingStore, which breaks badly when the storage pool contains a
      storage volume, which is missing its backing store file:
       # ./daemon/libvirtd -l
       2012-11-07 12:43:33.279+0000: 22175: info : libvirt version: 1.0.0
       2012-11-07 12:43:33.279+0000: 22175: error : absolutePathFromBaseFile:542 : Can't canonicalize path '/var/lib/libvirt/images/base.qcow2': No such file or directory
       2012-11-07 12:43:33.280+0000: 22175: error : storageDriverAutostart:115 : Failed to autostart storage pool 'default': Can't canonicalize path '/var/lib/libvirt/images/base.qcow2': No such file or directory
      
      This is because virStorageFileGetMetadataFromBuf() aborts with -1 if the
      filename of the backingStore can not be canonicalized:
       #0  absolutePathFromBaseFile () at util/storage_file.c:541
       #1  virStorageFileGetMetadataFromBuf () at util/storage_file.c:728
       #2  virStorageFileGetMetadataFromFD () at util/storage_file.c:932
       #3  virStorageBackendProbeTarget () at storage/storage_backend_fs.c:94
       #4  virStorageBackendFileSystemRefresh () at storage/storage_backend_fs.c:849
       #5  storagePoolStart () at storage/storage_driver.c:700
       #6  virStoragePoolCreate () at libvirt.c:12471
       ...
      
      Treat files which miss their backing file as standalone files.
      Signed-off-by: NPhilipp Hahn <hahn@univention.de>
      e0c469e5
  7. 02 11月, 2012 1 次提交
  8. 31 10月, 2012 1 次提交
  9. 22 10月, 2012 1 次提交
    • E
      storage: let format probing work on root-squash NFS · d9d77bfa
      Eric Blake 提交于
      Yet another instance of where using plain open() mishandles files
      that live on root-squash NFS, and where improving the API can
      improve the chance of a successful probe.
      
      * src/util/storage_file.h (virStorageFileProbeFormat): Alter
      signature.
      * src/util/storage_file.c (virStorageFileProbeFormat): Use better
      method for opening file.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Update caller.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Likewise.
      d9d77bfa
  10. 20 10月, 2012 5 次提交
    • E
      storage: make it easier to find file within chain · 5eaf6054
      Eric Blake 提交于
      In order to temporarily label files read/write during a commit
      operation, we need to crawl the backing chain and find the absolute
      file name that needs labeling in the first place, as well as the
      name of the file that owns the backing file.
      
      * src/util/storage_file.c (virStorageFileChainLookup): New
      function.
      * src/util/storage_file.h: Declare it.
      * src/libvirt_private.syms (storage_file.h): Export it.
      5eaf6054
    • E
      storage: remember relative names in backing chain · 82507838
      Eric Blake 提交于
      In order to search for a backing file name as literally present
      in a chain, we need to remember if the chain had relative names.
      Also, searching for absolute names is easier if we only have
      to canonicalize once, rather than on every iteration.
      
      * src/util/storage_file.h (_virStorageFileMetadata): Add field.
      * src/util/storage_file.c (virStorageFileGetMetadataFromBuf):
      (virStorageFileFreeMetadata): Manage it
      (absolutePathFromBaseFile): Store absolute names in canonical form.
      82507838
    • E
      storage: don't require caller to pre-allocate metadata struct · 1fc95932
      Eric Blake 提交于
      Requiring pre-allocation was an unusual idiom.  It allowed iteration
      over the backing chain to use fewer mallocs, but made one-shot
      clients harder to read.  Also, this makes it easier for a future
      patch to move away from opening fds on every iteration over the chain.
      
      * src/util/storage_file.h (virStorageFileGetMetadataFromFD): Alter
      signature.
      * src/util/storage_file.c (virStorageFileGetMetadataFromFD): Allocate
      return value.
       (virStorageFileGetMetadata): Update clients.
      * src/conf/domain_conf.c (virDomainDiskDefForeachPath): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Likewise.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget):
      Likewise.
      1fc95932
    • E
      storage: get entire metadata chain in one call · 35c74c17
      Eric Blake 提交于
      Previously, no one was using virStorageFileGetMetadata, and for good
      reason - it couldn't support root-squash NFS.  Change the signature
      and make it useful to future patches, including enhancing the metadata
      to recursively track the entire chain.
      
      * src/util/storage_file.h (_virStorageFileMetadata): Add field.
      (virStorageFileGetMetadata): Alter signature.
      * src/util/storage_file.c (virStorageFileGetMetadata): Rewrite.
      (virStorageFileGetMetadataRecurse): New function.
      (virStorageFileFreeMetadata): Handle recursion.
      35c74c17
    • E
      storage: list more file types · f772b3d9
      Eric Blake 提交于
      When an image has no backing file, using VIR_STORAGE_FILE_AUTO
      for its type is a bit confusing.  Additionally, a future patch
      would like to reserve a default value for the case of no file
      type specified in the XML, but different from the current use
      of -1 to imply probing, since probing is not always safe.
      
      Also, a couple of file types were missing compared to supported
      code: libxl supports 'vhd', and qemu supports 'fat' for directories
      passed through as a file system.
      
      * src/util/storage_file.h (virStorageFileFormat): Add
      VIR_STORAGE_FILE_NONE, VIR_STORAGE_FILE_FAT, VIR_STORAGE_FILE_VHD.
      * src/util/storage_file.c (virStorageFileMatchesVersion): Match
      documentation when version probing not supported.
      (cowGetBackingStore, qcowXGetBackingStore, qcow1GetBackingStore)
      (qcow2GetBackingStoreFormat, qedGetBackingStore)
      (virStorageFileGetMetadataFromBuf)
      (virStorageFileGetMetadataFromFD): Take NONE into account.
      * src/conf/domain_conf.c (virDomainDiskDefForeachPath): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Likewise.
      * src/conf/storage_conf.c (virStorageVolumeFormatFromString): New
      function.
      (poolTypeInfo): Use it.
      f772b3d9
  11. 21 9月, 2012 1 次提交
  12. 09 8月, 2012 2 次提交
  13. 23 7月, 2012 1 次提交
    • O
      Desert the FSF address in copyright · f9ce7dad
      Osier Yang 提交于
      Per the FSF address could be changed from time to time, and GNU
      recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html)
      
        You should have received a copy of the GNU General Public License
        along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
      
      This patch removes the explicit FSF address, and uses above instead
      (of course, with inserting 'Lesser' before 'General').
      
      Except a bunch of files for security driver, all others are changed
      automatically, the copyright for securify files are not complete,
      that's why to do it manually:
      
        src/security/security_selinux.h
        src/security/security_driver.h
        src/security/security_selinux.c
        src/security/security_apparmor.h
        src/security/security_apparmor.c
        src/security/security_driver.c
      f9ce7dad
  14. 30 3月, 2012 1 次提交
  15. 23 2月, 2012 1 次提交
  16. 09 2月, 2012 1 次提交
  17. 01 2月, 2012 1 次提交
  18. 30 11月, 2011 1 次提交
  19. 03 8月, 2011 1 次提交
    • E
      build: silence coverity false positives · 44ebb18e
      Eric Blake 提交于
      Coverity complained that 395 out of 409 virAsprintf calls are
      checked, and therefore assumed that the remaining cases are bugs
      waiting to happen.  But in each of these cases, a failed virAsprintf
      will properly set the target string to NULL, and pass on that
      failure to the caller, without wasting efforts to check the call.
      Adding the ignore_value silences Coverity.
      
      * src/conf/domain_audit.c (virDomainAuditGetRdev): Ignore
      virAsprintf return value, when it behaves like we need.
      * src/network/bridge_driver.c (networkDnsmasqLeaseFileNameDefault)
      (networkRadvdConfigFileName, networkBridgeDummyNicName)
      (networkRadvdPidfileBasename): Likewise.
      * src/util/storage_file.c (absolutePathFromBaseFile): Likewise.
      * src/openvz/openvz_driver.c (openvzGenerateContainerVethName):
      Likewise.
      * src/util/command.c (virCommandTranslateStatus): Likewise.
      44ebb18e
  20. 22 7月, 2011 1 次提交
    • E
      build: rename files.h to virfile.h · 8e22e089
      Eric Blake 提交于
      In preparation for a future patch adding new virFile APIs.
      
      * src/util/files.h, src/util/files.c: Move...
      * src/util/virfile.h, src/util/virfile.c: ...here, and rename
      functions to virFile prefix.  Macro names are intentionally
      left alone.
      * *.c: All '#include "files.h"' uses changed.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_close): Likewise.
      * src/libvirt_private.syms: Likewise.
      * docs/hacking.html.in: Likewise.
      * HACKING: Regenerate.
      8e22e089
  21. 14 7月, 2011 1 次提交
    • M
      storage: Avoid memory leak on metadata fetching · 85aa40e2
      Michal Privoznik 提交于
      Getting metadata on storage allocates a memory (path) which need to
      be freed after use otherwise it gets leaked. This means after use of
      virStorageFileGetMetadataFromFD or virStorageFileGetMetadata one
      must call virStorageFileFreeMetadata to free it. This function frees
      structure internals and structure itself.
      85aa40e2
  22. 08 6月, 2011 1 次提交
    • E
      storage: avoid mishandling backing store > 2GB · 54456cc0
      Eric Blake 提交于
      Detected by Coverity.  The code was doing math on shifted unsigned
      char (which promotes to int), then promoting that to unsigned long
      during assignment to size.  On 64-bit platforms, this risks sign
      extending values of size > 2GiB.  Bug present since commit
      489fd3 (v0.6.0).
      
      I'm not sure if a specially-crafted bogus qcow2 image could
      exploit this, although it's probably not possible, since we
      were already checking for the computed results being within
      range of our fixed-size buffer.
      
      * src/util/storage_file.c (qcowXGetBackingStore): Avoid sign
      extension.
      54456cc0
  23. 03 6月, 2011 1 次提交
    • E
      storage: avoid memory leak on stat failure · f515bab7
      Eric Blake 提交于
      Spotted by coverity.  Triggers on failed stat, although I'm not sure
      how easy that condition is, so I'm not sure if this is a runtime
      memory hog.  Regression introduced in commit 8077d64f (unreleased).
      
      * src/util/storage_file.c (virStorageFileGetMetadataFromFD):
      Reduce need for malloc, avoiding a leak.
      f515bab7
  24. 01 6月, 2011 1 次提交
    • C
      storage: List directory volumes for dir/fs/netfs pools · 8077d64f
      Cole Robinson 提交于
      Since directories can be used for <filesystem> passthrough, they are
      basically storage volumes.
      
      v2:
          Skip ., .., lost+found dirs
      
      v3:
          Use gnulib last_component
      
      v4:
          Use gnulib "dirname.h", not system <dirname.h>
          Don't skip lost+found
      8077d64f
  25. 05 3月, 2011 1 次提交
  26. 25 2月, 2011 1 次提交
  27. 23 11月, 2010 2 次提交