1. 19 7月, 2012 2 次提交
  2. 12 7月, 2012 2 次提交
  3. 11 7月, 2012 1 次提交
    • S
      Fix directory removal in filesystem storage driver · 5079a7b3
      Sascha Peilicke 提交于
      Fix the virStorageBackendFileSystemVolDelete method to not use
      unlink() unconditionally. It must use rmdir() for volumes which
      are directories. It should also raise an error if given a volume
      which has the network/block type.
      5079a7b3
  4. 10 7月, 2012 1 次提交
  5. 09 7月, 2012 3 次提交
  6. 28 6月, 2012 1 次提交
  7. 25 6月, 2012 3 次提交
    • W
      storage backend rbd: Do not prefix rbd: on volume names. · 97485bd0
      Wido den Hollander 提交于
      We used to prefix 'rbd:' to volume names, this is not necessary.
      
      Qemu takes RBD devices in this way, like: qemu -drive rbd:pool/image
      
      When attaching a network disk like RBD to a guest we however do not use this prefix.
      
      Currently you can't map a RBD volume name directly to a domain without removing the prefix.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      97485bd0
    • M
      storage: Introduce --inactive for pool-dumpxml · 8d27005b
      Michal Privoznik 提交于
      Storage is one of the last domains in libvirt where we don't fully
      utilize inactive and live XML. Okay, it might be because we don't
      have support for that. So implement such support. However, we need
      to fallback when talking to old daemon which doesn't support this
      new flag called VIR_STORAGE_XML_INACTIVE.
      8d27005b
    • M
      storage: Switch to new def on pool-destroy · 803dc0a5
      Michal Privoznik 提交于
      Currently, we share the idea of old & new def with domains. Users can
      *-edit an object (domain, pool) which spawns a new internal
      representation for them. This is referenced via
      {domainObj,poolObj}->newDef [compared to ->def]. However, for pool we
      were never overwriting def with newDef. This must be done on
      pool-destroy (like we do analogically in domain detroy).
      803dc0a5
  8. 21 6月, 2012 1 次提交
    • O
      storage: Set the perms if the pool target already exists for fs pools · e4cfe5f6
      Osier Yang 提交于
      The comment says:
      
      /* Now create the final dir in the path with the uid/gid/mode
       * requested in the config. If the dir already exists, just set
       * the perms.
       */
      
      However, virDirCreate is only invoked if the target path doesn't
      exist yet (which is opposite with the comment), or the uid from
      the config is not -1 (I don't understand why, think it's just
      another mistake). And the result is the perms of the pool won't
      be changed if one tries to build the pool with different perms
      again.
      
      Besides these logic error fix, if no uid and gid are specified in
      the config, the practical used uid, gid are reflected.
      e4cfe5f6
  9. 28 5月, 2012 2 次提交
  10. 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
  11. 14 5月, 2012 1 次提交
    • W
      Use XDG Base Directories instead of storing in home directory · 32a9aac2
      William Jon McCann 提交于
      As defined in:
      http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
      
      This offers a number of advantages:
       * Allows sharing a home directory between different machines, or
      sessions (eg. using NFS)
       * Cleanly separates cache, runtime (eg. sockets), or app data from
      user settings
       * Supports performing smart or selective migration of settings
      between different OS versions
       * Supports reseting settings without breaking things
       * Makes it possible to clear cache data to make room when the disk
      is filling up
       * Allows us to write a robust and efficient backup solution
       * Allows an admin flexibility to change where data and settings are stored
       * Dramatically reduces the complexity and incoherence of the
      system for administrators
      32a9aac2
  12. 01 5月, 2012 1 次提交
    • E
      storage: fix build with iscsi · 29e702e5
      Eric Blake 提交于
      The previous storage patch missed an instance affected by the struct
      member rename.  It also had some botched whitespace detected by
      'make check'.
      
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIFindPoolSources): Adjust to new struct.
      * src/conf/storage_conf.c (virStoragePoolSourceFormat): Fix
      indentation.
      29e702e5
  13. 30 4月, 2012 1 次提交
  14. 16 4月, 2012 1 次提交
    • C
      storage: lvm: use correct lv* command parameters · cab1a9de
      Cole Robinson 提交于
      lvcreate want's the parent pool's name, not the pool path
      lvchange and lvremove want lv specified as $vgname/$lvname
      
      This largely worked before because these commands strip off a
      starting /dev. But https://bugzilla.redhat.com/show_bug.cgi?id=714986
      is from a user using a 'nested VG' that was having problems.
      
      I couldn't find any info on nested LVM and the reporter never responded,
      but I reproduced with XML that specified a valid source name, and
      set target path to a symlink.
      cab1a9de
  15. 30 3月, 2012 1 次提交
  16. 03 3月, 2012 1 次提交
  17. 29 2月, 2012 2 次提交
  18. 16 2月, 2012 1 次提交
    • M
      storage: Allow runtime detection of scrub · 28608856
      Michal Privoznik 提交于
      Currently, if scrub (used for wiping algorithms) is not present
      at compile time, we don't support any other wiping algorithms than
      zeroing, even if it was installed later. Switch to runtime detection
      instead.
      28608856
  19. 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
  20. 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
  21. 01 2月, 2012 1 次提交
  22. 26 1月, 2012 3 次提交
    • D
      Introduce new API for generating random numbers · e95ef67b
      Daniel P. Berrange 提交于
      The old virRandom() API was not generating good random numbers.
      Replace it with a new API virRandomBits which instead of being
      told the upper limit, gets told the number of bits of randomness
      required.
      
      * src/util/virrandom.c, src/util/virrandom.h: Add virRandomBits,
        and move virRandomInitialize
      * src/util/util.h, src/util/util.c: Delete virRandom and
        virRandomInitialize
      * src/libvirt.c, src/security/security_selinux.c,
        src/test/test_driver.c, src/util/iohelper.c: Update for
        changes from virRandom to virRandomBits
      * src/storage/storage_backend_iscsi.c: Remove bogus call
        to virRandomInitialize & convert to virRandomBits
      e95ef67b
    • M
      storage: Support different wiping algorithms · adb99a05
      Michal Privoznik 提交于
      Currently, we support only filling a volume with zeroes on wiping.
      However, it is not enough as data might still be readable by
      experienced and equipped attacker. Many technical papers have been
      written, therefore we should support other wiping algorithms.
      adb99a05
    • 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
  23. 13 12月, 2011 1 次提交
    • O
      storage: Fix a potential crash when creating vol object · 380f3269
      Osier Yang 提交于
      If the vol object is newly created, it increases the volumes count,
      but doesn't decrease the volumes count when do cleanup. It can
      cause libvirtd to crash when one trying to free the volume objects
      like:
          for (i = 0; i < pool->volumes.count; i++)
              virStorageVolDefFree(pool->volumes.objs[i]);
      
      It's more reliable if we add the newly created vol object in the
      end.
      380f3269
  24. 12 12月, 2011 1 次提交
  25. 04 12月, 2011 1 次提交
    • E
      maint: fix improper use of 'an' · 3a9ce767
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=648855 mentioned a
      misuse of 'an' where 'a' is proper; that has since been fixed,
      but a search found other problems (some were a spelling error for
      'and', while most were fixed by 'a').
      
      * daemon/stream.c: Fix grammar.
      * src/conf/domain_conf.c: Likewise.
      * src/conf/domain_event.c: Likewise.
      * src/esx/esx_driver.c: Likewise.
      * src/esx/esx_vi.c: Likewise.
      * src/rpc/virnetclient.c: Likewise.
      * src/rpc/virnetserverprogram.c: Likewise.
      * src/storage/storage_backend_fs.c: Likewise.
      * src/util/conf.c: Likewise.
      * src/util/dnsmasq.c: Likewise.
      * src/util/iptables.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * src/xen/xs_internal.c: Likewise.
      * tools/virsh.c: Likewise.
      3a9ce767
  26. 02 12月, 2011 1 次提交
    • E
      maint: typo fixes · a6997934
      Eric Blake 提交于
      Many of these were mentioned by Yuri Chornoivan in:
      https://bugzilla.redhat.com/show_bug.cgi?id=669506
      
      * src/esx/esx_vi.c (esxVI_WaitForTaskCompletion): Fix spelling.
      * src/conf/netdev_vport_profile_conf.c
      (virNetDevVPortProfileParse): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags):
      Likewise.
      * src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): Likewise.
      * src/esx/esx_util.c (esxUtil_ResolveHostname): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemBuild): Likewise.
      * daemon/libvirtd.conf: Likewise.
      * src/util/logging.c (virLogMessage): Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLineNet): Likewise.
      * src/vmx/vmx.c (virVMXFormatEthernet): Likewise.
      a6997934
  27. 25 11月, 2011 2 次提交
  28. 22 11月, 2011 1 次提交
    • C
      storage: Fallback to use lvchange first if lvremove fails · 3c540514
      Chang Liu 提交于
      virStorageBackendLogicalDeleteVol() could not remove the lv with error
      "could not remove open logical volume" sometimes. Generally it's caused
      by the volume is still active, even if lvremove tries to remove it with
      option "--force".
      
      This patch is to fix it by disbale the lv first using "lvchange -aln"
      and "lvremove -f" afterwards if the direct "lvremove -f" failed.
      3c540514
  29. 21 11月, 2011 1 次提交
    • O
      storage: Skips backingStore of virtual snapshot lv · d26b73ca
      Osier Yang 提交于
      lvs outputs "[$lvname_vorigin]" for the virtual snapshot lv
      (created with "--virtualsize"), and the original device pointed
      by "$lvname_vorigin" is just for lvm internal use, one should
      never use it.
      
      Per lvm's nameing rules, "[" is not valid as part of the vg/lv name.
      (man 8 lvm).
      
      <quote>
      VALID NAMES
      The following characters are valid for VG and LV names: a-z A-Z 0-9 + _
      . -
      
      VG and LV names cannot begin with a hyphen.   There  are  also  various
      reserved  names that are used internally by lvm that can not be used as
      LV or VG names.  A VG cannot be called anything that exists in /dev/ at
      the time of creation, nor can it be called '.' or '..'.  A LV cannot be
      called '.' '..' 'snapshot' or 'pvmove'. The LV name may also  not  con‐
      tain the strings '_mlog' or '_mimage'
      </quote>
      
      So we can skip the set the lv's backingStore by checking if the name
      begins with a "[".
      d26b73ca