1. 10 8月, 2012 1 次提交
    • E
      build: fix PROBE() usage of intptr_t · 51ee43aa
      Eric Blake 提交于
      Otherwise, in locations like virobject.c where PROBE is used,
      for certain configure options, the compiler warns:
      
      util/virobject.c:110:1: error: 'intptr_t' undeclared (first use in this function)
      
      As long as we are making this header always available, we can
      clean up several other files.
      
      * src/internal.h (includes): Pull in <stdint.h>.
      * src/conf/nwfilter_conf.h: Rely on internal.h.
      * src/storage/storage_backend.c: Likewise.
      * src/storage/storage_backend.h: Likewise.
      * src/util/cgroup.c: Likewise.
      * src/util/sexpr.h: Likewise.
      * src/util/virhashcode.h: Likewise.
      * src/util/virnetdevvportprofile.h: Likewise.
      * src/util/virnetlink.h: Likewise.
      * src/util/virrandom.h: Likewise.
      * src/vbox/vbox_driver.c: Likewise.
      * src/xenapi/xenapi_driver.c: Likewise.
      * src/xenapi/xenapi_utils.c: Likewise.
      * src/xenapi/xenapi_utils.h: Likewise.
      * src/xenxs/xenxs_private.h: Likewise.
      * tests/storagebackendsheepdogtest.c: Likewise.
      51ee43aa
  2. 03 8月, 2012 1 次提交
    • H
      Added timestamps to storage volumes · 7383c1d7
      Hendrik Schwartke 提交于
      The access, birth, modification and change times are added to
      storage volumes and corresponding xml representations.  This
      shows up in the XML in this format:
      
      <timestamps>
        <atime>1341933637.027319099</atime>
        <mtime>1341933637.027319099</mtime>
      </timestamps>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7383c1d7
  3. 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
  4. 19 7月, 2012 2 次提交
    • S
      Add a sheepdog backend for the storage driver · 29bc4fe6
      Sebastian Wiedenroth 提交于
      This patch brings support to manage sheepdog pools and volumes to libvirt.
      It uses the "collie" command-line utility that comes with sheepdog for that.
      
      A sheepdog pool in libvirt maps to a sheepdog cluster.
      It needs a host and port to connect to, which in most cases
      is just going to be the default of localhost on port 7000.
      
      A sheepdog volume in libvirt maps to a sheepdog vdi.
      To create one specify the pool, a name and the capacity.
      Volumes can also be resized later.
      
      In the volume XML the vdi name has to be put into the <target><path>.
      To use the volume as a disk source for virtual machines specify
      the vdi name as "name" attribute of the <source>.
      The host and port information from the pool are specified inside the host tag.
      
        <disk type='network'>
          ...
          <source protocol="sheepdog" name="vdi_name">
            <host name="localhost" port="7000"/>
          </source>
        </disk>
      
      To work right this patch parses the output of collie,
      so it relies on the raw output option. There recently was a bug which caused
      size information to be reported wrong. This is fixed upstream already and
      will be in the next release.
      Signed-off-by: NSebastian Wiedenroth <wiedi@frubar.net>
      29bc4fe6
    • D
      Replace use of virStorageReportError with virReportError · d8a1c4c4
      Daniel P. Berrange 提交于
      Update the storage driver to use virReportError instead of
      the virStorageReportError custom macro
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d8a1c4c4
  5. 12 7月, 2012 1 次提交
  6. 22 5月, 2012 1 次提交
    • W
      storage backend: Add RBD (RADOS Block Device) support · 74951ead
      Wido den Hollander 提交于
      This patch adds support for a new storage backend with RBD support.
      
      RBD is the RADOS Block Device and is part of the Ceph distributed storage
      system.
      
      It comes in two flavours: Qemu-RBD and Kernel RBD, this storage backend only
      supports Qemu-RBD, thus limiting the use of this storage driver to Qemu only.
      
      To function this backend relies on librbd and librados being present on the
      local system.
      
      The backend also supports Cephx authentication for safe authentication with
      the Ceph cluster.
      
      For storing credentials it uses the built-in secret mechanism of libvirt.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      74951ead
  7. 08 2月, 2012 1 次提交
    • C
      storage: Don't unsparsify images when cloning · 0ed86cfb
      Cole Robinson 提交于
      Input to the volume cloning code is a source volume and an XML
      descriptor for the new volume. It is possible for the new volume
      to have a greater size than source volume, at which point libvirt
      will just stick 0s on the end of the new image (for raw format
      anyways).
      
      Unfortunately a logic error messed up our tracking of the of the
      excess amount that needed to be written: end result is that sparse
      clones were made very much non-sparse, and cloning regular disk
      images could end up excessively sized (though data unaltered).
      
      Drop the 'remain' variable entriely here since it's redundant, and
      track actual allocation directly against the desired 'total'.
      0ed86cfb
  8. 04 2月, 2012 1 次提交
    • L
      util: refactor virFileOpenAs · 90e4d681
      Laine Stump 提交于
      virFileOpenAs previously would only try opening a file as the current
      user, or as a different user, but wouldn't try both methods in a
      single call. This made it cumbersome to use as a replacement for
      open(2). Additionally, it had a lot of historical baggage that led to
      it being difficult to understand.
      
      This patch refactors virFileOpenAs in the following ways:
      
      * reorganize the code so that everything dealing with both the parent
        and child sides of the "fork+setuid+setgid+open" method are in a
        separate function. This makes the public function easier to understand.
      
      * Allow a single call to virFileOpenAs() to first attempt the open as
        the current user, and if that fails to automatically re-try after
        doing fork+setuid (if deemed appropriate, i.e. errno indicates it
        would now be successful, and the file is on a networkFS). This makes
        it possible (in many, but possibly not all, cases) to drop-in
        virFileOpenAs() as a replacement for open(2).
      
        (NB: currently qemuOpenFile() calls virFileOpenAs() twice, once
        without forking, then again with forking. That unfortunately can't
        be changed without at least some discussion of the ramifications,
        because the requested file permissions are different in each case,
        which is something that a single call to virFileOpenAs() can't deal
        with.)
      
      * Add a flag so that any fchown() of the file to a different uid:gid
        is explicitly requested when the function is called, rather than it
        being implied by the presence of the O_CREAT flag. This just makes
        for less subtle surprises to consumers. (Commit
        b1643dc1 added the check for O_CREAT
        before forcing ownership. This patch just makes that restriction
        more explicit.)
      
      * If either the uid or gid is specified as "-1", virFileOpenAs will
        interpret this to mean "the current [gu]id".
      
      All current consumers of virFileOpenAs should retain their present
      behavior (after a few minor changes to their setup code and
      arguments).
      90e4d681
  9. 26 1月, 2012 1 次提交
    • C
      storage: Fix any VolLookupByPath if we have an empty logical pool · 275155f6
      Cole Robinson 提交于
      On F16 at least, empty volume groups don't have a directory under /dev.
      The directory only appears once a logical volume is created.
      
      This tickles some behavior in BackendStablePath which ends with
      libvirt sleeping for 5 seconds while waiting for the directory to appear.
      This causes all sorts of problems for the virStorageVolLookupByPath API
      which virtinst uses, even if trying to resolve a path that is independent
      of the logical pool.
      
      In reality we don't even need to do that checking since logical pools
      always have a stable target path. Short circuit the polling in that
      case.
      
      Fixes bug 782261
      275155f6
  10. 25 11月, 2011 2 次提交
  11. 27 10月, 2011 1 次提交
    • E
      storage: avoid null deref on qemu-img failure · c04beb5d
      Eric Blake 提交于
      Detected by Coverity.  Only possible if qemu-img gives bogus output,
      but we might as well be robust.
      
      * src/storage/storage_backend.c
      (virStorageBackendQEMUImgBackingFormat): Check for strstr failure.
      c04beb5d
  12. 01 10月, 2011 1 次提交
    • S
      lvm storage backend: handle command_names=1 in lvm.conf · 30f555c6
      Serge E. Hallyn 提交于
      If the regexes supported (?:pvs)?, then we could handle this by
      optionally matching but not returning the initial command name.  But it
      doesn't.  So add a new char* argument to
      virStorageBackendRunProgRegex().  If that argument is NULL then we act
      as usual.  Otherwise, if the string at that argument is found at the
      start of a returned line, we drop that before running the regex.
      
      With this patch, virt-manager shows me lvs with command_names 1 or 0.
      
      The definitions of PVS_BASE etc may want to be moved into the configure
      scripts (though given how PVS is found, IIUC that could only happen if
      pvs was a link to pvs_real), but in any case no sense dealing with that
      until we're sure this is an ok way to handle it.
      Signed-off-by: NSerge Hallyn <serge.hallyn@canonical.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      30f555c6
  13. 01 9月, 2011 1 次提交
  14. 23 8月, 2011 1 次提交
  15. 19 8月, 2011 1 次提交
    • M
      storage: Flush host cache after write · b32f8b19
      Michal Privoznik 提交于
      Although we are flushing cache after some critical writes (e.g.
      volume creation), after some others we do not (e.g. volume cloning).
      This patch fix this issue. That is for volume cloning, writing
      header of logical volume, and storage wipe.
      b32f8b19
  16. 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
  17. 13 7月, 2011 1 次提交
    • E
      storage: reject unknown flags · 64bd1b9d
      Eric Blake 提交于
      * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom)
      (virStorageBackendCreateQemuImg)
      (virStorageBackendCreateQcowCreate): Reject unknown flags.
      * src/storage/storage_backend_disk.c (virStorageBackendDiskBuildPool)
      (virStorageBackendDiskDeleteVol): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemNetFindPoolSources)
      (virStorageBackendFileSystemBuild)
      (virStorageBackendFileSystemDelete, createFileDir)
      (virStorageBackendFileSystemVolBuildFrom)
      (virStorageBackendFileSystemVolDelete): Likewise.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIFindPoolSources): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalFindPoolSources)
      (virStorageBackendLogicalBuildPool)
      (virStorageBackendLogicalDeletePool)
      (virStorageBackendLogicalDeleteVol): Likewise.
      * src/storage/storage_driver.c (storageOpen, storagePoolCreate)
      (storagePoolDefine, storagePoolRefresh, storagePoolGetXMLDesc)
      (storageVolumeCreateXML, storageVolumeCreateXMLFrom)
      (storageVolumeGetXMLDesc): Likewise.
      64bd1b9d
  18. 08 7月, 2011 1 次提交
    • E
      util: drop unused safezero argument · 17da0669
      Eric Blake 提交于
      No caller was using the flags argument, and this function is internal
      only, so we might as well skip it.
      
      * src/util/util.h (safezero): Update signature.
      * src/util/util.c (safezero): Update function.
      * src/locking/lock_driver_sanlock.c
      (virLockManagerSanlockSetupLockspace)
      (virLockManagerSanlockCreateLease): Update all callers.
      * src/storage/storage_backend.c (createRawFile): Likewise.
      17da0669
  19. 04 7月, 2011 1 次提交
    • O
      storage: Do not override the exact error of createRawFile · 49826eda
      Osier Yang 提交于
      virStorageBackendCreateRaw: createRawFile already reported the
      exact error.
      
      Before the fix:
      
      error: Failed to create vol vol-create.img
      error: cannot create path '/var/lib/libvirt/images/vol-create.img': Unknown error 18446744073709551597
      
      After the fix:
      
      error: Failed to create vol vol-create.img
      error: cannot fill file '/var/lib/libvirt/images/vol-create.img': No space left on device
      49826eda
  20. 17 6月, 2011 1 次提交
    • D
      Fix errno return in safezero() · a8182206
      Daniel P. Berrange 提交于
      Most of the safezero() implementations return -1 on error,
      setting errno. The safezero() impl using posix_fallocate()
      though returned a positive errno value on error (due to
      the unusual API contract of posix_fallocate() compared to
      most syscall APIs).
      
      * src/util/util.c: Ensure safezero() returns -1 and sets
        errno on error.
      * src/storage/storage_backend.c: Change safezero != 0 to
        < 0 for detecting errors
      a8182206
  21. 14 6月, 2011 1 次提交
  22. 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
  23. 24 5月, 2011 2 次提交
  24. 23 5月, 2011 1 次提交
  25. 17 5月, 2011 3 次提交
  26. 14 5月, 2011 1 次提交
  27. 12 4月, 2011 1 次提交
    • E
      maint: fix grammar errors · 99fa3080
      Eric Blake 提交于
      Jim Meyering recently improved gnulib to catch various grammar
      errors during 'make syntax-check'.
      
      * .gnulib: Update to latest, for syntax-check improvements.
      * include/libvirt/libvirt.h.in (virConnectAuthCallbackPtr): Use
      cannot rather than two words.
      * src/driver.c: Likewise.
      * src/driver.h (VIR_SECRET_GET_VALUE_INTERNAL_CALL): Likewise.
      * src/remote/remote_driver.c (initialize_gnutls): Likewise.
      * src/util/pci.c (pciBindDeviceToStub): Likewise.
      * src/storage/storage_backend.c (virStorageBackendCreateQemuImg):
      Likewise.
      (virStorageBackendUpdateVolTargetInfoFD): Avoid doubled word.
      * docs/formatdomain.html.in: Likewise.
      * src/qemu/qemu_process.c (qemuProcessStart): Likewise.
      * cfg.mk (exclude_file_name_regexp--sc_prohibit_can_not)
      (exclude_file_name_regexp--sc_prohibit_doubled_word): Exclude
      existing translation problems.
      99fa3080
  28. 05 4月, 2011 1 次提交
    • J
      Allow relative path for qemu backing file · 33da939b
      Jesse Cook 提交于
      This patch enables the relative backing file path support provided by
      qemu-img create.
      
      If a relative path is specified for the backing file, it is converted
      to an absolute path using the storage pool path. The absolute path is
      used to verify that the backing file exists. If the backing file exists,
      the relative path is allowed and will be provided to qemu-img create.
      33da939b
  29. 29 3月, 2011 3 次提交
    • E
      qemu, storage: improve type safety · 1a369dfb
      Eric Blake 提交于
      * src/storage/storage_backend.c (createRawFileOpHook): Change
      signature.
      (struct createRawFileOpHookData): Delete unused struct.
      (virStorageBackendCreateRaw): Adjust caller.
      * src/qemu/qemu_driver.c (struct fileOpHookData): Delete unused
      struct.
      (qemudDomainSaveFileOpHook): Rename...
      (qemuDomainSaveFileOpHook): ...and change signature.
      (qemudDomainSaveFlag): Adjust caller.
      1a369dfb
    • E
      util: rename virFileOperation to virFileOpenAs · 1fdd50f9
      Eric Blake 提交于
      This patch intentionally doesn't change indentation, in order to
      make it easier to review the real changes.
      
      * src/util/util.h (VIR_FILE_OP_RETURN_FD, virFileOperationHook):
      Delete.
      (virFileOperation): Rename...
      (virFileOpenAs): ...and reduce parameters.
      * src/util/util.c (virFileOperationNoFork, virFileOperation):
      Rename and simplify.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Adjust caller.
      * src/storage/storage_backend.c (virStorageBackendCreateRaw):
      Likewise.
      * src/libvirt_private.syms: Reflect rename.
      1fdd50f9
    • E
      storage: simplify fd handling · fe303a42
      Eric Blake 提交于
      * src/storage/storage_backend.c (virStorageBackendCreateRaw): Use
      new virFileOperation flag.
      fe303a42
  30. 25 3月, 2011 1 次提交
    • E
      command: properly diagnose process exit via signal · 208a044a
      Eric Blake 提交于
      Child processes don't always reach _exit(); if they die from a
      signal, then any messages should still be accurate.  Most users
      either expect a 0 status (thankfully, if status==0, then
      WIFEXITED(status) is true and WEXITSTATUS(status)==0 for all
      known platforms) or were filtering on WIFEXITED before printing
      a status, but a few were missing this check.  Additionally,
      nwfilter_ebiptables_driver was making an assumption that works
      on Linux (where WEXITSTATUS shifts and WTERMSIG just masks)
      but fails on other platforms (where WEXITSTATUS just masks and
      WTERMSIG shifts).
      
      * src/util/command.h (virCommandTranslateStatus): New helper.
      * src/libvirt_private.syms (command.h): Export it.
      * src/util/command.c (virCommandTranslateStatus): New function.
      (virCommandWait): Use it to also diagnose status from signals.
      * src/security/security_apparmor.c (load_profile): Likewise.
      * src/storage/storage_backend.c
      (virStorageBackendQEMUImgBackingFormat): Likewise.
      * src/util/util.c (virExecDaemonize, virRunWithHook)
      (virFileOperation, virDirCreate): Likewise.
      * daemon/remote.c (remoteDispatchAuthPolkit): Likewise.
      * src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesExecCLI):
      Likewise.
      208a044a
  31. 15 3月, 2011 1 次提交
  32. 10 3月, 2011 2 次提交