1. 03 8月, 2017 2 次提交
  2. 27 7月, 2017 1 次提交
    • J
      storage: Disallow usage of the HBA for a fc_host backing · 43e6686c
      John Ferlan 提交于
      Disallow providing the wwnn/wwpn of the HBA in the adapter XML:
      
        <adapter type='fc_host' [parent='scsi_hostN'] wwnn='HBA_wwnn'
          wwpn='HBA_wwpn'/>
      
      This should be considered a configuration error since a vHBA
      would not be created. In order to use the HBA as the backing the
      following XML should be used:
      
        <adapter type='scsi_host' name='scsi_hostN'/>
      
      So add a check prior to the checkParent call to validate that
      the provided wwnn/wwpn resolves to a vHBA and not an HBA.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      43e6686c
  3. 15 5月, 2017 1 次提交
  4. 14 3月, 2017 1 次提交
  5. 26 1月, 2017 1 次提交
  6. 18 1月, 2017 1 次提交
    • J
      disk: Fixup error handling path for devmapper when part_separator='yes' · 0d157b3f
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1346566
      
      If libvirt_parthelper is erroneously told to append the partition
      separator 'p' onto the generated output for a disk pool using device
      mapper that has 'user_friendly_names' set to true, then the error
      recovery path will fail to find volume resulting in the pool being
      in an unusable state.
      
      So, augment the documentation to provide the better hint that the
      part_separator='yes' should be set when user_friendly_names are not
      being used. Additionally, once we're in the error path where the
      returned name doesn't match the expected partition name try to see
      if the reason is because the 'p' was erroneosly added. If so alter
      the about to be removed vol->target.path so that the DiskDeleteVol
      code can find the partition that was created and remove it.
      0d157b3f
  7. 12 1月, 2017 1 次提交
  8. 21 12月, 2016 1 次提交
    • J
      conf: Display <physical> in output of voldef · 78661cb1
      John Ferlan 提交于
      Although the virStorageBackendUpdateVolTargetInfo will update the
      target.physical value, there is no way to provide that information
      via the virStorageGetVolInfo API since it only returns the capacity
      and allocation of a volume. So as described in commit id '0282ca45',
      it should be possible to generate an output only <physical> value
      for that purpose.
      
      This patch generates the <physical> value in the volume XML output
      for the sole purpose of being able to view/see the value to allow
      someone to parse the XML in order to obtain the value.
      
      Update the documentation to describe the output only nature.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      78661cb1
  9. 14 12月, 2016 1 次提交
  10. 11 12月, 2016 1 次提交
    • J
      docs: Adjust pool/vol target output · e36a0e0c
      John Ferlan 提交于
      Looks like the <timestamps> and <encryption> were put in the wrong
      place... They're not <pool> elements, rather they are <volume> elements
      e36a0e0c
  11. 14 11月, 2016 1 次提交
  12. 28 7月, 2016 1 次提交
    • D
      storage: remove "luks" storage volume type · a48c7141
      Daniel P. Berrange 提交于
      The current LUKS support has a "luks" volume type which has
      a "luks" encryption format.
      
      This partially makes sense if you consider the QEMU shorthand
      syntax only requires you to specify a format=luks, and it'll
      automagically uses "raw" as the next level driver. QEMU will
      however let you override the "raw" with any other driver it
      supports (vmdk, qcow, rbd, iscsi, etc, etc)
      
      IOW the intention though is that the "luks" encryption format
      is applied to all disk formats (whether raw, qcow2, rbd, gluster
      or whatever). As such it doesn't make much sense for libvirt
      to say the volume type is "luks" - we should be saying that it
      is a "raw" file, but with "luks" encryption applied.
      
      IOW, when creating a storage volume we should use this XML
      
        <volume>
          <name>demo.raw</name>
          <capacity>5368709120</capacity>
          <target>
            <format type='raw'/>
            <encryption format='luks'>
              <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccd2f80d6f'/>
            </encryption>
          </target>
        </volume>
      
      and when configuring a guest disk we should use
      
        <disk type='file' device='disk'>
          <driver name='qemu' type='raw'/>
          <source file='/home/berrange/VirtualMachines/demo.raw'/>
          <target dev='sda' bus='scsi'/>
          <encryption format='luks'>
            <secret type='passphrase' uuid='0a81f5b2-8403-7b23-c8d6-21ccd2f80d6f'/>
          </encryption>
        </disk>
      
      This commit thus removes the "luks" storage volume type added
      in
      
        commit 318ebb36
        Author: John Ferlan <jferlan@redhat.com>
        Date:   Tue Jun 21 12:59:54 2016 -0400
      
          util: Add 'luks' to the FileTypeInfo
      
      The storage file probing code is modified so that it can probe
      the actual encryption formats explicitly, rather than merely
      probing existance of encryption and letting the storage driver
      guess the format.
      
      The rest of the code is then adapted to deal with
      VIR_STORAGE_FILE_RAW w/ VIR_STORAGE_ENCRYPTION_FORMAT_LUKS
      instead of just VIR_STORAGE_FILE_LUKS.
      
      The commit mentioned above was included in libvirt v2.0.0.
      So when querying volume XML this will be a change in behaviour
      vs the 2.0.0 release - it'll report 'raw' instead of 'luks'
      for the volume format, but still report 'luks' for encryption
      format.  I think this change is OK because the storage driver
      did not include any support for creating volumes, nor starting
      guets with luks volumes in v2.0.0 - that only since then.
      Clearly if we change this we must do it before v2.1.0 though.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a48c7141
  13. 15 7月, 2016 1 次提交
  14. 11 5月, 2016 1 次提交
    • J
      storage: Fix algorithm generating path names for devmapper · e7bde8d3
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1265694
      
      Commit id '020135dc' didn't quite get the algorithm correct when a
      device mapper source ended with a non numeric value (e.g. ends with
      an alphabet value).
      
      This patch modifies the 'part_separator' logic to add the "p" separator
      to the attempted target path name only when specified as part_separator='yes'.
      
      For a source name that already ends with a number, the logic doesn't change
      as the part separator would need to be there.
      
      For a source name that ends with something other than a number, this allows
      the possibility that a "p" separator can be added. The default for one of
      these source devices is to not add the separator.
      
      The key for device mapper and the need for a partition separator "p" is
      the presence of a number in the last character of the device name link
      in /dev/mapper.  A name such as "/dev/mapper/mpatha1" would generate
      a "/dev/mapper/mpatha1p1" partition, while "/dev/mapper/mpatha" would
      generate partition "/dev/mapper/mpatha1". Similarly for a device
      mapper entry not using friendly names or an alias, a device such as
      "/dev/mapper/3600a0b80005b10ca00005ad656fd8d93" would generate a
      paritition "/dev/mapper/3600a0b80005b10ca00005ad656fd8d93p1", while
      a device such as "/dev/mapper/3600a0b80005b10ca00005e115729093f" would
      generate a partition "/dev/mapper/3600a0b80005b10ca00005e115729093f1".
      The long number is the WWID of the device. It's also possible to assign
      an alias for a device mapper entry, that alias follows the same rules
      with respect to ending with a number or not when adding a "p" to create
      the target device path.
      e7bde8d3
  15. 15 4月, 2016 1 次提交
  16. 20 1月, 2016 1 次提交
    • J
      conf: Add storage pool device attribute part_separator · 4f846170
      John Ferlan 提交于
      Add a new storage pool source device attribute 'part_separator=[yes|no]'
      in order to allow a 'disk' storage pool using a device mapper multipath
      device to not add the "p" partition separator to the generated device
      name when libvirt_parthelper is run.
      
      This will allow libvirt to find device mapper multipath devices which were
      configured in /etc/multipath.conf to use 'user_friendly_names' or custom
      'alias' names for the LUN.
      4f846170
  17. 30 6月, 2015 1 次提交
    • J
      mpath: Don't allow more than one mpath pool at a time · a77056bd
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1232606
      
      Since an mpath pool contains all the Multipath devices on a host, allowing
      more than one defined on a host at a time should be disallowed under the
      policy of disallowing duplicate source pools for the host.
      
      Adjust to docs to clarify the Multipath target path value usage for both
      the storage driver (only 1 pool per host) and formatstorage references
      (ignore the target element in favor of the default target mapping of
      /dev/mapper).
      a77056bd
  18. 16 6月, 2015 1 次提交
    • J
      storage: Generate correct parameters for CIFS · 29230951
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1186969
      
      When generating the path to the dir for a CIFS/Samba driver, the code
      would generate a source path for the mount using "%s:%s" while the
      mount.cifs expects to see "//%s/%s". So check for the cifsfs and
      format the source path appropriately.
      
      Additionally, since there is no means to authenticate, the mount
      needs a "-o guest" on the command line in order to anonymously mount
      the Samba directory.
      29230951
  19. 26 5月, 2015 2 次提交
    • C
      storage: conf: Don't set any default <mode> in the XML · 7c2d65dd
      Cole Robinson 提交于
      The XML parser sets a default <mode> if none is explicitly passed in.
      This is then used at pool/vol creation time, and unconditionally reported
      in the XML.
      
      The problem with this approach is that it's impossible for other code
      to determine if the user explicitly requested a storage mode. There
      are some cases where we want to make this distinction, but we currently
      can't.
      
      Handle <mode> parsing like we handle <owner>/<group>: if no value is
      passed in, set it to -1, and adjust the internal consumers to handle
      it.
      7c2d65dd
    • C
      docs: formatstorage: Update <permissions> docs · fafcc818
      Cole Robinson 提交于
      - Don't redocument the permissions fields for backingstore, just point to
        the volume docs.
      - Clarify that owner/group are inherited from the parent directory at
        volume create/pool build time.
      - Clarify that <permissions> fields report runtime values too
      fafcc818
  20. 13 5月, 2015 1 次提交
    • J
      conf: Remove source host name check for iSCSI · 4b2b53f6
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1171984
      https://bugzilla.redhat.com/show_bug.cgi?id=1188463
      
      Remove the check for the source host name for iSCSI source XML processing
      declaring duplicate sources when the source device path and if present the
      initiator of a proposed storage pool matches an existing storage pool.
      
      The backend iSCSI storage driver uses 'iscsiadm --mode session' to query
      available iscsid target sessions. The output displayed is the IP address
      and the IQN (target path) of known targets. The displayed IP address
      is a resolved address based on the session --login. Additionally, iscsid
      keeps track of the various ways to define the host name (IPv4 Address,
      IPv6 Address, /etc/hosts, etc.) for that IQN (see output of an 'iscsiadm
      --mode node'). If an incoming IQN matches and the host name provided by
      libvirt is resolved to the existing IQN, then iscsid will "reuse" the
      session. Although libvirt could do the same name resolution, if there
      is a difference, iscsid could still declare two seemingly different sources
      to be the same and not create a new session which means libvirt now has
      two storage pools looking at the same source. Thus to avoid any strange
      host name resolution issues, just rely on iscsid for that and do not
      allow multiple pools on the same host to use the same device path (IQN).
      4b2b53f6
  21. 09 4月, 2015 1 次提交
  22. 25 3月, 2015 1 次提交
  23. 29 1月, 2015 1 次提交
  24. 10 12月, 2014 1 次提交
  25. 06 12月, 2014 1 次提交
  26. 01 12月, 2014 1 次提交
    • J
      storage: Add mixed fc_host/scsi_host duplicate adapter source checks · b09ff138
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1159180
      
      The virStoragePoolSourceFindDuplicate only checks the incoming definition
      against the same type of pool as the def; however, for "scsi_host" and
      "fc_host" adapter pools, it's possible that either some pool "scsi_host"
      adapter definition is already using the scsi_hostN that the "fc_host"
      adapter definition wants to use or some "fc_host" pool adapter definition
      is using a vHBA scsi_hostN or parent scsi_hostN that an incoming "scsi_host"
      definition is trying to use.
      
      This patch adds the mismatched type checks and adds extraneous comments
      to describe what each check is determining.
      
      This patch also modifies the documentation to be describe what scsi_hostN
      devices a "scsi_host" source adapter should use and which to avoid. It also
      updates the parent definition to specifically call out that for mixed
      environments it's better to define which parent to use so that the duplicate
      pool checks can be done properly.
      b09ff138
  27. 12 11月, 2014 2 次提交
    • J
      storage: Introduce 'managed' for the fchost parent · 5530f248
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160926
      
      Introduce a 'managed' attribute to allow libvirt to decide whether to
      delete a vHBA vport created via external means such as nodedev-create.
      The code currently decides whether to delete the vHBA based solely on
      whether the parent was provided at creation time. However, that may not
      be the desired action, so rather than delete and force someone to create
      another vHBA via an additional nodedev-create allow the configuration of
      the storage pool to decide the desired action.
      
      During createVport when libvirt does the VPORT_CREATE, set the managed
      value to YES if not already set to indicate to the deleteVport code that
      it should delete the vHBA when the pool is destroyed.
      
      If libvirtd is restarted all the memory only state was lost, so for a
      persistent storage pool, use the virStoragePoolSaveConfig in order to
      write out the managed value.
      
      Because we're now saving the current configuration, we need to be sure
      to not save the parent in the output XML if it was undefined at start.
      Saving the name would cause future starts to always use the same parent
      which is not the expected result when not providing a parent. By not
      providing a parent, libvirt is expected to find the best available
      vHBA port for each subsequent (re)start.
      
      At deleteVport, use the new managed value to decide whether to execute
      the VPORT_DELETE.  Since we no longer save the parent in memory or in
      XML when provided, if it was not provided, then we have to look it up.
      5530f248
    • J
      storage: Ensure fc_host parent matches wwnn/wwpn · 42a021c1
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160565
      
      The existing code assumed that the configuration of a 'parent' attribute
      was correct for the createVport path. As it turns out, that may not be
      the case which leads errors during the deleteVport path because the
      wwnn/wwpn isn't associated with the parent.
      
      With this change the following is reported:
      
      error: Failed to start pool fc_pool_host3
      error: XML error: Parent attribute 'scsi_host4' does not match parent 'scsi_host3' determined for the 'scsi_host16' wwnn/wwpn lookup.
      
      for XML as follows:
      
        <pool type='scsi'>
          <name>fc_pool</name>
          <source>
            <adapter type='fc_host' parent='scsi_host4' wwnn='5001a4aaf3ca174b' wwpn='5001a4a77192b864'/>
          </source>
      
      Where 'nodedev-dumpxml scsi_host16' provides:
      
        <device>
          <name>scsi_host16</name>
          <path>/sys/devices/pci0000:00/0000:00:04.0/0000:10:00.0/host3/vport-3:0-11/host16</path>
          <parent>scsi_host3</parent>
          <capability type='scsi_host'>
            <host>16</host>
            <unique_id>13</unique_id>
            <capability type='fc_host'>
              <wwnn>5001a4aaf3ca174b</wwnn>
              <wwpn>5001a4a77192b864</wwpn>
      ...
      
      The patch also adjusts the description of the storage pool to describe the
      restrictions.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      42a021c1
  28. 18 9月, 2014 1 次提交
    • R
      docs: update zfs documentation · 05d1dd6b
      Roman Bogorodskiy 提交于
       - docs/formatstorage.html.in: document 'zfs' pool type, add it
         to a list of pool types that could use source physical devices
       - docs/storage.html.in: update a ZFS pool example XML with
         source physical devices, mention that starting from 1.2.9 a
         pool could be created from this devices by libvirt and in earlier
         versions user still has to create a pool manually
       - docs/drvbhyve.html.in: add an example with ZFS pools
      05d1dd6b
  29. 23 7月, 2014 1 次提交
  30. 22 7月, 2014 2 次提交
    • J
      scsi_host: Introduce virFindSCSIHostByPCI · ef48a1b6
      John Ferlan 提交于
      Introduce a new function to parse the provided scsi_host parent address
      and unique_id value in order to find the /sys/class/scsi_host directory
      which will allow a stable SCSI host address
      
      Add a test to scsihosttest to lookup the host# name by using the PCI address
      and unique_id value
      ef48a1b6
    • O
      storage: Introduce parentaddr into virStoragePoolSourceAdapter · a4bd62ad
      Osier Yang 提交于
      Between reboots and kernel reloads, the SCSI host number used for SCSI
      storage pools may change requiring modification to the storage pool XML
      in order to use a specific SCSI host adapter.
      
      This patch introduces the "parentaddr" element and "unique_id" attribute
      for the SCSI host adapter in order to uniquely identify the adapter
      between reboots and kernel reloads. For now the goal is to only parse
      and format the XML. Both will be required to be provided in order to
      uniquely identify the desired SCSI host.
      
      The new XML is expected to be as follows:
      
        <adapter type='scsi_host'>
          <parentaddr unique_id='3'>
            <address domain='0x0000' bus='0x00' slot='0x1f' func='0x2'/>
          </parentaddr>
        </adapter>
      
      where "parentaddr" is the parent device of the SCSI host using the PCI
      address on which the device resides and the value from the unique_id file
      for the device. Both the PCI address and unique_id values will be used
      to traverse the /sys/class/scsi_host/ directories looking at each link
      to match the PCI address reformatted to the directory link format where
      "domain:bus:slot:function" is found.  Then for each matching directory
      the unique_id file for the scsi_host will be used to match the unique_id
      value in the xml.
      
      For a PCI address listed above, this will be formatted to "0000:00:1f.2"
      and the links in /sys/class/scsi_host will be used to find the host#
      to be used for the 'scsi_host' device. Each entry is a link to the
      /sys/bus/pci/devices directories, e.g.:
      
      %  ls -al /sys/class/scsi_host/host2
      lrwxrwxrwx. 1 root root 0 Jun  1 00:22 /sys/class/scsi_host/host2 -> ../../devices/pci0000:00/0000:00:1f.2/ata3/host2/scsi_host/host2
      
      % cat /sys/class/scsi_host/host2/unique_id
      3
      
      The "parentaddr" and "name" attributes are mutually exclusive to identify
      the SCSI host number. Use of the "parentaddr" element will be the preferred
      mechanism.
      
      This patch only supports to parse and format the XMLs. Later patches will
      add code to find out the scsi host number.
      a4bd62ad
  31. 16 7月, 2014 1 次提交
    • C
      storagevol: add nocow to vol xml · a9fd30e6
      Chunyan Liu 提交于
      Add 'nocow' to storage volume xml so that user can have an option
      to set NOCOW flag to the newly created volume. It's useful on btrfs
      file system to enhance performance.
      
      Btrfs has low performance when hosting VM images, even more when the guest
      in those VM are also using btrfs as file system. One way to mitigate this
      bad performance is to turn off COW attributes on VM files. Generally, there
      are two ways to turn off COW on btrfs: a) by mounting fs with nodatacow,
      then all newly created files will be NOCOW. b) per file. Add the NOCOW file
      attribute. It could only be done to empty or new files.
      
      This patch tries the second way, according to 'nocow' option, it could set
      NOCOW flag per file:
      for raw file images, handle 'nocow' in libvirt code; for non-raw file images,
      pass 'nocow=on' option to qemu-img, and let qemu-img to handle that (requires
      qemu-img version >= 2.1).
      Signed-off-by: NChunyan Liu <cyliu@suse.com>
      a9fd30e6
  32. 05 3月, 2014 1 次提交
  33. 26 11月, 2013 3 次提交
    • E
      storage: add network-dir as new storage volume type · ecd881b7
      Eric Blake 提交于
      In the 'directory' and 'netfs' storage pools, a user can see
      both 'file' and 'dir' storage volume types, to know when they
      can descend into a subdirectory.  But in a network-based storage
      pool, such as the upcoming 'gluster' pool, we use 'network'
      instead of 'file', and did not have any counterpart for a
      directory until this patch.  Adding a new volume type
      'network-dir' is better than reusing 'dir', because it makes
      it clear that the only way to access 'network' volumes within
      that container is through the network mounting (leaving 'dir'
      for something accessible in the local file system).
      
      * include/libvirt/libvirt.h.in (virStorageVolType): Expand enum.
      * docs/formatstorage.html.in: Document it.
      * docs/schemasa/storagevol.rng (vol): Allow new value.
      * src/conf/storage_conf.c (virStorageVol): Use new value.
      * src/qemu/qemu_command.c (qemuBuildVolumeString): Fix client.
      * src/qemu/qemu_conf.c (qemuTranslateDiskSourcePool): Likewise.
      * tools/virsh-volume.c (vshVolumeTypeToString): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemVolDelete): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ecd881b7
    • E
      storage: document gluster pool · ed5fa7f3
      Eric Blake 提交于
      Add support for a new <pool type='gluster'>, similar to
      RBD and Sheepdog.  Terminology wise, a gluster volume
      forms a libvirt storage pool, within the gluster volume,
      individual files are treated as libvirt storage volumes.
      
      * docs/schemas/storagepool.rng (poolgluster): New pool type.
      * docs/formatstorage.html.in: Document gluster.
      * docs/storage.html.in: Likewise, and contrast it with netfs.
      * tests/storagepoolxml2xmlin/pool-gluster.xml: New test.
      * tests/storagepoolxml2xmlout/pool-gluster.xml: Likewise.
      * tests/storagepoolxml2xmltest.c (mymain): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ed5fa7f3
    • E
      storage: expose volume meta-type in XML · 1b5c8d4c
      Eric Blake 提交于
      I got annoyed at having to use both 'virsh vol-list $pool --details'
      AND 'virsh vol-dumpxml $vol $pool' to learn if I had populated
      the volume correctly.  Since two-thirds of the data present in
      virStorageVolGetInfo() already appears in virStorageVolGetXMLDesc(),
      this just adds the remaining piece of information, as:
      
      <volume type='...'>
        ...
      </volume>
      
      * docs/formatstorage.html.in: Document new <volume type=...>.
      * docs/schemas/storagevol.rng (vol): Add it to RelaxNG.
      * src/conf/storage_conf.h (virStorageVolTypeToString): Declare.
      * src/conf/storage_conf.c (virStorageVolTargetDefFormat): Output
      the metatype.
      (virStorageVolDefParseXML): Parse it, for unit tests.
      * tests/storagevolxml2xmlout/vol-*.xml: Update tests to match.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      1b5c8d4c
  34. 16 10月, 2013 1 次提交