1. 30 4月, 2010 1 次提交
  2. 16 4月, 2010 1 次提交
  3. 14 4月, 2010 2 次提交
  4. 08 4月, 2010 1 次提交
  5. 06 4月, 2010 1 次提交
  6. 20 3月, 2010 1 次提交
  7. 16 3月, 2010 1 次提交
  8. 10 3月, 2010 1 次提交
  9. 05 3月, 2010 1 次提交
    • L
      Change default for storage uid/gid from getuid()/getgid() to -1/-1 · 219305df
      Laine Stump 提交于
      This allows the config to have a setting that means "leave it alone",
      eg when building a pool where the directory already exists the user
      may want the current uid/gid of the directory left intact. This
      actually gets us back to older behavior - before recent changes to the
      pool building code, we weren't as insistent about honoring the uid/gid
      settings in the XML, and virt-manager was taking advantage of this
      behavior.
      
      As a side benefit, removing calls to getuid/getgid from the XML
      parsing functions also seems like a good idea. And having a default
      that is different from a common/useful value (0 == root) is a good
      thing in general, as it removes ambiguity from decisions (at least one
      place in the code was checking for (perms.uid == 0) to see if a
      special uid was requested).
      
      Note that this will only affect newly created pools and volumes. Due
      to the way that the XML is parsed, then formatted for newly created
      volumes, all existing pools/volumes already have an explicit uid and
      gid set.
      
      src/conf/storage_conf.c: Remove calls to setuid/setgid for default values
                               of uid/gid, and set them to -1 instead
      
      src/storage/storage_backend.c:
      src/storage/storage_backend_fs.c:
              Make account for the new default values of perms.uid
              and perms.gid.
      219305df
  10. 04 3月, 2010 1 次提交
  11. 03 3月, 2010 1 次提交
    • J
      Fix safezero() · a64e3b3e
      Jiri Denemark 提交于
      Various safezero() implementations used either -1, errno or -errno
      return values. This patch fixes them all to return -1 and set errno
      appropriately.
      
      There was also a bug in size parameter passed to safewrite() which could
      result in an attempt to write gigabytes out of a megabyte buffer.
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      a64e3b3e
  12. 26 2月, 2010 1 次提交
  13. 24 2月, 2010 1 次提交
    • D
      Format FS pools on creation · b738016b
      Dave Allan 提交于
      Create the filesystem on the partition used by the pool
      * configure.ac: check for mkfs availability
      * libvirt.spec.in: add extra require on util-linux for mkfs
      * src/storage/storage_backend_fs.c: run mkfs with the expected
        fs type when creating a filesystem pool
      b738016b
  14. 22 2月, 2010 1 次提交
    • J
      Create raw storage files with O_DSYNC (again) · 9568c1d9
      Jiri Denemark 提交于
      Recently we introduced O_DSYNC flag when creating raw storage files to
      avoid filling all disk cache with dirty pages. However, the patch got
      lost when virStorageBackendCreateRaw was reworked using
      virFileOperation. Let's use O_DSYNC again.
      9568c1d9
  15. 20 2月, 2010 2 次提交
    • L
      Use virFileOperation hook function in virStorageBackendFileSystemVolBuild · 6ef20bb7
      Laine Stump 提交于
      There were a few operations on the storage volume file that were still
      being done as root, which will fail if the file is on a root-squashed
      NFS share. The result was that attempts to create a storage volume of
      type "raw" on a root-squashed NFS share would fail.
      
      This patch uses the newly introduced "hook" function in
      virFileOperation to execute all those file operations in the child
      process that's run under the uid that owns the file (and, presumably,
      has permission to write to the NFS share)
      
      * src/storage/storage_backend.c: use virFileOperation() in
        virStorageBackendCreateRaw, turning virStorageBackendCreateRaw()
        into a new createRawFileOpHook() hook
      6ef20bb7
    • L
      Rename virFileCreate to virFileOperation, add hook function · fbadc2b6
      Laine Stump 提交于
      It turns out it is also useful to be able to perform other operations
      on a file created while running as a different uid (eg, write things
      to that file), and possibly to do this to a file that already
      exists. This patch adds an optional hook function to the renamed (for
      more accuracy of purpose) virFileOperation; the hook will be called
      after the file has been opened (possibly created) and gid/mode
      checked/set, before closing it.
      
      As with the other operations on the file, if the VIR_FILE_OP_AS_UID
      flag is set, this hook function will be called in the context of a
      child process forked from the process that called virFileOperation.
      The implication here is that, while all data in memory is available to
      this hook function, any modification to that data will not be seen by
      the caller - the only indication in memory of what happened in the
      hook will be the return value (which the hook should set to 0 on
      success, or one of the standard errno values on failure).
      
      Another piece of making the function more flexible was to add an
      "openflags" argument. This arg should contain exactly the flags to be
      passed to open(2), eg O_RDWR | O_EXCL, etc.
      
      In the process of adding the hook to virFileOperation, I also realized
      that the bits to fix up file owner/group/mode settings after creation
      were being done in the parent process, which could fail, so I moved
      them to the child process where they should be.
      
      * src/util/util.[ch]: rename and rework virFileCreate-->virFileOperation,
        and redo flags in virDirCreate
      * storage/storage_backend.c, storage/storage_backend_fs.c: update the
        calls to virFileOperation/virDirCreate to reflect changes in the API,
        but don't yet take advantage of the hook.
      fbadc2b6
  16. 17 2月, 2010 1 次提交
  17. 12 2月, 2010 1 次提交
    • J
      plug four virStoragePoolSourceFree-related leaks · 18e0cc7f
      Jim Meyering 提交于
      * src/conf/storage_conf.c (virStoragePoolDefParseSourceString):
      * src/storage/storage_backend_fs.c:
      (virStorageBackendFileSystemNetFindPoolSourcesFunc):
      (virStorageBackendFileSystemNetFindPoolSources):
      * src/test/test_driver.c (testStorageFindPoolSources):
      18e0cc7f
  18. 10 2月, 2010 2 次提交
    • D
      Remove virConnectPtr from secret XML APIs · c4dcf043
      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 secret_conf.{h,c} and update all callers to
      match
      c4dcf043
    • 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
  19. 09 2月, 2010 5 次提交
  20. 05 2月, 2010 1 次提交
  21. 02 2月, 2010 3 次提交
    • J
      storage_backend.c: avoid closing a negative file descriptor · 3db3acb9
      Jim Meyering 提交于
      * src/storage/storage_backend.c (virStorageBackendRunProgRegex):
      Don't close a negative (read-only) file descriptor.
      3db3acb9
    • J
      avoid format-related warnings · 4cd188d4
      Jim Meyering 提交于
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetAllPCIAddresses):
      Use %s.
      * src/storage/storage_backend_iscsi.c (virStorageBackendCreateIfaceIQN):
      Likewise.
      * tools/virsh.c (cmdSecretSetValue): Likewise.
      4cd188d4
    • E
      maint: avoid excess parens in STREQ · 6b8d8395
      Eric Blake 提交于
      * src/internal.h (STREQ, STRCASEEQ, STRNEQ, STRCASENEQ, STREQLEN)
      (STRCASEEQLEN, STRNEQLEN, STRCASENEQLEN, STRPREFIX): Avoid
      redundant parenthesis.
      * examples/domain-events/events-c/event-test.c (STREQ): Likewise.
      * src/storage/parthelper.c (STREQ): Likewise.
      6b8d8395
  22. 22 1月, 2010 1 次提交
  23. 21 1月, 2010 3 次提交
    • D
      Implement support for multi IQN · 6aabcb5b
      David Allan 提交于
      Allows the initiator to use a variety of IQNs rather than just the
      system IQN when creating iSCSI pools.
      * docs/schemas/storagepool.rng: extends the syntax with <iqn name="..."/>
      * src/conf/storage_conf.[ch]: read and stores the iqn name
      * src/storage/storage_backend_iscsi.[ch]: implement the IQN selection
        when detected
      6aabcb5b
    • L
      Create storage pool directories with proper uid/gid/mode · 62927dd8
      Laine Stump 提交于
      Previously the uid/gid/mode in the xml was ignored when creating new
      storage pool directories. This commit attempts to honor the requested
      permissions, and spits out an error if it can't.
      
      Note that when creating the directory, the rest of the path leading up
      to the final element is created using current uid/gid/mode, and the
      final element gets the settings from xml. It is NOT an error for the
      directory to already exist; in this case, the perms for the existing
      directory are just set (if necessary).
      
      * src/storage/storage_backend_fs.c: update the virStorageBackendFileSystemBuild
        function to check the directory hierarchy separately then create the
        leaf directory with the right attributes
      62927dd8
    • 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
  24. 18 1月, 2010 2 次提交
  25. 07 1月, 2010 1 次提交
    • D
      Don't update vol details after build · 1c06eb18
      David Allan 提交于
      This patch removes the call to vol update after the volume build completes.
      The update call is currently meaningless anyway because the vol build is passed
      a copy of the definition, so the update result is thrown away.  More
      importantly, if the user specified a selinux label for the volume, the update
      call results in a double free of the label
      * src/storage/storage_backend_fs.c: remove the update call
      1c06eb18
  26. 18 12月, 2009 1 次提交
  27. 14 12月, 2009 1 次提交
  28. 11 12月, 2009 1 次提交