- 09 1月, 2014 1 次提交
-
-
由 Eric Blake 提交于
When checking for a valid network, we weren't consistent on whether we reported an invalid network or a connection. Similar to previous patches such as commit 6e130ddc, the difference between VIR_IS_NETWORK and VIR_IS_CONNECTED_NETWORK is moot (due to reference counting, any valid network must be tied to a valid connection). Use a common macro to make the error reporting for invalid networks nicer. * src/datatypes.h (virCheckNetworkReturn, virCheckNetworkGoto): New macros. (VIR_IS_NETWORK, VIR_IS_CONNECTED_NETWORK): Drop unused macros. * src/libvirt.c: Use macro throughout. (virLibNetworkError): Drop unused macro. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 08 1月, 2014 2 次提交
-
-
由 Eric Blake 提交于
Cleanup after a previous patch, commit 6e130ddc. In particular, note that xenDomainUsedCpus can only be reached from xenUnifiedDomainGetXMLDesc, which in turn is only reached from public API that already validated the domain. * src/xen/xen_driver.c (xenDomainUsedCpus): Drop redundant check. * src/datatypes.h (VIR_IS_DOMAIN, VIR_IS_CONNECTED_DOMAIN): Delete, and inline into all callers, since no other file uses it any more. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
In datatype.c, virGetDomainSnapshot could result in the message: error: invalid domain pointer in bad domain Furthermore, while there are a few functions in libvirt.c that only care about a virDomainPtr without regards to the connection (such as virDomainGetName), most functions also require a valid connection. Yet several functions were blindly dereferencing the conn member without checking it for validity first (such as virDomainOpenConsole). Rather than try and correct all usage of VIR_IS_DOMAIN vs. VIR_IS_CONNECTED_DOMAIN, it is easier to just blindly require that a valid domain object always has a valid connection object (which should be true anyways, since every domain object holds a reference to its connection, so the connection will not be closed until all domain objects have also been closed to release their reference). After this patch, all places that validate a domain consistently report: error: invalid domain pointer in someFunc * src/datatypes.h (virCheckDomainReturn, virCheckDomainGoto): New macros. * src/datatypes.c (virGetDomainSnapshot): Use new macro. (virLibConnError): Delete unused macro. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 07 1月, 2014 2 次提交
-
-
由 Eric Blake 提交于
Cleanup after commit db3dd082 removed all clients outside of the .h file. * src/datatypes.h (VIR_IS_CONNECT): Delete, and inline into all callers, since no other file uses it any more. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
The datatype.c object checks could result in a message like: error: invalid connection pointer in no connection This consolidates all clients of this message to have uniform contents: error: invalid connection pointer in someFunc Note that virCheckConnectReturn raises an error immediately; in datatypes.c, where we don't need to raise the error (but instead just leave it in the thread-local setting), we use virCheckConnectGoto and the cleanup label instead. Then, for consistency in that file, all subsequent error messages are touched to also use the cleanup error label. * src/datatypes.h (virCheckConnectReturn) (virCheckConnectGoto): New macros. * src/datatypes.c: Use new macro. * src/libvirt-qemu.c (virDomainQemuAttach): Likewise. (virLibConnError): Delete unused macro. * src/libvirt-lxc.c (virLibConnError): Likewise. * src/libvirt.c: Use new macro throughout. * docs/api_extension.html.in: Modernize documentation. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 03 1月, 2014 1 次提交
-
-
由 Eric Blake 提交于
I noticed that the virDomainQemuMonitorCommand debug output wasn't telling me the name of the domain it was working on. While it was easy enough to determine which pointer matches the domain based on other log messages, it is nicer to be consistent. * src/util/viruuid.h (VIR_UUID_DEBUG): Moved here from... * src/libvirt.c (VIR_UUID_DEBUG): ...here. (VIR_ARG15, VIR_HAS_COMMA, VIR_DOMAIN_DEBUG_EXPAND) (VIR_DOMAIN_DEBUG_PASTE, VIR_DOMAIN_DEBUG_0, VIR_DOMAIN_DEBUG_1) (VIR_DOMAIN_DEBUG_2, VIR_DOMAIN_DEBUG): Move... * src/datatypes.h: ...here. * src/libvirt-qemu.c (virDomainQemuMonitorCommand) (virDomainQemuAgentCommand): Better debug messages. * src/libvirt-lxc.c (virDomainLxcOpenNamespace): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 24 4月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
The driver.h struct for node devices used an inconsistent naming scheme 'DeviceMonitor' instead of the more usual 'NodeDeviceDriver'. Fix this everywhere it has leaked out to. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 05 4月, 2013 1 次提交
-
-
由 Peter Krempa 提交于
The last Viktor's effort to fix the race and memory corruption unfortunately wasn't complete in the case the close callback was not registered in an connection. At that time, the trail of event's that I'll describe later could still happen and corrupt the memory or cause a crash of the client (including the daemon in case of a p2p migration). Consider the following prerequisities and trail of events: Let's have a remote connection to a hypervisor that doesn't have a close callback registered and the client is using the event loop. The crash happens in cooperation of 2 threads. Thread E is the event loop and thread W is the worker that does some stuff. R denotes the remote client. 1.) W - The client finishes everything and sheds the last reference on the client 2.) W - The virObject stuff invokes virConnectDispose that invokes doRemoteClose 3.) W - the remote close method invokes the REMOTE_PROC_CLOSE RPC method. 4.) W - The thread is preempted at this point. 5.) R - The remote side receives the close and closes the socket. 6.) E - poll() wakes up due to the closed socket and invokes the close callback 7.) E - The event loop is preempted right before remoteClientCloseFunc is called 8.) W - The worker now finishes, and frees the conn object. 9.) E - The remoteClientCloseFunc accesses the now-freed conn object in the attempt to retrieve pointer for the real close callback. 10.) Kaboom, corrupted memory/segfault. This patch tries to fix this by introducing a new object that survives the freeing of the connection object. We can't increase the reference count on the connection object itself or the connection would never be closed, as the connection is closed only when the reference count reaches zero. The new object - virConnectCloseCallbackData - is a lockable object that keeps the pointers to the real user registered callback and ensures that the connection callback is either not called if the connection was already freed or that the connection isn't freed while this is being called.
-
- 21 12月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 26 11月, 2012 1 次提交
-
-
由 Ata E Husain Bohra 提交于
This will simplify the refactoring of the ESX storage driver to support a VMFS and an iSCSI backend. One of the tasks the storage driver needs to do is to decide which backend driver needs to be invoked for a given request. This approach extends virStoragePool and virStorageVol to store extra parameters: 1. privateData: stores pointer to respective backend storage driver. 2. privateDataFreeFunc: stores cleanup function pointer. virGetStoragePool and virGetStorageVol are modfied to accept these extra parameters as user params. virStoragePoolDispose and virStorageVolDispose checks for cleanup operation if available. The private data pointer allows the ESX storage driver to store a pointer to the used backend with each storage pool and volume. This avoids the need to detect the correct backend in each storage driver function call.
-
- 21 9月, 2012 1 次提交
-
-
由 Eric Blake 提交于
https://www.gnu.org/licenses/gpl-howto.html recommends that the 'If not, see <url>.' phrase be a separate sentence. * tests/securityselinuxhelper.c: Remove doubled line. * tests/securityselinuxtest.c: Likewise. * globally: s/; If/. If/
-
- 07 8月, 2012 1 次提交
-
-
由 Daniel P. Berrange 提交于
This converts the following public API datatypes to use the virObject infrastructure: virConnectPtr virDomainPtr virDomainSnapshotPtr virInterfacePtr virNetworkPtr virNodeDevicePtr virNWFilterPtr virSecretPtr virStreamPtr virStorageVolPtr virStoragePoolPtr The code is significantly simplified, since the mutex in the virConnectPtr object now only needs to be held when accessing the per-connection virError object instance. All other operations are completely lock free. * src/datatypes.c, src/datatypes.h, src/libvirt.c: Convert public datatypes to use virObject * src/conf/domain_event.c, src/phyp/phyp_driver.c, src/qemu/qemu_command.c, src/qemu/qemu_migration.c, src/qemu/qemu_process.c, src/storage/storage_driver.c, src/vbox/vbox_tmpl.c, src/xen/xend_internal.c, tests/qemuxml2argvtest.c, tests/qemuxmlnstest.c, tests/sexpr2xmltest.c, tests/xmconfigtest.c: Convert to use virObjectUnref/virObjectRef Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 02 8月, 2012 1 次提交
-
-
由 Osier Yang 提交于
Some of the macros use tab, while the left use spaces, this patch change it to always use the spaces. And a few aligning fixes.
-
- 30 7月, 2012 2 次提交
-
-
由 Daniel P. Berrange 提交于
Update the remote driver to use the virNetClient close callback to trigger the virConnectPtr close callbacks Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Define new virConnect{Register,Unregister}CloseCallback() public APIs which allows registering/unregistering a callback to be invoked when the connection to a hypervisor is closed. The callback is provided with the reason for the close, which may be 'error', 'eof', 'client' or 'keepalive'. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 23 7月, 2012 1 次提交
-
-
由 Osier Yang 提交于
Per the FSF address could be changed from time to time, and GNU recommends the following now: (http://www.gnu.org/licenses/gpl-howto.html) You should have received a copy of the GNU General Public License along with Foobar. If not, see <http://www.gnu.org/licenses/>. This patch removes the explicit FSF address, and uses above instead (of course, with inserting 'Lesser' before 'General'). Except a bunch of files for security driver, all others are changed automatically, the copyright for securify files are not complete, that's why to do it manually: src/security/security_selinux.h src/security/security_driver.h src/security/security_selinux.c src/security/security_apparmor.h src/security/security_apparmor.c src/security/security_driver.c
-
- 25 2月, 2012 1 次提交
-
-
由 Martin Kletzander 提交于
Function xmlParseURI does not remove square brackets around IPv6 address when parsing. One of the solutions is making wrappers around functions working with xmlURI*. This assures that uri->server will be always properly assigned and it doesn't have to be changed when used on some new place in the code. For this purpose, functions virParseURI and virSaveURI were added. These function are wrappers around xmlParseURI and xmlSaveUri respectively. Also there is one new syntax check function to prohibit these functions anywhere else. File changes: - src/util/viruri.h -- declaration - src/util/viruri.c -- definition - src/libvirt_private.syms -- symbol export - src/Makefile.am -- added source and header files - cfg.mk -- added sc_prohibit_xmlURI - all others -- ID name and include fixes
-
- 24 1月, 2012 1 次提交
-
-
由 Alon Levy 提交于
Signed-off-by: NAlon Levy <alevy@redhat.com>
-
- 14 7月, 2011 1 次提交
-
-
由 Eric Blake 提交于
* src/conf/cpu_conf.h (virCPUDefFormat, virCPUDefFormatBuf): Change flags type. * src/conf/cpu_conf.c (virCPUDefFormat, virCPUDefFormatBuf): Likewise. * src/conf/storage_conf.c (_virStoragePoolOptions): Likewise. * src/datatypes.h (_virConnect, _virStream): Likewise.
-
- 23 6月, 2011 1 次提交
-
-
由 Eric Blake 提交于
POSIX allows implementations where PATH_MAX is undefined, leading to compilation error. Not to mention that even if it is defined, it is often wasteful in relation to the amount of data being stored. All clients of vol->key were audited, and found not to care about whether key is static or dynamic, except for these offenders: * src/datatypes.h (struct _virStorageVol): Manage key dynamically. * src/datatypes.c (virReleaseStorageVol): Free key. (virGetStorageVol): Copy key.
-
- 21 2月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
The virConnectPtr struct will cache instances of all other objects. APIs like virDomainLookupByUUID will return a cached object, so if you do virDomainLookupByUUID twice in a row, you'll get the same exact virDomainPtr instance. This does not have any performance benefit, since the actual logic in virDomainLookupByUUID (and other APIs returning virDomainPtr, etc instances) is not short-circuited. All it does is to ensure there is only one single virDomainPtr in existance for any given UUID. The caching has a number of downsides though, all relating to stale data. If APIs aren't careful to always overwrite the 'id' field in virDomainPtr it may become out of data. Likewise for the name field, if a guest is renamed, or if a guest is deleted, and then a new one created with the same UUID but different name. This has been an ongoing, endless source of bugs for all applications using libvirt from languages with garbage collection, causing them to get virDomainPtr instances from long ago with stale data. The caching is also a waste of memory resources, since both applications, and language bindings often maintain their own hashtable caches of object instances. This patch removes all the hash table caching, so all APIs return brand new virDomainPtr (etc) object instances. * src/datatypes.h: Delete all hash tables. * src/datatypes.c: Remove all object caching code
-
- 19 1月, 2011 1 次提交
-
-
由 Matthias Bolte 提交于
The public object is called NWFilter but the corresponding private object is called NWFilterPool. I don't see compelling reasons for this Pool suffix. One might argue that an NWFilter is a "pool" of rules, etc. Remove the Pool suffix from NWFilterPool. No functional change included.
-
- 22 12月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* daemon/Makefile.am: Avoid spurious space before tabs. * src/Makefile.am: Likewise. * examples/dominfo/Makefile.am: Likewise. * examples/domsuspend/Makefile.am: Likewise. * tools/Makefile.am: Likewise. * src/datatypes.h (VIR_CONNECT_MAGIC): Likewise. * src/internal.h (TODO): Likewise. * src/qemu/qemu_monitor.h (QEMU_MONITOR_MIGRATE): Likewise. * src/xen/xen_hypervisor.c (XEN_V2_OP_GETAVAILHEAP): Likewise. * src/xen/xs_internal.h: Likewise.
-
- 05 4月, 2010 1 次提交
-
-
由 Chris Lalancette 提交于
Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
- 27 3月, 2010 2 次提交
-
-
由 Jim Meyering 提交于
* src/conf/nwfilter_conf.h: Indent cpp directives. * src/conf/nwfilter_params.h: Likewise. * src/datatypes.h: Likewise. * src/nwfilter/nwfilter_driver.h: Likewise. * src/nwfilter/nwfilter_ebiptables_driver.h: Likewise. * src/nwfilter/nwfilter_gentech_driver.h: Likewise.
-
由 Stefan Berger 提交于
This patch adds the implementation of the public API for the network filtering (ACL) extensions to libvirt.c . Signed-off-by: NStefan Berger <stefanb@us.ibm.com>
-
- 10 3月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* global: patch created by running: for f in $(git ls-files '*.[ch]') ; do cppi $f > $f.t && mv $f.t $f done
-
- 29 9月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
* include/libvirt/libvirt.h.in: Public API contract for virStreamPtr object * src/libvirt_public.syms: Export data stream APIs * src/libvirt_private.syms: Export internal helper APIs * src/libvirt.c: Data stream API driver dispatch * src/datatypes.h, src/datatypes.c: Internal helpers for virStreamPtr object * src/driver.h: Define internal driver API for streams * .x-sc_avoid_write: Ignore src/libvirt.c because it trips up on comments including write() * python/Makefile.am: Add libvirt-override-virStream.py * python/generator.py: Add rules for virStreamPtr class * python/typewrappers.h, python/typewrappers.c: Wrapper for virStreamPtr * docs/libvirt-api.xml, docs/libvirt-refs.xml: Regenerate with new APIs
-
- 15 9月, 2009 2 次提交
-
-
由 Daniel P. Berrange 提交于
* include/libvirt/libvirt.h, include/libvirt/libvirt.h.in: Add virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage * python/generator.py: Mark virSecretGetUsageType, virSecretGetUsageID as not throwing exceptions * qemud/remote.c: Implement dispatch for virLookupSecretByUsage * qemud/remote_protocol.x: Add usage type & ID as attributes of remote_nonnull_secret. Add RPC calls for new public APIs * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h, qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate * src/datatypes.c, src/datatypes.h: Add usageType and usageID as properties of virSecretPtr * src/driver.h: Add virLookupSecretByUsage driver entry point * src/libvirt.c: Implement virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage * src/libvirt_public.syms: Export virSecretGetUsageType, virSecretGetUsageID and virLookupSecretByUsage * src/remote_internal.c: Implement virLookupSecretByUsage entry * src/secret_conf.c, src/secret_conf.h: Remove the virSecretUsageType enum, now in public API. Make volume path mandatory when parsing XML * src/secret_driver.c: Enforce usage uniqueness when defining secrets. Implement virSecretLookupByUsage api method * src/virsh.c: Include usage for secret-list command
-
由 Daniel P. Berrange 提交于
Convert all the secret/storage encryption APIs / wire format to handle UUIDs in raw format instead of non-canonical printable format. Guarentees data format correctness. * docs/schemas/storageencryption.rng: Make UUID mandatory for a secret and validate fully * docs/schemas/secret.rng: Fully validate UUID * include/libvirt/libvirt.h, include/libvirt/libvirt.h.in, Add virSecretLookupByUUID and virSecretGetUUID. Make virSecretGetUUIDString follow normal API design pattern * python/generator.py: Skip generation of virSecretGetUUID, virSecretGetUUIDString and virSecretLookupByUUID * python/libvir.c, python/libvirt-python-api.xml: Manual impl of virSecretGetUUID,virSecretGetUUIDString and virSecretLookupByUUID * qemud/remote.c: s/virSecretLookupByUUIDString/virSecretLookupByUUID/ Fix get_nonnull_secret/make_nonnull_secret to use unsigned char * qemud/remote_protocol.x: Fix remote_nonnull_secret to use a remote_uuid instead of remote_nonnull_string for UUID field. Rename REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING to REMOTE_PROC_SECRET_LOOKUP_BY_UUID_STRING and make it take an remote_uuid value * qemud/remote_dispatch_args.h, qemud/remote_dispatch_prototypes.h, qemud/remote_dispatch_ret.h, qemud/remote_dispatch_table.h, qemud/remote_protocol.c, qemud/remote_protocol.h: Re-generate * src/datatypes.h, src/datatypes.c: Store UUID in raw format instead of printable. Change virGetSecret to use raw format UUID * src/driver.h: Rename virDrvSecretLookupByUUIDString to virDrvSecretLookupByUUID and use raw format UUID * src/libvirt.c: Add virSecretLookupByUUID and virSecretGetUUID and re-implement virSecretLookupByUUIDString and virSecretGetUUIDString in terms of those * src/libvirt_public.syms: Add virSecretLookupByUUID and virSecretGetUUID * src/remote_internal.c: Rename remoteSecretLookupByUUIDString to remoteSecretLookupByUUID. Fix typo in args for remoteSecretDefineXML impl. Use raw UUID format for get_nonnull_secret and make_nonnull_secret * src/storage_encryption_conf.c, src/storage_encryption_conf.h: Storage UUID in raw format, and require it to be present in XML. Use UUID parser to validate. * secret_conf.h, secret_conf.c: Generate a UUID if none is provided. Storage UUID in raw format. * src/secret_driver.c: Adjust to deal with raw UUIDs. Save secrets in a filed with printable UUID, instead of base64 UUID. * src/virsh.c: Adjust for changed public API contract of virSecretGetUUIDString. * src/storage_Backend.c: DOn't undefine secret we just generated upon successful volume creation. Fix to handle raw UUIDs. Generate a non-clashing UUID * src/qemu_driver.c: Change to use lookupByUUID instead of lookupByUUIDString
-
- 02 9月, 2009 2 次提交
-
-
由 Miloslav Trmač 提交于
* src/remote_internal.c: Implement client binding for new secrets APIs * src/datatypes.h: Add 'void *secretPrivateData' to virConnectPtr struct
-
由 Miloslav Trmač 提交于
* include/libvirt/virterror.h, src/virterror.c: Add VIR_WAR_NO_SECRET * src/libvirt_private.syms, src/datatypes.h, src/datatypes.c: Type virSecret struct definition and helper APIs * src/driver.h: Sub-driver API definitions for secrets * src/libvirt.c: Define new sub-driver for secrets
-
- 29 5月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 20 5月, 2009 1 次提交
-
-
由 Daniel Veillard 提交于
* configure.in include/libvirt/libvirt.h[.in] include/libvirt/virterror.h qemud/remote.c qemud/remote_dispatch_args.h qemud/remote_dispatch_prototypes.h qemud/remote_dispatch_ret.h qemud/remote_dispatch_table.h qemud/remote_protocol.[chx] src/Makefile.am src/datatypes.c src/datatypes.h src/driver.h src/libvirt.c src/remote_internal.c src/virterror.c src/libvirt_private.syms src/libvirt_public.syms: Add the Interface config APIs and remote stubs for those, patch by Laine Stump * AUTHORS: add Laine daniel
-
- 20 1月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 16 1月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 05 12月, 2008 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 21 11月, 2008 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 17 11月, 2008 2 次提交
-
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-