- 07 3月, 2019 4 次提交
-
-
由 Andrea Bolognani 提交于
When dealing with internal paths we don't need to worry about whether or not suffixes are lowercase since we have full control over them, which means we can avoid performing case-insensitive string comparisons. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> ACKed-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
Despite its name, this is really just a general-purpose string manipulation function, so it should be moved to the virstring module and renamed accordingly. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> ACKed-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
Despite its name, this is really just a general-purpose string manipulation function, so it should be moved to the virstring module and renamed accordingly. A few trivial whitespace changes are squashed in. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> ACKed-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Andrea Bolognani 提交于
Despite its name, this is really just a general-purpose string manipulation function, so it should be moved to the virstring module and renamed accordingly. In addition to the obvious s/File/String/, also tweak the name to make it clear that the presence of the suffix is verified using case-insensitive comparison. A few trivial whitespace changes are squashed in. Signed-off-by: NAndrea Bolognani <abologna@redhat.com> ACKed-by: NPeter Krempa <pkrempa@redhat.com>
-
- 12 2月, 2019 1 次提交
-
-
由 John Ferlan 提交于
Let's make use of the auto __cleanup capabilities cleaning up any now unnecessary goto paths. Signed-off-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 04 2月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
Missing semicolon at the end of macros can confuse some analyzers (like cppcheck <filename>). VIR_ONCE_GLOBAL_INIT is almost exclusively called without an ending semicolon, but let's standardize on using one like the other macros. Add a dummy struct definition at the end of the macro, so the compiler will require callers to add a semicolon. Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 05 12月, 2018 1 次提交
-
-
由 Yuri Chornoivan 提交于
Signed-off-by: NYuri Chornoivan <yurchor@ukr.net> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 12 11月, 2018 1 次提交
-
-
由 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>
-
- 04 9月, 2018 5 次提交
-
-
由 Michal Privoznik 提交于
Just like a few commits earlier, checking for pool source duplicates and unlocking pools list afterwards is a buggy pattern. The check must go into virStoragePoolObjAssignDef. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Michal Privoznik 提交于
The @conn argument is needed only to do some source matching in case of iSCSI source. Anyway, it's used just for node device driver and as such can be replaced with virGetConnectNodeDev(). At the same time, the @conn struct member is dropped from _virStoragePoolObjFindDuplicateData. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Michal Privoznik 提交于
This function is going to be made static in used in virStoragePoolObjAssignDef(). Therefore move it and all the static functions it calls a few lines up. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Michal Privoznik 提交于
Even though we do some checking it is not as thorough as it should be. We already have virStoragePoolObjIsDuplicate but the way we use it is a typical TOCTOU. Imagine two threads trying to define two pools with the same name but different UUIDs. With the current code neither of them finds a duplicate and thus proceed to virStoragePoolObjAssignDef where only names are compared. Therefore both threads succeed which is obviously wrong. We should check for duplicates where we care for them. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
由 Michal Privoznik 提交于
This function is going to be made static in used in virStoragePoolObjAssignDef(). Therefore move it a few lines up. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
-
- 14 8月, 2018 3 次提交
-
-
由 Anya Harter 提交于
name match functions to be the vir prefix and interface name followed by ObjMatch ex. for virNetworkObjListExport, the match function is named virNetworkObjMatch Signed-off-by: NAnya Harter <aharter@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
由 Anya Harter 提交于
name functions to be the name of the export function followed by Callback ex. for virInterfaceObjListExport, the callback function is named virInterfaceObjListExportCallback Signed-off-by: NAnya Harter <aharter@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
由 Anya Harter 提交于
name structs to be the name of the Export function followed by Data also tweak definitions to follow standard struct definition pattern ex. for virInterfaceObjListExport, the struct is defined as follows: typedef struct _virInterfaceObjListExportData virInterfaceObjListExportData; typedef virInterfaceObjListExportData *virInterfaceObjListExportDataPtr; struct _virInterfaceObjListExportData {...}; Signed-off-by: NAnya Harter <aharter@redhat.com> Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
-
- 06 8月, 2018 1 次提交
-
-
由 Clementine Hayat 提交于
Introducing the pool as a noop. Integration inside the build system. Implementation will be in the following commits. Signed-off-by: NClementine Hayat <clem@lse.epita.fr> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 29 5月, 2018 1 次提交
-
-
由 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>
-
- 18 4月, 2018 1 次提交
-
-
由 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>
-
- 10 1月, 2018 2 次提交
-
-
由 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.
-
由 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.
-
- 04 1月, 2018 2 次提交
-
-
由 John Ferlan 提交于
Use a bool as that's how the variable is used in the function.
-
由 John Ferlan 提交于
The RW pool could be left locked if allocation fails.
-
- 14 12月, 2017 2 次提交
-
-
由 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.
-
由 John Ferlan 提交于
Move the structure into virstorageobj.c. Use the virStoragePoolObjListNew allocator to fill in the @pools for the storage driver and test driver.
-
- 24 11月, 2017 4 次提交
-
-
由 John Ferlan 提交于
Now that we're moved the object into virstorageobj, let's make the code use the lockable object.
-
由 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.
-
由 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.
-
由 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.
-
- 08 11月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Move the structures into virstorageobj so that both are known within virstorageobj.c.
-
- 06 10月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Modify virStoragePoolObjGetAutostartLink and virStoragePoolObjGetConfigFile to return "const char *" since that's how both are used and to ensure no one tries to VIR_FREE the result.
-
- 19 9月, 2017 6 次提交
-
-
由 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.
-
由 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>
-
由 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>
-
由 John Ferlan 提交于
It's a bool not an int, so use true/false and not 1/0
-
由 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>
-
由 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>
-
- 17 8月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Rename the variable, recent review requested just use of @filter, so be consistent throughout.
-
- 22 7月, 2017 2 次提交
-
-
由 John Ferlan 提交于
Alter the virStoragePoolObjNumOfVolumes, virStoragePoolObjVolumeGetNames, and virStoragePoolObjVolumeListExport APIs to take a virStoragePoolObjPtr instead of the &obj->volumes and obj->def. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
A virStoragePoolObjPtr will be an 'obj'. Also modify the @matchpool to @matchobj. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-