1. 27 10月, 2017 3 次提交
  2. 17 10月, 2017 1 次提交
    • P
      util: storagefile: Add helpers to check presence of backing store · 0a294a8e
      Peter Krempa 提交于
      Add helpers that will simplify checking if a backing file is valid or
      whether it has backing store. The helper virStorageSourceIsBacking
      returns true if the given virStorageSource is a valid backing store
      member. virStorageSourceHasBacking returns true if the virStorageSource
      has a backing store child.
      
      Adding these functions creates a central points for further refactors.
      0a294a8e
  3. 06 10月, 2017 1 次提交
  4. 05 10月, 2017 1 次提交
  5. 27 9月, 2017 1 次提交
    • J
      virStorageFileResize: fallocate the whole capacity · 3f702f5a
      Ján Tomko 提交于
      We have been trying to implement the ALLOCATE flag to mean
      "the volume should be fully allocated after the resize".
      
      Since commit b0579ed9 we do not allocate from the existing
      capacity, but from the existing allocation value.
      However this value is a total of all the allocated bytes,
      not an offset.
      
      For a sparsely allocated file:
      $ perl -e 'print "x"x8192;' > vol1
      $ fallocate -p -o 0 -l 4096 vol1
      $ virsh vol-info vol1 default
      Capacity:       8.00 KiB
      Allocation:     4.00 KiB
      
      Treating allocation as an offset would result in an incompletely
      allocated file:
      $ virsh vol-resize vol1 --pool default 16384 --allocate
      Capacity:       16.00 KiB
      Allocation:     12.00 KiB
      
      Call fallocate from zero on the whole requested capacity to fully
      allocate the file. After that, the volume is fully allocated
      after the resize:
      $ virsh vol-resize vol1 --pool default 16384 --allocate
      $ virsh vol-info vol1 default
      Capacity:       16.00 KiB
      Allocation:     16.00 KiB
      3f702f5a
  6. 19 9月, 2017 1 次提交
    • J
      storage: Introduce storage volume add, delete, count APIs · 40630a8e
      John Ferlan 提交于
      Create/use virStoragePoolObjAddVol in order to add volumes onto list.
      
      Create/use virStoragePoolObjRemoveVol in order to remove volumes from list.
      
      Create/use virStoragePoolObjGetVolumesCount to get count of volumes on list.
      
      For the storage driver, the logic alters when the volumes.obj list grows
      to after we've fetched the volobj. This is an optimization of sorts, but
      also doesn't "needlessly" grow the volumes.objs list and then just decr
      the count if the virGetStorageVol fails.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      40630a8e
  7. 31 8月, 2017 1 次提交
  8. 22 7月, 2017 1 次提交
  9. 18 5月, 2017 2 次提交
    • M
      Introduce virStorageVol{Download,Upload}Flags · 1f43aa67
      Michal Privoznik 提交于
      These flags to APIs will tell if caller wants to use sparse
      stream for storage transfer. At the same time, it's safe to
      enable them in storage driver frontend and rely on our backends
      checking the flags. This way we can enable specific flags only on
      some specific backends, e.g. enable
      VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM for filesystem backend but
      not iSCSI backend.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      1f43aa67
    • M
      fdstream: Implement sparse stream · 89547964
      Michal Privoznik 提交于
      Basically, what is needed here is to introduce new message type
      for the messages passed between the event loop callbacks and the
      worker thread that does all the I/O. The idea is that instead of
      a queue of read buffers we will have a queue where "hole of size
      X" messages appear. That way the event loop callbacks can just
      check the head of the queue and see if the worker thread is in
      data or a hole section and how long the section is.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      89547964
  10. 26 4月, 2017 2 次提交
    • J
      storage: Introduce virStorageBackendZeroPartitionTable · e8b02124
      John Ferlan 提交于
      Create a wrapper/helper that can be used to call the storage backend
      wipe helper - storageBackendVolWipeLocalFile for future use by logical
      and disk backends to clear out the partition table rather than having
      each open code the same algorithm.
      e8b02124
    • J
      storage: Modify storageBackendWipeLocal to allow zero from end of device · 859a2d16
      John Ferlan 提交于
      Add bool 'zero_end' and logic that would allow a caller to wipe specific
      portions of a target device either from the beginning (the default) or
      from the end when zero_end is true.
      
      This will allow for this code to wipe out partition table information
      from a device.
      859a2d16
  11. 07 4月, 2017 2 次提交
  12. 06 4月, 2017 1 次提交
  13. 04 4月, 2017 5 次提交
  14. 27 3月, 2017 1 次提交
  15. 16 3月, 2017 1 次提交
    • J
      util: Rename virFileWaitForDevices · 97e0d3c3
      John Ferlan 提交于
      The function is actually in virutil.c, but prototyped in virfile.h.
      This patch fixes that by renaming the function to virWaitForDevices,
      adding the prototype in virutil.h and libvirt_private.syms, and then
      changing the callers to use the new name.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      97e0d3c3
  16. 07 3月, 2017 1 次提交
  17. 03 3月, 2017 1 次提交
    • N
      Fix location of blkid.h in include header · 2d8fbeb8
      Nehal J Wani 提交于
      The build system for libvirt correctly detects the location of blkid
      using PKG_CONFIG_PATH environment variable. The file blkid.pc states
      that the include flags should be: 'Cflags: -I${includedir}/blkid' but
      libvirt searches for blkid.h inside ${includedir}/blkid/blkid, which is
      wrong. Until now, the compilation for libvirt succeeded because of pure
      luck, as it had -I/usr/include as a CFLAG. This issue was faced while
      compiling libvirt on Ubuntu 16.04.2 with bare minimum dev packages and a
      custom compiled blkid kept in a non-standard $prefix.
      Signed-off-by: NNehal J Wani <nehaljw.kkd1@gmail.com>
      2d8fbeb8
  18. 27 1月, 2017 1 次提交
    • J
      storage: Fix build due to recent storage backend code movement · 448e2d5e
      John Ferlan 提交于
      Commit id '5f07c3c0' broke the freebsd build in the libvirt CI test
      environment because the UMOUNT was not defined unless WITH_STORAGE_FS
      is defined.
      
      So remove the virStorageBackendUmountLocal from storage_util.c,h and
      restore the code back in the storage_backend_fs.c and _vstorage.c
      modules.
      448e2d5e
  19. 26 1月, 2017 2 次提交
    • J
      storage: Create common file/dir volume backend helpers · 1452c85f
      John Ferlan 提交于
      Move all the volume functions to storage_util to create local/common helpers
      using the same naming syntax as the existing upload, download, and wipe
      virStorageBackend*Local API's.
      
      In the process of doing so, found more API's that can now become local
      to storage_util. In order to distinguish between local/external - I
      changed the names of the now local only ones from "virStorageBackend..."
      to just "storageBackend..."
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      1452c85f
    • J
      storage: Create common file/dir pool backend helpers · 5f07c3c0
      John Ferlan 提交于
      Move some pool functions to storage_util to create local/common helpers
      using the same naming syntax as the existing upload, download, and wipe
      virStorageBackend*Local API's.
      
      In the process of doing so, found a few API's that can now become local
      to storage_util. In order to distinguish between local/external - I
      changed the names of the now local only ones from "virStorageBackend..."
      to just "storageBackend..."
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      5f07c3c0
  20. 19 1月, 2017 4 次提交
  21. 18 1月, 2017 4 次提交
    • J
      storage: Allow probe of volume capacity for BLOCK type · 9508682b
      John Ferlan 提交于
      If the voldef type is VIR_STORAGE_VOL_BLOCK, then as long as the
      format is known, let's allow the probe to happen - gets a truer value
      and the same probe/update would be allowed for the same volume defined
      in a domain.
      9508682b
    • J
      storage: Fix virStorageBackendUpdateVolTargetInfo type check · d04bb05f
      John Ferlan 提交于
      For volume processing in virStorageBackendUpdateVolTargetInfo to get
      the capacity commit id 'a760ba3a' added the ability to probe a volume
      that didn't list a target format. Unfortunately, the code used the
      virStorageSource  (e.g. target->type - virStorageType) rather than
      virStorageVolDef (e.g. vol->type - virStorageVolType) in order to
      make the comparison. As it turns out target->type for a volume is
      not filled in at all for a voldef as the code relies on vol->type.
      Ironically the result is that only VIR_STORAGE_VOL_BLOCK's would get
      their capacity updated.
      
      This patch will adjust the code to check the "vol->type" field instead
      as an argument. This way for a voldef, the correct comparison is made.
      
      Additionally for a backingStore, the 'type' field is never filled in;
      however, since we know that the provided path is a location at which
      the backing store can be accessed on the local filesystem thus just
      pass VIR_STORAGE_VOL_FILE in order to satisfy the adjusted voltype
      check. Whether it's a FILE or a BLOCK only matters if we're trying to
      get more data based on the target->format.
      d04bb05f
    • P
      storage: gluster: Remove build-time dependency on the 'gluster' cli tool · 9e97c8c0
      Peter Krempa 提交于
      The tool is used for pool discovery. Since we call an external binary we
      don't really need to compile out the code that uses it. We can check
      whether it exists at runtime.
      9e97c8c0
    • P
      storage: Fix error reporting when looking up storage pool sources · 7bdb4b8f
      Peter Krempa 提交于
      In commit 4090e153 we went back from reporting no errors if no storage
      pools were found on a given host to reporting a bad error. And only in
      cases when gluster was not installed.
      
      Report a less bad error in case there are no volumes. Also report the
      error when gluster is installed but no volumes were found, since
      virStorageBackendFindGlusterPoolSources would return success in that
      case.
      7bdb4b8f
  22. 14 1月, 2017 3 次提交
    • J
      storage: Alter error message in probe/empty checks · 40ec4ff6
      John Ferlan 提交于
      For case VIR_STORAGE_BLKID_PROBE_DIFFERENT, clean up the message to
      avoid using the virsh like --overwrite syntax. Additionally provide
      a different error message when not writing the label to avoid confusion.
      40ec4ff6
    • J
      storage: Clean up return value checking · f462f9ad
      John Ferlan 提交于
      Rather than special casing the VIR_STORAGE_BLKID_PROBE_UNKNOWN after
      calling virStorageBackendBLKIDFindPart, just allow the switch statement
      handle setting ret = -2.
      f462f9ad
    • J
      storage: Alter logic when both BLKID and PARTED unavailable · d1f5dfc4
      John Ferlan 提交于
      If neither BLKID or PARTED is available and we're not writing, then
      just return 0 which allows the underlying storage pool to generate
      a failure. If both are unavailable and we're writing, then generate
      a more generic error message.
      d1f5dfc4