1. 23 11月, 2010 1 次提交
    • D
      Check whether pools are already active upon libvirtd startup · 1b7e0b1a
      Daniel P. Berrange 提交于
      When libvirt starts up all storage pools default to the inactive
      state, even if the underlying storage is already active on the
      host. This introduces a new API into the internal storage backend
      drivers that checks whether a storage pool is already active. If
      the pool is active at libvirtd startup, the volume list will be
      immediately populated.
      
      * src/storage/storage_backend.h: New internal API for checking
        storage pool state
      * src/storage/storage_driver.c: Check whether a pool is active
        upon driver startup
      * src/storage/storage_backend_fs.c, src/storage/storage_backend_iscsi.c,
        src/storage/storage_backend_logical.c, src/storage/storage_backend_mpath.c,
        src/storage/storage_backend_scsi.c: Add checks for pool state
      1b7e0b1a
  2. 29 5月, 2010 2 次提交
    • J
      build: make cpp indentation conform · f9a4df5a
      Jim Meyering 提交于
      * src/storage/storage_backend.h (VIR_STORAGE_VOL_OPEN_DEFAULT):
      Adjust s/#define/# define/, and align continued lines.
      f9a4df5a
    • C
      storage: Check for invalid storage mode before opening · 4a1abb3f
      Cole Robinson 提交于
      If a directory pool contains pipes or sockets, a pool start can fail or hang:
      
      https://bugzilla.redhat.com/show_bug.cgi?id=589577
      
      We already try to avoid these special files, but only attempt after
      opening the path, which is where the problems lie. Unify volume opening
      into helper functions, which use the proper open() flags to avoid error,
      followed by fstat to validate storage mode.
      
      Previously, virStorageBackendUpdateVolTargetInfoFD attempted to enforce the
      storage mode check, but allowed callers to detect this case and silently
      continue. In practice, only the FS backend was using this feature, the rest
      were treating unknown mode as an error condition. Unfortunately the InfoFD
      function wasn't raising an error message here, so error reporting was
      busted.
      
      This patch adds 2 functions: virStorageBackendVolOpen, and
      virStorageBackendVolOpenModeSkip. The latter retains the original opt out
      semantics, the former now throws an explicit error.
      
      This patch maintains the previous volume mode checks: allowing specific
      modes for specific pool types requires a bit of surgery, since VolOpen
      is called through several different helper functions.
      
      v2: Use ATTRIBUTE_NONNULL. Drop stat check, just open with
          O_NONBLOCK|O_NOCTTY.
      
      v3: Move mode check logic back to VolOpen. Use 2 VolOpen functions with
          different error semantics.
      
      v4: Make second VolOpen function more extensible. Didn't opt to change
          FS backend defaults, this can just be to fix the original bug.
      
      v5: Prefix default flags with VIR_, use ATTRIBUTE_RETURN_CHECK
      4a1abb3f
  3. 24 5月, 2010 1 次提交
    • C
      storage: Combine some duplicate code · e40a285b
      Cole Robinson 提交于
      Volume detection in the scsi backend was duplicating code already
      present in storage_backend.c. Let's drop the duplicate code.
      
      Also, change the shared function name to be less generic, and remove
      some error squashing in the other call site.
      e40a285b
  4. 10 3月, 2010 1 次提交
  5. 10 2月, 2010 1 次提交
    • D
      Remove virConnectPtr from storage APIs & driver · 03136638
      Daniel P. Berrange 提交于
      The virConnectPtr is no longer required for error reporting since
      that is recorded in a thread local. Remove use of virConnectPtr
      from all APIs in storage_conf.{h,c} and storage_encryption_conf.{h,c}
      and update all callers to match
      03136638
  6. 09 2月, 2010 1 次提交
  7. 21 1月, 2010 1 次提交
    • L
      Create storage volumes directly with desired uid/gid · e1f27784
      Laine Stump 提交于
      In order to avoid problems trying to chown files that were created by
      root on a root-squashing nfs server, fork a new process that setuid's
      to the desired uid before creating the file. (It's only done this way
      if the pool containing the new volume is of type 'netfs', otherwise
      the old method of creating the file followed by chown() is used.)
      
      This changes the semantics of the "create_func" slightly - previously
      it was assumed that this function just created the file, then the
      caller would chown it to the desired uid. Now, create_func does both
      operations.
      
      There are multiple functions that can take on the role of create_func:
      
      createFileDir - previously called mkdir(), now calls virDirCreate().
      virStorageBackendCreateRaw - previously called open(),
                                   now calls virFileCreate().
      virStorageBackendCreateQemuImg - use virRunWithHook() to setuid/gid.
      virStorageBackendCreateQcowCreate - same.
      virStorageBackendCreateBlockFrom - preserve old behavior (but attempt
                                         chown when necessary even if not root)
      
      * src/storage/storage_backend.[ch] src/storage/storage_backend_disk.c
        src/storage/storage_backend_fs.c src/storage/storage_backend_logical.c
        src/storage/storage_driver.c: change the create_func implementations,
        also propagate the pool information to be able to detect NETFS ones.
      e1f27784
  8. 18 1月, 2010 1 次提交
  9. 21 9月, 2009 1 次提交
  10. 10 9月, 2009 1 次提交
    • D
      Fix use of dlopen modules · fcd4e269
      Daniel P. Berrange 提交于
      Remove the bogus dependancy between node_device.c & storage_backend.c
      by moving the virWaitForDevices into util.h where it can be shared
      safely
      
      * src/storage_backend_disk.c, src/storage_backend_logical.c,
        src/storage_backend_mpath.c, src/storage_backend_scsi.c: Replace
        virStorageBackendWaitForDevices with virFileWaitForDevices
      * src/storage_backend.c, src/storage_backend.h: Remove
        virStorageBackendWaitForDevices, virWaitForDevices
      * src/util.h, src/util.c: Add virFileWaitForDevices
      * configure.in: Move xmlrpc check further down after pkgconfig
        is detected
      * src/Makefile.am: Add missing XMLRPC_CFLAGS/LIBS to opennebula
      * src/libvirt_private.syms: Add many missing exports
      fcd4e269
  11. 08 9月, 2009 1 次提交
    • D
      Multipath storage support module · ee8a06f8
      Dave Allan 提交于
      * configure.in src/Makefile.am src/storage_backend.[ch]
        src/storage_conf.[ch] src/storage_backend_mpath.[ch] po/POTFILES.in:
        add a new module for storage multipath, it requires device-mapper
      ee8a06f8
  12. 17 7月, 2009 2 次提交
  13. 17 6月, 2009 1 次提交
  14. 19 5月, 2009 1 次提交
  15. 18 4月, 2009 1 次提交
    • D
      drop the pool lock when allocating fs volumes · 2cd9b2d8
      Daniel Veillard 提交于
      * src/libvirt_private.syms src/storage_backend.h
        src/storage_backend_fs.c src/storage_conf.h src/storage_driver.c:
        drop the pool lock when allocating fs volumes, patch by Cole Robinson
      daniel
      2cd9b2d8
  16. 28 1月, 2009 1 次提交
  17. 28 11月, 2008 1 次提交
  18. 17 11月, 2008 1 次提交
  19. 13 11月, 2008 1 次提交
  20. 11 11月, 2008 1 次提交
  21. 03 11月, 2008 1 次提交
    • C
      Give iSCSI and disk storage backend drivers the · 17a9e03c
      Chris Lalancette 提交于
      ability to resolve any kind of volume path to the pool target volume
      path.  For instance, if the pool was defined with a
      <target><path>/dev/disk/by-id</path></target> section, and one of the
      volumes is /dev/disk/by-id/scsi-S_beaf11, then you would be able to
      call virStorageVolLookupByPath("/dev/sdc"), and get the correct volume
      back.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      17a9e03c
  22. 23 10月, 2008 1 次提交
  23. 16 10月, 2008 1 次提交
    • C
      Add support for detecting the partition table type when scanning · eeff3cdc
      Chris Lalancette 提交于
      iSCSI volumes.  This is implemented in the
      virStorageBackendUpdateVolInfoFD function, so all future callers will
      automatically benefit.  This is a somewhat large patch because the
      conversion of the virStorageBackendPartTableTypeToString necessitated
      a change to the formatToString and formatFromString function pointers,
      which caused fallout in other places in the storage stuff.  The good
      news is that most of these callers are now converted over to the
      VIR_ENUM_IMPL, which means a lot of redundant code is now gone.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      eeff3cdc
  24. 02 9月, 2008 1 次提交
    • D
      Adds storage source element for pools · 41ce15a5
      Daniel Veillard 提交于
      * src/storage_backend.h src/storage_backend_logical.c
      src/storage_conf.c src/storage_conf.h src/virsh.c:
      Applied patches from David Lively to add storage source
      elements needed for storage pool
      * docs/formatstorage.html docs/formatstorage.html.in: associated
      documentation
      Daniel
      41ce15a5
  25. 28 8月, 2008 1 次提交
  26. 24 6月, 2008 1 次提交
  27. 17 6月, 2008 1 次提交
  28. 11 4月, 2008 1 次提交
  29. 20 2月, 2008 2 次提交