1. 12 11月, 2015 2 次提交
  2. 24 6月, 2015 1 次提交
  3. 18 6月, 2015 1 次提交
  4. 15 6月, 2015 2 次提交
  5. 27 4月, 2015 1 次提交
  6. 21 4月, 2015 3 次提交
    • J
      scsi: Adjust return values from processLU · 98322052
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1171933
      
      Adjust the processLU error returns to be a bit more logical. Currently,
      the calling code cannot determine the difference between a non disk/lun
      volume and a processed/found disk/lun. It can also not differentiate
      between perhaps real/fatal error and one that won't necessarily stop
      the code from finding other volumes.
      
      After this patch virStorageBackendSCSIFindLUsInternal will stop processing
      as soon as a "fatal" message occurs rather than continuting processing
      for no apparent reason. It will also only set the *found value when
      at least one of the processLU's was successful.
      
      With the failed return, if the reason for the stop was that the pool
      target path did not exist, was /dev, was /dev/, or did not start with
      /dev, then iSCSI pool startup and refresh will fail.
      98322052
    • J
      scsi: Change return values for virStorageBackendSCSIFindLUs · 1e13eff4
      John Ferlan 提交于
      Rather than passing/returning a pointer to a boolean to indicate that
      perhaps we should try again - adjust the return of the call to return
      the count of LU's found during processing, then let the caller decide
      what to do with that value.
      1e13eff4
    • J
      scsi: Adjust return value for virStorageBackendSCSINewLun · adb182fa
      John Ferlan 提交于
      Use virStorageBackendPoolUseDevPath API to determine whether creation of
      stable target path is possible for the volume.
      
      This will differentiate a failed virStorageBackendStablePath which won't
      need to be fatal. Thus, we'll add a -2 return value to differentiate that
      the failure was a result of either the inability to find the symlink for
      the device or failure to open the target path directory
      adb182fa
  7. 17 4月, 2015 1 次提交
  8. 02 4月, 2015 2 次提交
  9. 02 3月, 2015 1 次提交
  10. 01 12月, 2014 1 次提交
  11. 20 11月, 2014 2 次提交
    • J
      storage: Add thread to refresh for createVport · 512b8747
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1152382
      
      When libvirt create's the vport (VPORT_CREATE) for the vHBA, there isn't
      enough "time" between the creation and the running of the following
      backend->refreshPool after a backend->startPool in order to find the LU's.
      Population of LU's happens asynchronously when udevEventHandleCallback
      discovers the "new" vHBA port.  Creation of the infrastructure by udev
      is an iterative process creating and discovering actual storage devices and
      adjusting the environment.
      
      Because of the time it takes to discover and set things up, the backend
      refreshPool call done after the startPool call will generally fail to
      find any devices. This leaves the newly started pool appear empty when
      querying via 'vol-list' after startup. The "workaround" has always been
      to run pool-refresh after startup (or any time thereafter) in order to
      find the LU's. Depending on how quickly run after startup, this too may
      not find any LUs in the pool. Eventually though given enough time and
      retries it will find something if LU's exist for the vHBA.
      
      This patch adds a thread to be executed after the VPORT_CREATE which will
      attempt to find the LU's without requiring the external run of refresh-pool.
      It does this by waiting for 5 seconds and searching for the LU's. If any
      are found, then the thread completes; otherwise, it will retry once more
      in another 5 seconds.  If none are found in that second pass, the thread
      gives up.
      
      Things learned while investigating this... No need to try and fill the
      pool too quickly or too many times. Over the course of creation, the udev
      code may 'add', 'change', and 'delete' the same device. So if the refresh
      code runs and finds something, it may display it only to have a subsequent
      refresh appear to "lose" the device. The udev processing doesn't seem to
      have a way to indicate that it's all done with the creation processing of a
      newly found vHBA. Only the Lone Ranger has silver bullets to fix everything.
      512b8747
    • J
      storage: Fix issue finding LU's when block doesn't exist · 20870417
      John Ferlan 提交于
      Fix a problem in the getBlockDevice and processLU where retval initialized
      to zero causing some failures to erroneously continue through to the
      virStorageBackendSCSINewLun with an attempt to find a path for "/dev/(null)".
      This would fail approximately 10 seconds later with debug message:
      
      virStorageBackendSCSINewLun:203 :
           No stable path found for '/dev/(null)' in '/dev/disk/by-path'
      
      The root cause of the issue is for many /sys/bus/scsi/devices/<lun path>
      there is no "block*" device found for the vHBA's, where "<lun path>" are
      the various paths created for the vHBA, such as "17:0:0:0", "17:0:1:0",
      "17:0:2:0", "17:0:3:0", etc.  If the block device isn't found, then the
      directory should just be ignored rather than attempting to process it.
      
      The bug was that in getBlockDevice the assumption was "block" would exist
      and either getNewStyleBlockDevice or getOldStyleBlockDevice would fill in
      @block_device. However, if 'block*' doesn't exist, then the code returned
      NULL for block_device *and* a good (zero) retval value.  This caused the
      processLU code to attempt the virStorageBackendSCSINewLun which failed
      "at some point in time" in the future.
      
      After this change - on test system the refresh-pool didn't have a noticable
      pause of about 20 seconds - it completed within a second since no longer
      was there an attempt/need to find "/dev/(null)".
      
      Additionally, the virStorageBackendSCSIFindLU's shouldn't be declaring
      found unless the processLU actually returns success. This will be
      important in the followup patch which relies on whether a LU was found.
      20870417
  12. 15 11月, 2014 1 次提交
  13. 12 11月, 2014 4 次提交
    • 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: Don't use a stack copy of the adapter · 5b226fcd
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160926
      
      Passing a copy of the storage pool adapter to a function just changes the
      copy of the fields in the particular function and then when returning to
      the caller those changes are discarded.  While not yet biting us in the
      storage clean-up case, it did cause an issue for the fchost storage pool
      startup case, createVport.  The issue was at startup, if no parent is found
      in the XML, the code will search for the 'best available' parent and then
      store that in the in memory copy of the adapter.  Of course, in this case
      it was a copy, so when returning to the virStorageBackendSCSIStartPool that
      change was discarded (or lost) from the pool->def->source.adapter which
      meant at shutdown (deleteVport), the code assumed no adapter was passed
      and skipped the deletion, leaving the vHBA created by libvirt still defined
      requiring an additional stop of a nodedev-destroy to remove.
      
      Adjusted the createVport to take virStoragePoolDefPtr instead of the
      adapter copy. Then use the virStoragePoolSourceAdapterPtr when processing.
      A future patch will need the 'def' anyway, so this just sets up for that.
      5b226fcd
    • 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
    • J
      storage: Check for valid fc_host parent at startup · 844c1d7e
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1160565
      
      If a 'parent' attribute is provided for the fchost, then at startup
      time check to ensure it is a vport capable scsi_host. If the parent
      is not vport capable, then disallow the startup. The following is the
      expected results:
      
      error: Failed to start pool fc_pool
      error: XML error: parent 'scsi_host2' specified for vHBA is not vport capable
      
      where the XML for the fc_pool is:
      
          <pool type='scsi'>
            <name>fc_pool</name>
            <source>
              <adapter type='fc_host' parent='scsi_host2' wwnn='5001a4aaf3ca174b' wwpn='5001a4a77192b864'/>
            </source>
      ...
      
      and 'scsi_host2' is not vport capable.
      
      Providing an incorrect parent and a correct wwnn/wwpn could lead to
      failures at shutdown (deleteVport) where the assumption is the parent
      is for the fchost.
      
      NOTE: If the provided wwnn/wwpn doesn't resolve to an existing scsi_host,
            then we will be creating one with code (virManageVport) which
            assumes the parent is vport capable.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      844c1d7e
  14. 29 10月, 2014 2 次提交
  15. 22 7月, 2014 4 次提交
  16. 17 7月, 2014 1 次提交
  17. 11 7月, 2014 1 次提交
  18. 02 5月, 2014 1 次提交
    • J
      Restore skipping of setting capacity · f1856eb6
      John Ferlan 提交于
      Commit id 'ac9a0963' refactored out the 'withCapacity' for the
      virStorageBackendUpdateVolInfo() API.  See:
      
      http://www.redhat.com/archives/libvir-list/2014-April/msg00043.html
      
      This resulted in a difference in how 'virsh vol-info --pool <poolName>
      <volume>' or 'virsh vol-list vol-list --pool <poolName> --details' outputs
      the capacity information for a directory pool with a qcow2 sparse file.
      
      For example, using the following XML
      
      mkdir /home/TestPool
      cat testpool.xml
      <pool type='dir'>
        <name>TestPool</name>
        <uuid>6bf80895-10b6-75a6-6059-89fdea2aefb7</uuid>
        <source>
        </source>
        <target>
          <path>/home/TestPool</path>
          <permissions>
            <mode>0755</mode>
            <owner>0</owner>
            <group>0</group>
          </permissions>
        </target>
      </pool>
      
      virsh pool-create testpool.xml
      virsh vol-create-as --pool TestPool temp_vol_1 \
            --capacity 1048576 --allocation 1048576 --format qcow2
      virsh vol-info --pool TestPool temp_vol_1
      
      Results in listing a Capacity value.  Prior to the commit, the value would
      be '1.0 MiB' (1048576 bytes). However, after the commit the output would be
      (for example) '192.50 KiB', which for my system was the size of the volume
      in my file system (eg 'ls -l TestPool/temp_vol_1' results in '197120' bytes
      or 192.50 KiB). While perhaps technically correct, it's not necessarily
      what the user expected (certainly virt-test didn't expect it).
      
      This patch restores the code to not update the target capacity for this path
      f1856eb6
  19. 29 4月, 2014 1 次提交
    • E
      storage: use virDirRead API · 56a03233
      Eric Blake 提交于
      More instances of failure to report (unlikely) readdir errors.
      In one case, I chose to ignore them, given that a readdir error
      would be no different than timing out on the loop, where the
      fallback path behaves correctly either way.
      
      * src/storage/storage_backend.c (virStorageBackendStablePath):
      Ignore readdir errors.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemRefresh): Report readdir errors.
      * src/storage/storage_backend_iscsi.c
      (virStorageBackendISCSIGetHostNumber): Likewise.
      * src/storage/storage_backend_scsi.c (getNewStyleBlockDevice)
      (getBlockDevice, virStorageBackendSCSIFindLUs): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      56a03233
  20. 03 4月, 2014 1 次提交
    • C
      storage: Report error from VolOpen by default · 138e65c3
      Cole Robinson 提交于
      Currently VolOpen notifies the user of a potentially non-fatal failure by
      returning -2 and logging a VIR_WARN or VIR_INFO. Unfortunately most
      callers treat -2 as fatal but don't actually report any message with
      the error APIs.
      
      Rename the VOL_OPEN_ERROR flag to VOL_OPEN_NOERROR. If NOERROR is specified,
      we preserve the current behavior of returning -2 (there's only one caller
      that wants this).
      
      However in the default case, only return -1, and actually use the error
      APIs. Fix up a couple callers as a result.
      138e65c3
  21. 02 4月, 2014 2 次提交
    • E
      conf: drop redundant parameters during probe · ac9a0963
      Eric Blake 提交于
      Now that each virStorageSource can track allocation information,
      and given that we already have the information without extra
      syscalls, it's easier to just always populate the information
      directly into the struct than it is to sometimes pass the address
      of the struct members down the call chain.
      
      * src/storage/storage_backend.h (virStorageBackendUpdateVolInfo)
      (virStorageBackendUpdateVolTargetInfo)
      (virStorageBackendUpdateVolTargetInfoFD): Update signature.
      * src/storage/storage_backend.c (virStorageBackendUpdateVolInfo)
      (virStorageBackendUpdateVolTargetInfo)
      (virStorageBackendUpdateVolTargetInfoFD): Always populate struct
      members instead.
      * src/storage/storage_backend_disk.c
      (virStorageBackendDiskMakeDataVol): Update client.
      * src/storage/storage_backend_fs.c (virStorageBackendProbeTarget)
      (virStorageBackendFileSystemRefresh)
      (virStorageBackendFileSystemVolRefresh): Likewise.
      * src/storage/storage_backend_gluster.c
      (virStorageBackendGlusterRefreshVol): Likewise.
      * src/storage/storage_backend_logical.c
      (virStorageBackendLogicalMakeVol): Likewise.
      * src/storage/storage_backend_mpath.c
      (virStorageBackendMpathNewVol): Likewise.
      * src/storage/storage_backend_scsi.c
      (virStorageBackendSCSINewLun): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ac9a0963
    • 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
  22. 01 4月, 2014 1 次提交
  23. 25 3月, 2014 1 次提交
  24. 18 3月, 2014 1 次提交
  25. 10 3月, 2014 1 次提交
  26. 12 2月, 2014 1 次提交