1. 30 1月, 2016 1 次提交
    • 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
  2. 29 1月, 2016 1 次提交
    • 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
  3. 18 1月, 2016 1 次提交
  4. 06 1月, 2016 3 次提交
    • W
      rbd: Do not append Ceph monitor port number 6789 if not provided · 6343018f
      Wido den Hollander 提交于
      If no port number was provided for a storage pool libvirt defaults to
      port 6789; however, librbd/librados already default to 6789 when no port
      number is provided.
      
      In the future Ceph will switch to a new port for the Ceph monitors since
      port 6789 is already assigned to a different application by IANA.
      
      Port 6789 is assigned to SMC-HTTPS and Ceph now has port 3300 assigned as
      the 'Ceph monitor' port.
      
      In this case it is the best solution to not hardcode any port number into
      libvirt and let librados handle the connection.
      
      Only if a user specifies a different port number we pass it down to librados,
      otherwise we leave it blank.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      
      merge
      6343018f
    • W
      rbd: Do not error out on a single image during pool refresh · f46d137e
      Wido den Hollander 提交于
      It could happen that rbd_list() returns X names, but that while
      refreshing the pool one of those RBD images is removed from Ceph
      through a different route then libvirt.
      
      We do not need to error out in such case, we can simply ignore the
      volume and continue.
      
        error : volStorageBackendRBDRefreshVolInfo:289 :
          failed to open the RBD image 'vol-998': No such file or directory
      
      It could also be that one or more Placement Groups (PGs) inside Ceph
      are inactive due to a system failure.
      
      If that happens it could be that some RBD images can not be refreshed
      and a timeout will be raised by librados.
      
        error : volStorageBackendRBDRefreshVolInfo:289 :
          failed to open the RBD image 'vol-893': Connection timed out
      
      Ignore the error and continue to refresh the rest of the pool's
      contents.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      f46d137e
    • W
      rbd: Only close RBD image if it has been opened · 10028a9d
      Wido den Hollander 提交于
      It could be that we error out while the RBD image has not been
      opened yet. This would cause us to call rbd_close() on pointer
      which has not been initialized.
      
      Set it to NULL by default and only close if it is not NULL.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      10028a9d
  5. 04 1月, 2016 1 次提交
    • W
      rbd: Return VIR_STORAGE_FILE_RAW as format for RBD volumes · 688623b5
      Wido den Hollander 提交于
      This used to return 'unkown' and that was not correct.
      
      A vol-dumpxml now returns:
      
      <volume type='network'>
        <name>image3</name>
        <key>libvirt/image3</key>
        <source>
        </source>
        <capacity unit='bytes'>10737418240</capacity>
        <allocation unit='bytes'>10737418240</allocation>
        <target>
          <path>libvirt/image3</path>
          <format type='raw'/>
        </target>
      </volume>
      
      The RBD driver will now error out if a different format than RAW
      is provided when creating a volume.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      688623b5
  6. 18 12月, 2015 1 次提交
    • J
      storage: Add virCheckFlags to virStorageBackendRBDDeleteVol · be783825
      John Ferlan 提交于
      The initial commit '74951ead' did not include the proper check for whether
      any flags are supported by the driver.
      
      Even though the driver doesn't support VIR_STORAGE_VOL_DELETE_ZEROED,
      it still checks and allows the processing to continue
      
      Also add the new VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS since it is handled
      as of commit id '3c7590e0'.
      be783825
  7. 28 10月, 2015 1 次提交
  8. 14 10月, 2015 1 次提交
  9. 17 7月, 2015 2 次提交
    • J
      rbd: Return error from rbd_create for message processing · 279238fe
      John Ferlan 提交于
      Resolving an error reporting bug introduced by commit id '761491eb' which
      just took the return of virStorageBackendRBDCreateImage and used it as
      the basis for the message generated. This would generate EPERM regardless
      of error seen.
      279238fe
    • W
      rbd: Use RBD format 2 by default when creating images. · 045cac32
      Wido den Hollander 提交于
      We used to look at the librbd code version and depending on that
      we would invoke rbd_create3() or rbd_create().
      
      Since librbd version 0.67.9 we can however tell RBD that it should
      create rbd format 2 images even if we invoke rbd_create().
      
      The less options we pass to librbd, the more we can lean on the sane
      defaults it uses.
      
      For rbd_create3() we had things like the stripe count and unit hardcoded
      in libvirt and that might cause problems down the road.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      045cac32
  10. 02 6月, 2015 1 次提交
  11. 02 3月, 2015 1 次提交
  12. 03 12月, 2014 1 次提交
    • J
      Replace virSecretFree with virObjectUnref · a0b13d35
      John Ferlan 提交于
      Since virSecretFree will call virObjectUnref anyway, let's just use that
      directly so as to avoid the possibility that we inadvertently clear out
      a pending error message when using the public API.
      a0b13d35
  13. 15 11月, 2014 1 次提交
  14. 04 7月, 2014 1 次提交
    • J
      Utilize virDomainDiskAuth for storage pools · 97e3397c
      John Ferlan 提交于
      Replace the authType, chap, and cephx unions in virStoragePoolSource
      with a single pointer to a virStorageAuthDefPtr.  Adjust all users of
      the previous chap/cephx and secret unions with the source->auth data.
      97e3397c
  15. 03 7月, 2014 2 次提交
    • J
      Use virBufferCheckError everywhere we report OOM error · 92a8e72f
      Ján Tomko 提交于
      Replace:
      if (virBufferError(&buf)) {
          virBufferFreeAndReset(&buf);
          virReportOOMError();
          ...
      }
      
      with:
      if (virBufferCheckError(&buf) < 0)
          ...
      
      This should not be a functional change (unless some callers
      misused the virBuffer APIs - a different error would be reported
      then)
      92a8e72f
    • J
      More indentation fixes · 275f0224
      Ján Tomko 提交于
      Reindent nwfilter gentech driver and one block in rbd storage backend.
      275f0224
  16. 29 4月, 2014 1 次提交
  17. 02 4月, 2014 1 次提交
    • E
      conf: track sizes directly in source struct · cce2410a
      Eric Blake 提交于
      One of the features of qcow2 is that a wrapper file can have
      more capacity than its backing file from the guest's perspective;
      what's more, sparse files make tracking allocation of both
      the active and backing file worthwhile.  As such, it makes
      more sense to show allocation numbers for each file in a chain,
      and not just the top-level file.  This sets up the fields for
      the tracking, although it does not modify XML to display any
      new information.
      
      * src/util/virstoragefile.h (_virStorageSource): Add fields.
      * src/conf/storage_conf.h (_virStorageVolDef): Drop redundant
      fields.
      * src/storage/storage_backend.c (virStorageBackendCreateBlockFrom)
      (createRawFile, virStorageBackendCreateQemuImgCmd)
      (virStorageBackendCreateQcowCreate): Update clients.
      * src/storage/storage_driver.c (storageVolDelete)
      (storageVolCreateXML, storageVolCreateXMLFrom, storageVolResize)
      (storageVolWipeInternal, storageVolGetInfo): Likewise.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget)
      (virStorageBackendFileSystemRefresh)
      (virStorageBackendFileSystemVolResize)
      (virStorageBackendFileSystemVolRefresh): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalMakeVol)
      (virStorageBackendLogicalCreateVol): Likewise.
      * src/storage/storage_backend_scsi.c
      (virStorageBackendSCSINewLun): Likewise.
      * src/storage/storage_backend_mpath.c
      (virStorageBackendMpathNewVol): Likewise.
      * src/storage/storage_backend_rbd.c
      (volStorageBackendRBDRefreshVolInfo)
      (virStorageBackendRBDCreateImage): Likewise.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskMakeDataVol)
      (virStorageBackendDiskCreateVol): Likewise.
      * src/storage/storage_backend_sheepdog.c
      (virStorageBackendSheepdogBuildVol)
      (virStorageBackendSheepdogParseVdiList): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageBackendGlusterRefreshVol): Likewise.
      * src/conf/storage_conf.c (virStorageVolDefFormat)
      (virStorageVolDefParseXML): Likewise.
      * src/test/test_driver.c (testOpenVolumesForPool)
      (testStorageVolCreateXML, testStorageVolCreateXMLFrom)
      (testStorageVolDelete, testStorageVolGetInfo): Likewise.
      * src/esx/esx_storage_backend_iscsi.c (esxStorageVolGetXMLDesc):
      Likewise.
      * src/esx/esx_storage_backend_vmfs.c (esxStorageVolGetXMLDesc)
      (esxStorageVolCreateXML): Likewise.
      * src/parallels/parallels_driver.c (parallelsAddHddByVolume):
      Likewise.
      * src/parallels/parallels_storage.c (parallelsDiskDescParseNode)
      (parallelsStorageVolDefineXML, parallelsStorageVolCreateXMLFrom)
      (parallelsStorageVolDefRemove, parallelsStorageVolGetInfo):
      Likewise.
      * src/vbox/vbox_tmpl.c (vboxStorageVolCreateXML)
      (vboxStorageVolGetXMLDesc): Likewise.
      * tests/storagebackendsheepdogtest.c (test_vdi_list_parser):
      Likewise.
      * src/phyp/phyp_driver.c (phypStorageVolCreateXML): Likewise.
      cce2410a
  18. 25 3月, 2014 1 次提交
  19. 18 3月, 2014 1 次提交
  20. 12 3月, 2014 1 次提交
    • J
      storage: Fix bugs in VIR_APPEND_ELEMENT series · ea10cd76
      John Ferlan 提交于
      From commit id 'd53bbfd1'
      
      Found one core and one possible memory leak. Core seen during local
      virt-test/tp_libvirt run for the vol_create_from test. The memory leak
      was seen by inspection during a review of all VIR_APPEND_ELEMENT changes
      
      In storage_backend_disk/virStorageBackendDiskMakeDataVol(), the 'vol'
      needs to be kept around since it's used later, so use the _COPY macro.
      This caused a segv in libvirtd:
      
      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7fffe87c3700 (LWP 6919)]
      virStorageBackendDiskMakeDataVol (vol=0x0, groups=0x7fffc8000d70, pool=0x7fffc8002460) at storage/storage_backend_disk.c:66
      66          if (vol->target.path == NULL) {
      
      In storage_backend_rbd/virStorageBackendRBDRefreshPool() there's a failure
      path where the 'vol' needs to go through virStorageVolDefFree() since it
      wouldn't be appended.
      ea10cd76
  21. 10 3月, 2014 1 次提交
  22. 25 2月, 2014 2 次提交
  23. 11 2月, 2014 1 次提交
  24. 16 1月, 2014 1 次提交
  25. 11 12月, 2013 1 次提交
  26. 21 11月, 2013 1 次提交
    • E
      maint: fix comma style issues: remaining code · e44a9a70
      Eric Blake 提交于
      Most of our code base uses space after comma but not before;
      fix the remaining uses before adding a syntax check.
      
      * src/network/bridge_driver.c: Consistently use commas.
      * src/node_device/node_device_hal.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/storage/storage_backend_rbd.c: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e44a9a70
  27. 31 10月, 2013 1 次提交
    • E
      storage: use correct type for array count · 41183cf7
      Eric Blake 提交于
      Using size_t counts will let us use VIR_APPEND_ELEMENT and friends.
      
      * src/conf/storage_conf.h (_virStoragePoolObjList)
      (_virStorageVolDefList): Track list sizes with size_t.
      * src/storage/storage_backend_rbd.c
      (virStorageBackendRBDRefreshPool): Fix type fallout.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      41183cf7
  28. 30 10月, 2013 1 次提交
    • E
      storage: fix incorrect typedef · 8e7f57a7
      Eric Blake 提交于
      The rbd code had a confusing typedef ending in Ptr that was not
      actually a pointer, which made the rest of the code harder to
      read.  This fixes things to actually pass by pointer rather than
      by copy.
      
      * src/storage/storage_backend_rbd.c (virStorageBackendStatePtr):
      Fix typedef.
      (virStorageBackendRBDOpenRADOSConn)
      (virStorageBackendRBDCloseRADOSConn)
      (volStorageBackendRBDRefreshVolInfo)
      (virStorageBackendRBDRefreshPool, virStorageBackendRBDDeleteVol)
      (virStorageBackendRBDCreateVol, virStorageBackendRBDRefreshVol)
      (virStorageBackendRBDResizeVol): Fix fallout.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      8e7f57a7
  29. 15 10月, 2013 1 次提交
  30. 21 8月, 2013 1 次提交
    • J
      Report secret usage error message similarly · 1fa7946f
      John Ferlan 提交于
      Each of the modules handled reporting error messages from the secret fetching
      slightly differently with respect to the error. Provide a similar message
      for each error case and provide as much data as possible.
      1fa7946f
  31. 23 7月, 2013 1 次提交
    • J
      Adjust 'ceph' authentication secret usage for rbd pool. · c2257d2e
      John Ferlan 提交于
      Update virStorageBackendRBDOpenRADOSConn() to use the internal API to the
      secret driver in order to get the secret value instead of the external
      virSecretGetValue() path. Without the flag VIR_SECRET_GET_VALUE_INTERNAL_CALL
      there is no way to get the value of private secret.
      
      This also requires ensuring there is a connection which wasn't true for
      for the refreshPool() path calls from storageDriverAutostart() prior to
      adding support for the connection to a qemu driver. It seems calls to
      virSecretLookupByUUIDString() and virSecretLookupByUsage() from the
      refreshPool() path would have failed with no way to find the secret - that is
      theoretically speaking since the 'conn' was NULL the failure would have been
      "failed to find the secret".
      c2257d2e
  32. 16 7月, 2013 1 次提交
  33. 11 7月, 2013 1 次提交
  34. 10 7月, 2013 1 次提交
  35. 10 5月, 2013 1 次提交