1. 04 2月, 2016 7 次提交
    • J
      logical: Clarify pieces of lvs regex · 7de8b442
      John Ferlan 提交于
      Rather than have a unwieldy regex string - split it up into its components
      each having it's own #define and then combine in a different #define
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      7de8b442
    • J
      libxl: set net device prefix · a040ba9e
      Joao Martins 提交于
      Use the newly added virCapabilitiesSetNetPrefix to set
      the network prefix for the driver. This in return will
      be use by NetDefFormat() and NetDefParseXML() routines
      to free any interface name that start with the registered
      prefix.
      Acked-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      a040ba9e
    • J
      conf: add caps to virDomainSaveConfig · cd57b7c7
      Joao Martins 提交于
      virDomainSaveConfig calls virDomainDefFormat which was setting the caps
      to NULL, thus keeping the old behaviour (i.e. not looking at
      netprefix). This patch adds the virCapsPtr to the function and allows
      the configuration to be saved and skipping interface names that were
      registered with virCapabilitiesSetNetPrefix().
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      cd57b7c7
    • J
      conf: add caps to virDomainDefFormat* · d239a542
      Joao Martins 提交于
      And use the newly added caps->host.netprefix (if it exists) for
      interface names that match the autogenerated target names.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      d239a542
    • J
      conf: add prefix in virDomainNetDefParseXML · 481e9bd0
      Joao Martins 提交于
      And use the newly added caps->host.netprefix for free interface
      names that match the autogenerated target names.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      481e9bd0
    • J
      conf: add net device prefix to capabilities · 819d1d94
      Joao Martins 提交于
      In the reverted commit d2e5538b, the libxl driver was changed to copy
      interface names autogenerated by libxl to the corresponding network def
      in the domain's virDomainDef object. The copied name is freed when the
      domain transitions to the shutoff state. But when migrating a domain,
      the autogenerated name is included in the XML sent to the destination
      host.  It is possible an interface with the same name already exists on
      the destination host, causing migration to fail.
      
      This patch defines a new capability for setting the network device
      prefix that will be used in the driver. Valid prefixes are
      VIR_NET_GENERATED_PREFIX or the one announced by the driver.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      819d1d94
    • R
      storage: zfs: flexible use of 'volmode' option · c94f6d4d
      Roman Bogorodskiy 提交于
      There are slight differences in various ZFS implementations.
      Specifically, ZFS on FreeBSD requires to set value of 'volmode'
      option to 'dev' to expose volumes as raw disk device (that's what
      we need) rather than geom provides, for example.
      
      With ZFS on Linux, however, such option is not available and
      volumes exposed like we need by default.
      
      To make our implementation more flexible, only pass 'volmode'
      when it's supported. Support is checked by parsing usage
      information of the 'zfs get' command.
      c94f6d4d
  2. 03 2月, 2016 20 次提交
  3. 01 2月, 2016 3 次提交
  4. 30 1月, 2016 5 次提交
    • J
      logical: Create helper virStorageBackendLogicalParseVolExtents · 63e15ad5
      John Ferlan 提交于
      Create a helper routine in order to parse any extents information
      including the extent size, length, and the device string contained
      within the generated 'lvs' output string.
      
      A future patch would then be able to avoid the code more cleanly
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      63e15ad5
    • W
      rbd: Open in Read-Only mode when refreshing a volume · 84678267
      Wido den Hollander 提交于
      By opening a RBD volume in Read-Only we do not register a
      watcher on the header object inside the Ceph cluster.
      
      Refreshing a volume only calls rbd_stat() which is a operation
      which does not write to a RBD image.
      
      This allows us to use a cephx user which has no write
      permissions if we would want to use the libvirt storage pool
      for informational purposes only.
      
      It also saves us a write into the Ceph cluster which should
      speed up refreshing a RBD pool.
      
      rbd_open_read_only() is available in all librbd versions which
      also support rbd_open().
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      84678267
    • W
      rbd: Implement buildVolFrom using RBD cloning · 0b15f920
      Wido den Hollander 提交于
      RBD supports cloning by creating a snapshot, protecting it and create
      a child image based on that snapshot afterwards.
      
      The RBD storage driver will try to find a snapshot with zero deltas between
      the current state of the original volume and the snapshot.
      
      If such a snapshot is found a clone/child image will be created using
      the rbd_clone2() function from librbd.
      
      rbd_clone2() is available in librbd since Ceph version Dumpling (0.67) which
      dates back to August 2013.
      
      It will use the same features, strip size and stripe count as the parent image.
      
      This implementation will only create a single snapshot on the parent image if
      never changes. This reduces the amount of snapshots created for that RBD image
      which benefits the performance of the Ceph cluster.
      
      During build the decision will be made to use either rbd_diff_iterate() or
      rbd_diff_iterate2().
      
      The latter is faster, but only available on Ceph versions after 0.94 (Hammer).
      
      Cloning is only supported if RBD format 2 is used. All images created by libvirt
      are already format 2.
      
      If a RBD format 1 image is used as the original volume the backend will report
      a VIR_ERR_OPERATION_UNSUPPORTED error.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      0b15f920
    • W
      rbd: Add support for wiping RBD volumes using TRIM. · 34872ca4
      Wido den Hollander 提交于
      Using VIR_STORAGE_VOL_WIPE_ALG_TRIM a RBD volume can be trimmed down
      to 0 bytes using rbd_discard()
      
      Effectively all the data on the volume will be lost/gone, but the volume
      remains available for use afterwards.
      
      Starting at offset 0 the storage pool will call rbd_discard() in stripe
      size * count increments which is usually 4MB. Stripe size being 4MB and
      count 1.
      
      rbd_discard() is available since Ceph version Dumpling (0.67) which dates
      back to August 2013.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      34872ca4
    • W
      storage: Add TRIM algorithm to storage volume API · 63cdc92f
      Wido den Hollander 提交于
      This new algorithm adds support for wiping volumes using TRIM.
      
      It does not overwrite all the data in a volume, but it tells the
      backing storage pool/driver that all bytes in a volume can be
      discarded.
      
      It depends on the backing storage pool how this is handled.
      
      A SCSI backend might send UNMAP commands to remove all data present
      on a LUN.
      
      A Ceph backend might use rbd_discard() to instruct the Ceph cluster
      that all data on that RBD volume can be discarded.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      63cdc92f
  5. 29 1月, 2016 5 次提交
    • W
      rbd: Add support for wiping RBD volumes · f226ecbf
      Wido den Hollander 提交于
      When wiping the RBD image will be filled with zeros started
      at offset 0 and until the end of the volume.
      
      This will result in the RBD volume growing to it's full allocation
      on the Ceph cluster. All data on the volume will be overwritten
      however, making it unavailable.
      
      It does NOT take any RBD snapshots into account. The original data
      might still be in a snapshot of that RBD volume.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      f226ecbf
    • W
      storage: Adjust fix virStorageBackendVolWipeLocal switch · 69535c61
      Wido den Hollander 提交于
      Use the cast of (virStorageVolWipeAlgorithm) adding the missing case:'s
      (VIR_STORAGE_VOL_WIPE_ALG_ZERO and VIR_STORAGE_VOL_WIPE_ALG_LAST).
      
      Additionally, the old code would also still run the SCRUB command on
      default since it didn't go to cleanup when a invalid flag was supplied.
      We now go to cleanup and exit if a invalid flag would be provided.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      69535c61
    • J
      logical: Fix comment examples for virStorageBackendLogicalFindLVs · 680030c4
      John Ferlan 提交于
      When commit id '82c1740a' made changes to the output format (changing from
      using a ',' separator to '#'), the examples in the lvs output from the
      comments weren't changed.
      
      Additionally, the two new fields added ('segtype' and 'stripes') were
      not included in the output, leaving it well confusing.
      
      This patch fixes the sample output, adds a 'striped' example, and makes
      other comment related adjustments for long line and spacing between followup
      'NB' remarks (while I'm there).
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      680030c4
    • A
      pci: Use bool return type for some virPCIDeviceGet*() functions · 11ef5869
      Andrea Bolognani 提交于
      The affected functions are:
      
        virPCIDeviceGetManaged()
        virPCIDeviceGetUnbindFromStub()
        virPCIDeviceGetRemoveSlot()
        virPCIDeviceGetReprobe()
      
      Change their return type from unsigned int to bool: the corresponding
      members in struct _virPCIDevice are defined as bool, and even the
      corresponding virPCIDeviceSet*() functions take a bool value as input
      so there's no point in these functions having unsigned int as return
      type.
      Suggested-by: NJohn Ferlan <jferlan@redhat.com>
      11ef5869
    • M
      gendispatch: Don't output spaces on empty line · 3f3f7a82
      Michal Privoznik 提交于
      In our generator for some code we put empty lines in the output
      to separate blocks of code. However, in some cases we put couple
      of spaces on the empty line too. It's not bug, it just isn't
      nice.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3f3f7a82