- 22 7月, 2017 3 次提交
-
-
由 John Ferlan 提交于
Rework some of the test driver API's to remove the need to return failure when testStoragePoolObjFindByName returns NULL rather than going to cleanup. This removes the need for check for "if (obj)" and in some instances the need to for a cleanup label and a local ret variable. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
A virStoragePoolObjPtr will be an 'obj'. A virStoragePoolPtr will be a 'pool'. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Fix some spacing/formatting in the storage pool/vol test driver code. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 17 7月, 2017 5 次提交
-
-
由 John Ferlan 提交于
Now that we have a bit more control, let's convert our object into a lockable object and let that magic handle the create and lock/unlock. This also involves creating a virNodeDeviceEndAPI in order to handle the object cleanup for API's that use the Add or Find API's in order to get a locked/reffed object. The EndAPI will unlock and unref the object returning NULL to indicate to the caller to not use the obj. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Ensure that any function that walks the node device object list is prefixed by virNodeDeviceObjList. Also, modify the @filter param name for virNodeDeviceObjListExport to be @aclfilter. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
In preparation to make things private, make the ->devs be pointers to a virNodeDeviceObjList and then manage everything inside virnodedeviceobj Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
- In testDestroyVport rather than use a cleanup label, just return -1 immediately since nothing else is needed. - In testStoragePoolDestroy, if !privpool, then just return -1 since nothing else will happen anyway. - Rather than "goto cleanup;" on failure to virNodeDeviceObjFindByName an @obj, just return directly. This then allows the cleanup: label code to not have to check "if (obj)" before calling virNodeDeviceObjUnlock. This also simplifies some exit logic... - In testNodeDeviceObjFindByName use an error: label to handle the failure and don't do the ncaps++ within the VIR_STRDUP() source target index. Only increment ncaps after success. Easier on eyes at error label too. - In testNodeDeviceDestroy use "cleanup" rather than "out" for the goto Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rather than passing the object to be removed by reference, pass by value and then let the caller decide whether or not the object should be free'd and how to handle the logic afterwards. This includes free'ing the object and/or setting the local variable to NULL to prevent subsequent unexpected usage (via something like virNodeDeviceObjRemove in testNodeDeviceDestroy). For now this function will just handle the remove of the object from the list for which it was placed during virNodeDeviceObjAssignDef. This essentially reverts logic from commit id '61148074' that free'd the device entry on list, set *dev = NULL and returned. Thus fixing a bug in node_device_hal.c/dev_refresh() which would never call dev_create(udi) since @dev would have been set to NULL. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 15 7月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Fix some spacing/formatting in the network test driver code. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 25 6月, 2017 1 次提交
-
-
由 John Ferlan 提交于
If a remote call fails during event registration (more than likely from a network failure or remote libvirtd restart timed just right), then when calling the virObjectEventStateDeregisterID we don't want to call the registered @freecb function because that breaks our contract that we would only call it after succesfully returning. If the @freecb routine were called, it could result in a double free from properly coded applications that free their opaque data on failure to register, as seen in the following details: Program terminated with signal 6, Aborted. #0 0x00007fc45cba15d7 in raise #1 0x00007fc45cba2cc8 in abort #2 0x00007fc45cbe12f7 in __libc_message #3 0x00007fc45cbe86d3 in _int_free #4 0x00007fc45d8d292c in PyDict_Fini #5 0x00007fc45d94f46a in Py_Finalize #6 0x00007fc45d960735 in Py_Main #7 0x00007fc45cb8daf5 in __libc_start_main #8 0x0000000000400721 in _start The double dereference of 'pyobj_cbData' is triggered in the following way: (1) libvirt_virConnectDomainEventRegisterAny is invoked. (2) the event is successfully added to the event callback list (virDomainEventStateRegisterClient in remoteConnectDomainEventRegisterAny returns 1 which means ok). (3) when function remoteConnectDomainEventRegisterAny is hit, network connection disconnected coincidently (or libvirtd is restarted) in the context of function 'call' then the connection is lost and the function 'call' failed, the branch virObjectEventStateDeregisterID is therefore taken. (4) 'pyobj_conn' is dereferenced the 1st time in libvirt_virConnectDomainEventFreeFunc. (5) 'pyobj_cbData' (refered to pyobj_conn) is dereferenced the 2nd time in libvirt_virConnectDomainEventRegisterAny. (6) the double free error is triggered. Resolve this by adding a @doFreeCb boolean in order to avoid calling the freeCb in virObjectEventStateDeregisterID for any remote call failure in a remoteConnect*EventRegister* API. For remoteConnect*EventDeregister* calls, the passed value would be true indicating they should run the freecb if it exists; whereas, it's false for the remote call failure path. Patch based on the investigation and initial patch posted by fangying <fangying1@huawei.com>.
-
- 07 6月, 2017 3 次提交
-
-
由 Jiri Denemark 提交于
virDomainXMLOption gains driver specific callbacks for parsing and formatting save cookies. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Jiri Denemark 提交于
This will be used later when a save cookie will become part of the snapshot XML using new driver specific parser/formatter functions. Signed-off-by: NJiri Denemark <jdenemar@redhat.com> Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
-
由 John Ferlan 提交于
Now that we have a bit more control, let's convert our object into a lockable object and let that magic handle the create and lock/unlock. This commit also introduces virInterfaceObjEndAPI in order to handle the lock unlock and object unref in one call for consumers returning a NULL obj upon return. This removes the need for virInterfaceObj{Lock|Unlock} external API's. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 05 6月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
While checking for ABI stability, drivers might pose additional checks that are not valid for general case. For instance, qemu driver might check some memory backing attributes because of how qemu works. But those attributes may work well in other drivers. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 03 6月, 2017 8 次提交
-
-
由 John Ferlan 提交于
In preparation for privatizing the virNodeDeviceObj - create an accessor for the @def field and then use it for various callers. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Alter the algorithm to return a list of matching names rather than a list of match virInterfaceObjPtr which are then just dereferenced extracting the def->name and def->mac. Since the def->mac would be the same as the passed @mac, just return a list of names and as long as there's only one, extract the [0] entry from the passed list. Also alter the error message on failure to include the mac that wasn't found. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Prefix should have been virInterfaceObjList since the API is operating on the list of interfaces. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Move the structs into virinterfaceobj.c, create necessary accessors, and initializers. This also includes reworking virInterfaceObjListClone to handle receiving a source interfaces list pointer, creating the destination interfaces object, and copying everything from source into dest. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Move the struct into virinterfaceobj.c, create necessary accessors, and initializers. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
We're about to make the obj much more private, so make it easier to see future changes which will require accessors for the obj->def This also includes modifying some interfaces->objs[i]->X references to be obj = interfaces->objs[i]; and then def = obj->def Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rather than using goto cleanup on object find failure and having cleanup need to check if the obj was present before unlocking, just return immediately. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Alter variable names to be obj rather than 'iface' and/or 'obj'. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 26 5月, 2017 1 次提交
-
-
由 Peter Krempa 提交于
Commit 4337bc57 introduced code that would in certain error paths unref the last reference of a pointer, but return it. Clear the pointers before returning them.
-
- 25 4月, 2017 1 次提交
-
-
由 John Ferlan 提交于
Commit id '865f479d' altered the logic to use a common test*ObjFindByName helpers which would lock/unlock the test driver; however, a few cleanup paths in that cleanup missed removing the Unlock, so remove it now. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 19 4月, 2017 2 次提交
-
-
由 John Ferlan 提交于
Use "virNetworkObj" as a prefix for any external API in virnetworkobj. Also a couple of functions were local to virnetworkobj.c, so remove their external defs in virnetworkobj.h.
-
由 John Ferlan 提交于
Move all the virNetworkObj related API/data structures into their own modules virnetworkobj.{c,h} from the network_conf.{c,h} Purely code motion at this point plus adjustments to cleanly build
-
- 13 4月, 2017 1 次提交
-
- 11 4月, 2017 6 次提交
-
-
由 John Ferlan 提交于
Alter virStoragePoolObjListExport in order to pass the drivers->pools by reference Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Mostly code motion to move storageConnectList[Defined]StoragePools and similar test driver code into virstorageobj.c and rename to virStoragePoolObjGetNames. Also includes a couple of variable name adjustments to keep code consistent with other drivers. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Unify the NumOf[Defined]StoragePools API into virstorageobj.c from storage_driver and test_driver. The only real difference between the two is the test driver doesn't call using the aclfilter API. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Essentially code motion to move the storage/test driver ListAllVolumes logic into virstorageobj.c Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Mostly code motion to move storagePoolListVolumes code into virstorageobj.c and rename to virStoragePoolObjVolumeGetNames. Also includes a couple of variable name adjustments to keep code consistent with other drivers. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Unify the NumOfVolumes API into virstorageobj.c from storage_driver and test_driver. The only real difference between the two is the test driver doesn't call using the aclfilter API. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 10 4月, 2017 5 次提交
-
-
由 John Ferlan 提交于
Unify the *ListDevice API into virnodedeviceobj.c from node_device_driver and test_driver. The only real difference between the two is that the test driver doesn't call the aclfilter API. The name of the new API follows that of other drivers to "GetNames". NB: Change some variable names to match what they really are - consistency with other drivers. Also added a clear of the input names. This also allows virNodeDeviceObjHasCap to be static to virnodedeviceobj Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Unify the NumOfDevices API into virnodedeviceobj.c from node_device_driver and test_driver. The only real difference between the two is that the test driver doesn't call the aclfilter API. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Clean up the code to adhere to more of the standard two spaces between functions, separate lines for type and function name, one argument per line. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Unlike other drivers, this is a test driver only API. Still combining the logic of testConnectListInterfaces and testConnectListDefinedInterfaces makes things a bit easier in the long run. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Unlike other drivers, this is a test driver only API. Still combining the logic of testConnectNumOfInterfaces and testConnectNumOfDefinedInterfaces makes things a bit easier in the long run. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 03 4月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
So far our code is full of the following pattern: dom = virGetDomain(conn, name, uuid) if (dom) dom->id = 42; There is no reasong why it couldn't be just: dom = virGetDomain(conn, name, uuid, id); After all, client domain representation consists of tuple (name, uuid, id). Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 27 3月, 2017 1 次提交
-
-
由 Martin Kletzander 提交于
There is no reason for it not to be in the utils, all global symbols under that file already have prefix vir* and there is no reason for it to be part of DRIVER_SOURCES because that is just a leftover from older days (pre-driver modules era, I believe). Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-