- 14 7月, 2017 2 次提交
-
-
由 John Ferlan 提交于
Since we're storing a virUUIDFormat'd string in our Hash Table, let's modify the Lookup API to receive a formatted string as well. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Ensure two empty lines between functions. 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>.
-
- 27 4月, 2017 2 次提交
-
-
由 John Ferlan 提交于
Rather than waiting for the first save to fail, let's generate the directory with the correct privs during initialization. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
When processing a virSecretPtr use 'secret' as a variable name. When processing a virSecretObjPtr use 'obj' as a variable name. When processing a virSecretDefPtr use 'def' as a variable name, unless a distinction needs to be made with a 'newdef' such as virSecretObjListAddLocked (which also used the VIR_STEAL_PTR macro for the configFile and base64File). Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 10 1月, 2017 1 次提交
-
-
由 Daniel P. Berrange 提交于
Emit an event whenever a secret value changes Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 09 1月, 2017 2 次提交
-
-
由 Daniel P. Berrange 提交于
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The public virSecret object has a single "usage_id" field but the virSecretDef object has a different 'char *' field for each usage type, but the code all assumes every usage type has a corresponding single string. Get rid of the pointless union in virSecretDef and just use "usage_id" everywhere. This doesn't impact public XML format, only the internal handling. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 26 4月, 2016 9 次提交
-
-
由 John Ferlan 提交于
Change 'ephemeral' to 'isephemeral' and 'private' to 'isprivate' since both are bools.
-
由 John Ferlan 提交于
Introduce the final accessor's to _virSecretObject data and move the structure from virsecretobj.h to virsecretobj.c The virSecretObjSetValue logic will handle setting both the secret value and the value_size. Some slight adjustments to the error path over what was in secretSetValue were made. Additionally, a slight logic change in secretGetValue where we'll check for the internalFlags and error out before checking for and erroring out for a NULL secret->value. That way, it won't be obvious to anyone that the secret value wasn't set rather they'll just know they cannot get the secret value since it's private.
-
由 John Ferlan 提交于
Introduce fetch and set accessor to the secretObj->def field for usage by the driver to avoid the driver needing to know the format of virSecretObj
-
由 John Ferlan 提交于
Move and rename the secretRewriteFile, secretSaveDef, and secretSaveValue from secret_driver to virsecretobj Need to make some slight adjustments since the secretSave* functions called secretEnsureDirectory, but otherwise mostly just a move of code.
-
由 John Ferlan 提交于
Move and rename secretDeleteSaved from secret_driver into virsecretobj and split it up into two parts since there is error path code that looks to just delete the secret data file
-
由 John Ferlan 提交于
Move to secret_conf.c and rename to virSecretLoadAllConfigs. Also includes moving/renaming the supporting virSecretLoad, virSecretLoadValue, and virSecretLoadValidateUUID.
-
由 John Ferlan 提交于
This patch replaces most of the guts of secret_driver.c with recently added secret_conf.c APIs in order manage secret lists and objects using the hashed virSecretObjList* lookup API's.
-
由 John Ferlan 提交于
Move the driver specific secretUsageIDForDef into secret_conf.c. It could be more of a general purpose API.
-
由 John Ferlan 提交于
Move virSecretObj from secret_driver.c to virsecretobj.h To support being able to create a hashed secrets list, move the virSecretObj to virsecretobj.h so that the code can at least find the definition. This should be a temporary situation while the virsecretobj.c code is patched in order to support a hashed secret object while still having the linked list support in secret_driver.c. Eventually, the goal is to move the virSecretObj into virsecretobj.c, although it is notable that the existing model from which virSecretObj was derived has virDomainObj in src/conf/domain_conf.h and virNetworkObj in src/conf/network_conf.h, so virSecretObj wouldn't be unique if it were to remain in virsecretobj.h Still adding accessors to fetch and store hashed object data will be the end goal. Add definitions and infrastucture in virsecretobj.c to create and handle a hashed virSecretObj and virSecretObjList including the class, object, lock setup, and disposal API's. Nothing will call these yet. This infrastructure will replace the forward linked list logic within the secret_driver, eventually.
-
- 08 3月, 2016 1 次提交
-
-
由 John Ferlan 提交于
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 01 3月, 2016 13 次提交
-
-
由 John Ferlan 提交于
Rename to secretLoadAllConfigs and add the 'driver->configDir' as a parameter. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
This new API will allocate the secret, assign the def pointer, and insert the secret onto the passed list. Whether that's the temporary list in loadSecrets which gets loaded into the driver list or driver list during secretDefineXML. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Add a temporary helper to search for a specific secret by address on the list and remove it if it's found. The following patch will introduce a common allocation and listInsert helper. That means error paths of the routines calling would need a way to remove the secret off the list. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
This patch removes need for secretBase64Path and secretComputePath. Similar to the configFile, create an entry for base64File, which will be generated as the driver->configDir, the UUID value, plus the ".base" suffix. Rather than generating on the fly, store this in the virSecretObj. The buildup of the pathname done in loadSecrets where the failure to build is ignored which is no different than the failure to generate the name in secretLoadValue which would have been ignored in the failure path after secretLoad. This also removes the need for secretComputPath and secretBase64Path. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
This patch removes the need for secretXMLPath. Instead save 'path' during loadSecret as 'configFile'. The secretXMLPath is nothing more than an open coded virFileBuildPath. All that code did was concantenate the driver->configDir, the UUID of the secret, and the ".xml" suffix to form the configFile name which we now will generate and save instead. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
The 'secretLoad' was essentially open coding virFileBuildPath. Adjust the logic to have the caller build the path and pass it. The net sum of ignoring the virFileBuildPath failure is the same as before where the failure to virAsprintf the path would have been ignored anyway in the secretLoad error path. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
This follows other drivers usage model. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Remove one letter variable. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Just renaming the variable in secretConnectListAllSecrets. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Remove the need for the local 'secret' in secretConnectListAllSecrets. A subsequent patch will rename the ObjPtr entry to secret. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rename to virSecretObj - preparation for future patch, but also follows similar code in other drivers. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Use the common API instead of essentially open coding same functionality. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
由 John Ferlan 提交于
Rather than having it interspersed with other changes, do it once. Remove a couple ^L, 1 argument per line for functions, less than 80 chars per line, use of spacing between logical groups of code, use of one line if statements when doing fetch followed by comparison, use direct return when no cleanup to be done. Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-
- 27 1月, 2015 2 次提交
-
-
由 Daniel P. Berrange 提交于
For stateless, client side drivers, it is never correct to probe for secondary drivers. It is only ever appropriate to use the secondary driver that is associated with the hypervisor in question. As a result the ESX & HyperV drivers have both been forced to do hacks where they register no-op drivers for the ones they don't implement. For stateful, server side drivers, we always just want to use the same built-in shared driver. The exception is virtualbox which is really a stateless driver and so wants to use its own server side secondary drivers. To deal with this virtualbox has to be built as 3 separate loadable modules to allow registration to work in the right order. This can all be simplified by introducing a new struct recording the precise set of secondary drivers each hypervisor driver wants struct _virConnectDriver { virHypervisorDriverPtr hypervisorDriver; virInterfaceDriverPtr interfaceDriver; virNetworkDriverPtr networkDriver; virNodeDeviceDriverPtr nodeDeviceDriver; virNWFilterDriverPtr nwfilterDriver; virSecretDriverPtr secretDriver; virStorageDriverPtr storageDriver; }; Instead of registering the hypervisor driver, we now just register a virConnectDriver instead. This allows us to remove all probing of secondary drivers. Once we have chosen the primary driver, we immediately know the correct secondary drivers to use. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The secret driver can rely on its global state instead of the connect private data.
-
- 03 12月, 2014 1 次提交
-
-
由 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.
-
- 29 4月, 2014 1 次提交
-
-
由 Eric Blake 提交于
Convert all remaining clients of readdir to use the new interface, so that we can ensure (unlikely) errors while reading a directory are reported. * src/openvz/openvz_conf.c (openvzAssignUUIDs): Use new interface. * src/parallels/parallels_storage.c (parallelsFindVolumes) (parallelsFindVmVolumes): Report readdir failures. * src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Ignore readdir failures. * src/secret/secret_driver.c (loadSecrets): Likewise. * src/qemu/qemu_hostdev.c (qemuHostdevHostSupportsPassthroughVFIO): Report readdir failures. * src/xen/xen_inotify.c (xenInotifyOpen): Likewise. * src/xen/xm_internal.c (xenXMConfigCacheRefresh): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 25 3月, 2014 1 次提交
-
-
由 Ján Tomko 提交于
-
- 21 3月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 18 3月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
Any source file which calls the logging APIs now needs to have a VIR_LOG_INIT("source.name") declaration at the start of the file. This provides a static variable of the virLogSource type. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 17 3月, 2014 1 次提交
-
-
由 Pavel Hrdina 提交于
Coverity found an issue in lxc_driver and uml_driver that we don't check the return value of register functions. I've also updated all other places and unify the way we check the return value. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 11 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
Convert the type of loop iterators named 'i', 'j', k', 'ii', 'jj', 'kk', to be 'size_t' instead of 'int' or 'unsigned int', also santizing 'ii', 'jj', 'kk' to use the normal 'i', 'j', 'k' naming Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-