1. 07 3月, 2019 4 次提交
  2. 12 2月, 2019 1 次提交
  3. 04 2月, 2019 1 次提交
  4. 05 12月, 2018 1 次提交
  5. 12 11月, 2018 1 次提交
    • E
      conf: Add new module node_device_util · f1e8d2f0
      Erik Skultety 提交于
      There's a lot of stuff going on in src/conf/nodedev_conf which is
      sometimes not directly related to config and we're not really consistent
      with putting only parser/formatter related stuff here, e.g. like we do
      for domains. So, let's start simply by adding a new module
      node_device_util containing some of the helpers. Unfortunately, even
      though these helpers tend to open a secondary driver connection and would
      be much therefore better suited as a nodedev driver module, we can't do
      that without pulling headers from the driver into conf/ and that's wrong
      because we want conf/ to stay driver-agnostic.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      Acked-by: NMichal Privoznik <mprivozn@redhat.com>
      f1e8d2f0
  6. 04 9月, 2018 5 次提交
  7. 14 8月, 2018 3 次提交
  8. 06 8月, 2018 1 次提交
  9. 29 5月, 2018 1 次提交
    • J
      storage: Remove rwlocks during virStoragePoolObjListForEach · ff57a713
      John Ferlan 提交于
      Remove the locks since they are unnecessary and would cause
      a hang for a driver reload/restart when a transient pool was
      previously active as a result of the call:
      
      virStoragePoolUpdateInactive:
      ...
          if (!virStoragePoolObjGetConfigFile(obj)) {
              virStoragePoolObjRemove(driver->pools, obj);
      ...
      
      stack trace:
      
      Thread 17 (Thread 0x7fffcc574700 (LWP 12465)):
      ...pthread_rwlock_wrlock
      ...virRWLockWrite
      ...virObjectRWLockWrite
      ...virStoragePoolObjRemove
      ...virStoragePoolUpdateInactive
      ...storagePoolUpdateStateCallback
      ...virStoragePoolObjListForEachCb
      ...virHashForEach
      ...virStoragePoolObjListForEach
      ...storagePoolUpdateAllState
      ...storageStateInitialize
      ...virStateInitialize
      ...daemonRunStateInit
      ...virThreadHelper
      ...start_thread
      ...clone
      
      Introduced by commit id 4b2e0ed6.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
      ff57a713
  10. 18 4月, 2018 1 次提交
    • M
      virobject: Introduce VIR_CLASS_NEW() macro · 10f94828
      Michal Privoznik 提交于
      So far we are repeating the following lines over and over:
      
        if (!(virSomeObjectClass = virClassNew(virClassForObject(),
                                   "virSomeObject",
                                   sizeof(virSomeObject),
                                   virSomeObjectDispose)))
            return -1;
      
      While this works, it is impossible to do some checking. Firstly,
      the class name (the 2nd argument) doesn't match the name in the
      code in all cases (the 3rd argument). Secondly, the current style
      is needlessly verbose. This commit turns example into following:
      
        if (!(VIR_CLASS_NEW(virSomeObject,
                            virClassForObject)))
            return -1;
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      10f94828
  11. 10 1月, 2018 2 次提交
    • J
      storage: Complete implementation volume by hash object · be1bb6c9
      John Ferlan 提交于
      Alter the volume logic to use the hash tables instead of forward
      linked lists. There are three hash tables to allow for fast lookup
      by name, target.path, and key.
      
      Modify the virStoragePoolObjAddVol to place the object in all 3
      tables if possible using self locking RWLock on the volumes object.
      Conversely when removing the volume, it's a removal of the object
      from the various hash tables.
      
      Implement functions to handle remote ForEach and Search Volume
      type helpers. These are used by the disk backend in order to
      facilitate adding a primary, extended, or logical partition.
      
      Implement the various VolDefFindBy* helpers as simple (and fast)
      hash lookups. The NumOfVolumes, GetNames, and ListExport helpers
      are all implemented using standard for each hash table calls.
      be1bb6c9
    • J
      storage: Introduce _virStorageVolObj[List] · f77c898d
      John Ferlan 提交于
      Prepare for hash table volume lists by creating the object infrastructure
      for a Volume Object and Volume Object List
      
      The _virStorageVolObj will contain just a pointer to the "current"
      (and live) volume definition.
      
      The _virStorageVolObjList will contain three hash tables, one for
      each of the lookup options allowed for a volume.
      f77c898d
  12. 04 1月, 2018 2 次提交
  13. 14 12月, 2017 2 次提交
    • J
      storage: Convert virStoragePoolObjList to use virObjectRWLockable · 4b2e0ed6
      John Ferlan 提交于
      Now that we have a private storage pool list, we can take the next
      step and convert to using objects. In this case, we're going to use
      RWLockable objects (just like every other driver) with two hash
      tables for lookup by UUID or Name.
      
      Along the way the ForEach and Search API's will be adjusted to use
      the related Hash API's and the various FindBy functions altered and
      augmented to allow for HashLookup w/ and w/o the pool lock already
      taken.
      
      After virStoragePoolObjRemove we will need to virObjectUnref(obj)
      after to indicate the caller is "done" with it's reference. The
      Unlock occurs during the Remove.
      
      The NumOf, GetNames, and Export functions all have their own callback
      functions to return the required data and the FindDuplicate code
      can use the HashSearch function callbacks.
      4b2e0ed6
    • J
      storage: Privatize virStoragePoolObjListPtr · 90e65353
      John Ferlan 提交于
      Move the structure into virstorageobj.c.
      
      Use the virStoragePoolObjListNew allocator to fill in the @pools for
      the storage driver and test driver.
      90e65353
  14. 24 11月, 2017 4 次提交
    • J
      storage: Convert virStoragePoolObj into virObjectLockable · dcb5d8bb
      John Ferlan 提交于
      Now that we're moved the object into virstorageobj, let's make the
      code use the lockable object.
      dcb5d8bb
    • J
      storage: Introduce virStoragePoolObjListSearch · 5d5c732d
      John Ferlan 提交于
      Create an API to search through the storage pool objects looking for
      a specific truism from a callback API in order to return the specific
      storage pool object that is desired.
      5d5c732d
    • J
      storage: Introduce virStoragePoolObjListForEach · d0258dd9
      John Ferlan 提交于
      Create an API to walk the pools->objs[] list in order to perform a
      callback function for each element of the objs array that doesn't care
      about whether the action succeeds or fails as the desire is to run the
      code over every element in the array rather than fail as soon as or if
      one fails.
      d0258dd9
    • J
      storage: Introduce virStoragePoolObjEndAPI · 770aa08e
      John Ferlan 提交于
      For now it'll just call the virStoragePoolObjUnlock, but a future
      adjustment will do something different. Since the new API will check
      for a NULL object before the Unlock call, callers no longer need to
      check for NULL before calling.
      
      The virStoragePoolObjUnlock is now private/static to virstorageobj.c
      with a short term forward reference.
      770aa08e
  15. 08 11月, 2017 1 次提交
  16. 06 10月, 2017 1 次提交
  17. 19 9月, 2017 6 次提交
    • J
      storage: Internally represent @autostart as bool · ccc8c311
      John Ferlan 提交于
      Since it's been used that way anyway, let's just convert it to a bool
      and only make the external representation be an int.
      ccc8c311
    • J
      storage: Introduce APIs to search/scan storage pool volumes list · 5bf9b655
      John Ferlan 提交于
      Introduce virStoragePoolObjForEachVolume to scan each volume
      calling the passed callback function until all volumes have been
      processed in the storage pool volume list, unless the callback
      function returns an error.
      
      Introduce virStoragePoolObjSearchVolume to search each volume
      calling the passed callback function until it returns true
      indicating that the desired volume was found.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      5bf9b655
    • J
      storage: Introduce storage volume add, delete, count APIs · 40630a8e
      John Ferlan 提交于
      Create/use virStoragePoolObjAddVol in order to add volumes onto list.
      
      Create/use virStoragePoolObjRemoveVol in order to remove volumes from list.
      
      Create/use virStoragePoolObjGetVolumesCount to get count of volumes on list.
      
      For the storage driver, the logic alters when the volumes.obj list grows
      to after we've fetched the volobj. This is an optimization of sorts, but
      also doesn't "needlessly" grow the volumes.objs list and then just decr
      the count if the virGetStorageVol fails.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      40630a8e
    • J
      storage: Fill in storage pool @active properly · acd9a380
      John Ferlan 提交于
      It's a bool not an int, so use true/false and not 1/0
      acd9a380
    • J
      storage: Introduce virStoragePoolObjNew · 407e6a36
      John Ferlan 提交于
      Create/use a helper to perform object allocation.
      
      Adjust storagevolxml2argvtest.c in order to use the allocator and
      setting of the obj->def.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      407e6a36
    • J
      storage: Create accessor API's for virStoragePoolObj · b3198286
      John Ferlan 提交于
      In preparation for making a private object, create accessor API's for
      consumer storage functions to use:
      
          virStoragePoolObjGetDef
          virStoragePoolObjSetDef
          virStoragePoolObjGetNewDef
          virStoragePoolObjDefUseNewDef
          virStoragePoolObjGetConfigFile
          virStoragePoolObjSetConfigFile
          virStoragePoolObjGetAutostartLink
          virStoragePoolObjIsActive
          virStoragePoolObjSetActive
          virStoragePoolObjIsAutostart
          virStoragePoolObjSetAutostart
          virStoragePoolObjGetAsyncjobs
          virStoragePoolObjIncrAsyncjobs
          virStoragePoolObjDecrAsyncjobs
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      b3198286
  18. 17 8月, 2017 1 次提交
  19. 22 7月, 2017 2 次提交