1. 21 9月, 2015 1 次提交
    • J
      virfile: Rename virFileUnlink to virFileRemove · 1b046a68
      John Ferlan 提交于
      Similar to commit id '35847860', it's possible to attempt to create
      a 'netfs' directory in an NFS root-squash environment which will cause
      the 'vol-delete' command to fail.  It's also possible error paths from
      the 'vol-create' would result in an error to remove a created directory
      if the permissions were incorrect (and disallowed root access).
      
      Thus rename the virFileUnlink to be virFileRemove to match the C API
      functionality, adjust the code to following using rmdir or unlink
      depending on the path type, and then use/call it for the VIR_STORAGE_VOL_DIR
      1b046a68
  2. 02 9月, 2015 1 次提交
    • J
      virfile: Introduce virFileUnlink · 35847860
      John Ferlan 提交于
      In an NFS root-squashed environment the 'vol-delete' command will fail to
      'unlink' the target volume since it was created under a different uid:gid.
      
      This code continues the concepts introduced in virFileOpenForked and
      virDirCreate[NoFork] with respect to running the unlink command under
      the uid/gid of the child. Unlike the other two, don't retry on EACCES
      (that's why we're here doing this now).
      35847860
  3. 17 7月, 2015 1 次提交
  4. 30 6月, 2015 1 次提交
  5. 16 6月, 2015 2 次提交
    • J
      storage: Generate correct parameters for CIFS · 29230951
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1186969
      
      When generating the path to the dir for a CIFS/Samba driver, the code
      would generate a source path for the mount using "%s:%s" while the
      mount.cifs expects to see "//%s/%s". So check for the cifsfs and
      format the source path appropriately.
      
      Additionally, since there is no means to authenticate, the mount
      needs a "-o guest" on the command line in order to anonymously mount
      the Samba directory.
      29230951
    • J
      storage: Adjust command arglist for gluster · 257250f7
      John Ferlan 提交于
      In order for the glusterfs boolean to be set, the pool->def->type must be
      VIR_STORAGE_POOL_NETFS, thus the check within virCommandNewArgList whether
      pool->def->type is VIR_STORAGE_POOL_FS will never be true, so remove it
      257250f7
  6. 05 6月, 2015 4 次提交
    • J
      storage: Add check for valid FS types in checkPool callback · 94a1579b
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1181087
      
      The virStorageBackendFileSystemIsMounted is called from three source paths
      checkPool, startPool, and stopPool. Both start and stop validate the FS
      fields before calling *IsMounted; however the check path there is no call.
      This could lead the code into returning a true in "isActive" if for some
      reason the target path for the pool was mounted. The assumption being
      that if it was mounted, then we believe we started/mounted it.
      
      It's also of note that commit id '81165294' added an error message for
      the start/mount path regarding that the target is already mounted so
      fail the start. That check was adjusted by commit id '13fde7ce' to
      only message if actually mounted.
      
      At one time this led to the libvirtd restart autostart code to declare
      that the pool was active even though the startPool would inhibit startup
      and the stopPool would inhibit shutdown. The autostart path changed as
      of commit id '2a31c5f0' as part of the keep storage pools started between
      libvirtd restarts.
      
      This patch adds the same check made prior to start/mount and stop/unmount
      to ensure we have a valid configuration before attempting to see if the
      target is already mounted to declare "isActive" or not. Finding an improper
      configuration will now cause an error at checkPool, which should make it
      so we can no longer be left in a situation where the pool was started and
      we have no way to stop it.
      94a1579b
    • J
      storage: FS backend adjust error message on error path · fcf0fd52
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1181087
      
      Currently the assumption on the error message is that there are
      no source device paths defined when the number of devices check
      fails, but in reality the XML could have had none or it could have
      had more than the value supported. Adjust the error message accordingly
      to make it clearer what the error really is.
      fcf0fd52
    • J
      storage: Refactor storage pool type checks · 5a8c98db
      John Ferlan 提交于
      Refactor the code for both startPool (*Mount) and stopPool (*Unmount) code
      paths by introducing virStorageBackendFileSystemIsValid.
      5a8c98db
    • J
      storage: Remove extraneous @conn from function comments · 325a8134
      John Ferlan 提交于
      Over time the parameters changed, but the comment wasn't updated
      325a8134
  7. 27 5月, 2015 1 次提交
  8. 26 5月, 2015 2 次提交
    • C
      storage: fs: Only force directory permissions if required · db1140f1
      Cole Robinson 提交于
      Only set directory permissions at pool build time, if:
      
      - User explicitly requested a mode via the XML
      - The directory needs to be created
      - We need to do the crazy NFS root-squash workaround
      
      This allows qemu:///session to call build on an existing directory
      like /tmp.
      db1140f1
    • C
      storage: conf: Don't set any default <mode> in the XML · 7c2d65dd
      Cole Robinson 提交于
      The XML parser sets a default <mode> if none is explicitly passed in.
      This is then used at pool/vol creation time, and unconditionally reported
      in the XML.
      
      The problem with this approach is that it's impossible for other code
      to determine if the user explicitly requested a storage mode. There
      are some cases where we want to make this distinction, but we currently
      can't.
      
      Handle <mode> parsing like we handle <owner>/<group>: if no value is
      passed in, set it to -1, and adjust the internal consumers to handle
      it.
      7c2d65dd
  9. 20 5月, 2015 1 次提交
  10. 05 5月, 2015 2 次提交
  11. 04 5月, 2015 1 次提交
  12. 16 4月, 2015 1 次提交
  13. 02 4月, 2015 1 次提交
  14. 02 3月, 2015 2 次提交
  15. 12 2月, 2015 1 次提交
    • D
      Allow shrinking of file based volumes · aa9aa6a9
      Daniel P. Berrange 提交于
      While the main storage driver code allows the flag
      VIR_STORAGE_VOL_RESIZE_SHRINK to be set, none of the backend
      drivers are supporting it. At the very least this can work
      for plain file based volumes since we just ftruncate() them
      to the new size. It does not work with qcow2 volumes, but we
      can arguably delegate to qemu-img for error reporting for that
      instead of second guessing this for ourselves:
      
      $ virsh vol-resize --shrink /home/berrange/VirtualMachines/demo.qcow2 2G
      error: Failed to change size of volume 'demo.qcow2' to 2G
      
      error: internal error: Child process (/usr/bin/qemu-img resize /home/berrange/VirtualMachines/demo.qcow2 2147483648) unexpected exit status 1: qemu-img: qcow2 doesn't support shrinking images yet
      qemu-img: This image does not support resize
      
      See also https://bugzilla.redhat.com/show_bug.cgi?id=1021802
      aa9aa6a9
  16. 27 1月, 2015 1 次提交
  17. 05 12月, 2014 1 次提交
  18. 03 12月, 2014 1 次提交
    • J
      Replace virSecretFree with virObjectUnref · a0b13d35
      John Ferlan 提交于
      Since virSecretFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      a0b13d35
  19. 15 11月, 2014 1 次提交
  20. 11 9月, 2014 1 次提交
  21. 29 7月, 2014 1 次提交
    • P
      storage: create: Create files with correct mode · f8cf4962
      Peter Krempa 提交于
      Use correct mode when pre-creating files (for snapshots). The refactor
      changing to storage driver usage caused a regression as some systems
      created the file with 000 permissions forbidding qemu to write the file.
      
      Pass mode to the creating functions to avoid the problem.
      
      Regression since 185e07a5.
      f8cf4962
  22. 24 7月, 2014 2 次提交
  23. 17 7月, 2014 1 次提交
  24. 16 7月, 2014 6 次提交
  25. 11 7月, 2014 1 次提交
  26. 06 6月, 2014 2 次提交