1. 14 12月, 2017 1 次提交
  2. 24 11月, 2017 1 次提交
  3. 08 11月, 2017 1 次提交
  4. 07 11月, 2017 2 次提交
    • P
      storage: Store RBD image name as pool and image name · 90521d07
      Peter Krempa 提交于
      Similarly to how we store gluster names, split the name into a pool and
      image portions when paring the XML and store them separately.
      90521d07
    • P
      storage: Don't store leading '/' in image name when splitting out volume · bb14d989
      Peter Krempa 提交于
      Libvirt historically stores storage source path including the volume as
      one string in the XML, but that is not really flexible enough when
      dealing with the fields in the code. Previously we'd store the slash
      separating the two as part of the image name. This was fine for gluster
      but it's not necessary and does not scale well when converting other
      protocols.
      
      Don't store the slash as part of the path. The resulting change from
      absolute to relative path within the gluster driver should be okay,
      as the root directory is the default when accessing gluster.
      bb14d989
  5. 20 10月, 2017 2 次提交
    • J
      conf: Add/Allow parsing the auth in the disk source · 8002d3cb
      John Ferlan 提交于
      Since the virStorageAuthDefPtr auth; is a member of _virStorageSource
      it really should be allowed to be a subelement of the disk <source>
      for the RBD and iSCSI prototcols. That way we can set up to allow
      the <auth> element to be formatted within the disk source.
      
      Since we've allowed the <auth> to be a child of <disk>, we'll need
      to keep track of how it was read so that when writing out we'll know
      whether to format as child of <disk> or <source>. For the argv2xml
      parsing, let's format under <source> as a preference. Do not allow
      <auth> to be both a child of <disk> and <source>.
      
      Modify the qemuxml2argvtest to add a parse failure when there is an
      <auth> as a child of <disk> *and* an <auth> as a child of <source>.
      
      Add tests to validate that if the <auth> was found in <source>, then
      the resulting xml2xml and xml2arg works just fine.  The two new .args
      file are exact copies of the non "-source" version of the file.
      
      The virschematest will read the new test files and validate from a
      RNG viewpoint things are fine
      
      Update the virstoragefile, virstoragetest, and args2xml file to show
      the "preference" to place <auth> as a child of <source>.
      8002d3cb
    • J
      util: storage: Introduce privateData for _virStorageSource · 1f38445e
      John Ferlan 提交于
      Introduce the bare necessities to add privateData to _virStorageSource.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      1f38445e
  6. 18 10月, 2017 1 次提交
  7. 17 10月, 2017 5 次提交
    • P
      Terminate backing chains explicitly · a693fdba
      Peter Krempa 提交于
      Express a properly terminated backing chain by putting a
      virStorageSource of type VIR_STORAGE_TYPE_NONE in the chain. The newly
      used helpers simplify this greatly.
      
      The change fixes a bug as formatting an incomplete backing chain and
      parsing it back would end up in expressing a terminated chain since
      src->backingStoreRaw was not populated. By relying on the terminator
      object this can be now processed appropriately.
      a693fdba
    • 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
    • P
      util: storagefile: Tolerate NULL path when looking up volume in chain · e3fb414e
      Peter Krempa 提交于
      chain->path may be NULL e.g. for NBD drives, so the check needs to avoid
      dereferencing the path in such case
      e3fb414e
    • P
      util: storage: use stored index to lookup disks · 9cc8d6ee
      Peter Krempa 提交于
      We can now use the backing store ID directly rather than counting the
      number of images seen while looking up images.
      9cc8d6ee
    • P
      util: storage: Store backing chain index in virStorageSource · c6231a6a
      Peter Krempa 提交于
      The backing store indexes were not bound to the storage sources in any
      way. To allow us to bind a given alias to a given storage source we need
      to save the index in virStorageSource. The backing store ids are now
      generated when detecting the backing chain.
      
      Since we don't re-detect the backing chain after snapshots, the
      numbering needs to be fixed there.
      c6231a6a
  8. 16 10月, 2017 1 次提交
  9. 28 9月, 2017 2 次提交
    • J
      qemu: Introduce qemuDomainPrepareDiskSource · 5c09486c
      John Ferlan 提交于
      Introduce a function to setup any TLS needs for a disk source.
      
      If there's a configuration or other error setting up the disk source
      for TLS, then cause the domain startup to fail.
      
      For VxHS, follow the chardevTLS model where if the src->haveTLS hasn't
      been configured, then take the system/global cfg->haveTLS setting for
      the storage source *and* mark that we've done so via the tlsFromConfig
      setting in storage source.
      
      Next, if we are using TLS, then generate an alias into a virStorageSource
      'tlsAlias' field that will be used to create the TLS object and added to
      the disk object in order to link the two together for QEMU.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      5c09486c
    • A
      util: Add TLS attributes to virStorageSource · f1705485
      Ashish Mittal 提交于
      Add an optional virTristateBool haveTLS to virStorageSource to
      manage whether a storage source will be using TLS.
      
      Sample XML for a VxHS disk:
      
      <disk type='network' device='disk'>
        <driver name='qemu' type='raw' cache='none'/>
        <source protocol='vxhs' name='eb90327c-8302-4725-9e1b-4e85ed4dc251' tls='yes'>
          <host name='192.168.0.1' port='9999'/>
        </source>
        <target dev='vda' bus='virtio'/>
      </disk>
      
      Additionally add a tlsFromConfig boolean to control whether the TLS
      setting was due to domain configuration or qemu.conf global setting
      in order to decide whether to Format the haveTLS setting for either
      a live or saved domain configuration file.
      
      Update the qemuxml2xmltest in order to add a test to show the proper
      parsing.
      
      Also update the docs to describe the tls attribute.
      Signed-off-by: NAshish Mittal <Ashish.Mittal@veritas.com>
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f1705485
  10. 27 9月, 2017 3 次提交
    • J
      Shrink volume even with ALLOCATE flag · 959fe7de
      Ján Tomko 提交于
      Calling fallocate on the new (smaller) capacity ensures
      that the whole file is allocated, but it does not reduce
      the file size.
      
      Also call ftruncate after fallocate.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1366446
      959fe7de
    • 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
    • J
      use virFileAllocate in virStorageFileResize · 5463d959
      Ján Tomko 提交于
      Introduce a new function virFileAllocate that will call the
      non-destructive variants of safezero, essentially reverting
      my commit 1390c268
          safezero: fall back to writing zeroes even when resizing
      back to the state as of commit 18f03166
          virstoragefile: Have virStorageFileResize use safezero
      
      This means that _ALLOCATE flag will no longer work on platforms
      without the allocate syscalls, but it will not overwrite data
      either.
      5463d959
  11. 22 9月, 2017 1 次提交
  12. 20 9月, 2017 2 次提交
  13. 12 9月, 2017 1 次提交
  14. 27 7月, 2017 1 次提交
  15. 24 7月, 2017 2 次提交
  16. 14 7月, 2017 3 次提交
  17. 11 7月, 2017 3 次提交
  18. 24 6月, 2017 1 次提交
    • J
      util: Force reading of meta data to get encryption capacity value · 5431055d
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1371892
      
      As it turns out the volume create, build, and refresh path was not peeking
      at the meta data, so immediately after a create operation the value displayed
      for capacity was still incorrect. However, if a pool refresh was done the
      correct value was fetched as a result of a meta data peek.
      
      The reason is it seems historically if the file type is RAW then peeking
      at the file just took the physical value for the capacity. However, since
      we know if it's an encrypted file, then peeking at the meta data will be
      required in order to get a true capacity value.
      
      So check for encryption in the source and if present, use the meta data
      in order to fill in the capacity value and set the payload_offset.
      5431055d
  19. 20 6月, 2017 7 次提交