1. 30 4月, 2010 1 次提交
  2. 08 4月, 2010 1 次提交
  3. 16 3月, 2010 1 次提交
  4. 10 3月, 2010 1 次提交
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 09 2月, 2010 4 次提交
  11. 02 2月, 2010 1 次提交
  12. 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
  13. 11 12月, 2009 1 次提交
  14. 10 12月, 2009 1 次提交
    • M
      Add virBufferFreeAndReset() and replace free() · 1b9d0744
      Matthias Bolte 提交于
      Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
      Update documentation and replace all remaining calls to free() with
      calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
      and virReportOOMError() in OOM error cases.
      1b9d0744
  15. 03 11月, 2009 1 次提交
    • C
      Fix up NLS warnings. · 991be604
      Chris Lalancette 提交于
      When building with --disable-nls, I got a few messages like this:
      
      storage/storage_backend.c: In function 'virStorageBackendCreateQemuImg':
      storage/storage_backend.c:571: warning: format not a string literal and no format arguments
      
      Fix these up.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      991be604
  16. 30 9月, 2009 1 次提交
    • M
      Move file format enum to libvirt_util · 00fd3ff4
      Mark McLoughlin 提交于
      Rename virStorageVolFormatFileSystem to virStorageFileFormat and
      move to src/util/storage_file.[ch]
      
      * src/Makefile.am: add src/util/storage_file.[ch]
      
      * src/conf/storage_conf.[ch]: move enum from here ...
      
      * src/util/storage_file.[ch]: .. to here
      
      * src/libvirt_private.syms: update To/FromString exports
      
      * src/storage/storage_backend.c, src/storage/storage_backend_fs.c,
        src/vbox/vbox_tmpl.c: update for above changes
      00fd3ff4
  17. 21 9月, 2009 2 次提交
  18. 15 9月, 2009 1 次提交
    • D
      Fix UUID handling in secrets/storage encryption APIs · 47e7a258
      Daniel P. Berrange 提交于
      Convert all the secret/storage encryption APIs / wire format to
      handle UUIDs in raw format instead of non-canonical printable
      format. Guarentees data format correctness.
      
      * docs/schemas/storageencryption.rng: Make UUID mandatory for a secret
        and validate fully
      * docs/schemas/secret.rng: Fully validate UUID
      * include/libvirt/libvirt.h, include/libvirt/libvirt.h.in, Add
        virSecretLookupByUUID and virSecretGetUUID. Make
        virSecretGetUUIDString follow normal API design pattern
      * python/generator.py: Skip generation of virSecretGetUUID,
        virSecretGetUUIDString and virSecretLookupByUUID
      * python/libvir.c, python/libvirt-python-api.xml: Manual impl
        of virSecretGetUUID,virSecretGetUUIDString and virSecretLookupByUUID
      * qemud/remote.c: s/virSecretLookupByUUIDString/virSecretLookupByUUID/
        Fix get_nonnull_secret/make_nonnull_secret to use unsigned char
      * qemud/remote_protocol.x: Fix remote_nonnull_secret to use a
        remote_uuid instead of remote_nonnull_string for UUID field.
        Rename REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING to
        REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING and make it take an
        remote_uuid  value
      * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h,
        qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h,
        qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate
      * src/datatypes.h, src/datatypes.c: Store UUID in raw format instead
        of printable. Change virGetSecret to use raw format UUID
      * src/driver.h: Rename virDrvSecretLookupByUUIDString to
        virDrvSecretLookupByUUID and use raw format UUID
      * src/libvirt.c: Add virSecretLookupByUUID and virSecretGetUUID
        and re-implement virSecretLookupByUUIDString and
        virSecretGetUUIDString in terms of those
      * src/libvirt_public.syms: Add virSecretLookupByUUID and
        virSecretGetUUID
      * src/remote_internal.c: Rename remoteSecretLookupByUUIDString
        to remoteSecretLookupByUUID. Fix typo in args for
        remoteSecretDefineXML impl. Use raw UUID format for
        get_nonnull_secret and make_nonnull_secret
      * src/storage_encryption_conf.c, src/storage_encryption_conf.h:
        Storage UUID in raw format, and require it to be present in
        XML. Use UUID parser to validate.
      * secret_conf.h, secret_conf.c: Generate a UUID if none is provided.
        Storage UUID in raw format.
      * src/secret_driver.c: Adjust to deal with raw UUIDs. Save secrets
        in a filed with printable UUID, instead of base64 UUID.
      * src/virsh.c: Adjust for changed public API contract of
        virSecretGetUUIDString.
      * src/storage_Backend.c: DOn't undefine secret we just generated
        upon successful volume creation. Fix to handle raw UUIDs. Generate
        a non-clashing UUID
      * src/qemu_driver.c: Change to use lookupByUUID instead of
        lookupByUUIDString
      47e7a258
  19. 11 9月, 2009 1 次提交
    • M
      Provide missing passphrase when creating a volume. · cd6a9334
      Miloslav Trmač 提交于
      If the <encryption format='qcow'> element does not specify a secret
      during volume creation, generate a suitable secret and add it to the
      <encryption> tag.  The caller can view the updated <encryption> tag
      using virStorageVolGetXMLDesc().
      
      Similarly, when <encryption format='default'/> is specified while
      creating a qcow or qcow2-formatted volume, change the format to "qcow"
      and generate a secret as described above.
      
      * src/storage_encryption_conf.h (VIR_STORAGE_QCOW_PASSPHRASE_SIZE,
        virStorageGenerateQcowPasphrase),
        src/storage_encryption_conf.c (virStorageGenerateQcowPasphrase),
        src/libvirt_private.syms: Add virStorageGenerateQcowPasphrase().
      * src/storage_backend.c (virStoragegenerateQcowEncryption,
        virStorageBackendCreateQemuImg): Generate a passphrase and
        <encryption> when creating a qcow-formatted encrypted volume and the
        user did not supply the information.
      cd6a9334
  20. 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
  21. 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
  22. 04 9月, 2009 1 次提交
  23. 02 9月, 2009 1 次提交
    • M
      Add support for encrypted (qcow) volume creation. · 46acb0f2
      Miloslav Trmač 提交于
      Supports only virStorageVolCreateXML, not virStorageVolCreateXMLFrom.
      
      Curiously, qemu-img does not need the passphrase for anything to create
      an encrypted volume.  This implementation thus does not need to touch
      any secrets to work with cooperating clients.  More generic passphrase
      handling is added in the next patch.
      
      * src/storage_backend.c: Request encryption when creating qcow/qcow2
        files
      * src/storage_backend_disk.c, src/storage_backend_fs.c,
        src/storage_backend_logical.c: Refuse to create volumes with
        encryption params set.
      46acb0f2
  24. 05 8月, 2009 1 次提交
  25. 24 7月, 2009 1 次提交
  26. 22 7月, 2009 1 次提交
  27. 17 7月, 2009 5 次提交
  28. 16 7月, 2009 1 次提交
    • J
      remove all trailing blank lines · 07613d20
      Jim Meyering 提交于
      by running this command:
      git ls-files -z | xargs -0 perl -pi -0777 -e 's/\n\n+$/\n/'
      This is in preparation for a more strict make syntax-check
      rule that will detect trailing blank lines.
      07613d20
  29. 17 6月, 2009 1 次提交
  30. 02 6月, 2009 1 次提交
    • D
      NPIV implementation for node device create and destroy · 81d0ffbc
      Daniel Veillard 提交于
      * src/Makefile.am src/node_device.[ch] src/node_device_conf.[ch]
        src/node_device_hal.[ch] src/node_device_hal_linux.c
        src/qemu_driver.c src/remote_internal.c src/storage_backend.c
        src/virsh.c src/xen_unified.c tests/nodedevxml2xmltest.c
        po/POTFILES.in: implementation for node device create and destroy
        in NPIV support, patch by David Allan
      Daniel
      81d0ffbc