Re: [libvirt] [CFT] FreeBSD: new libvirt-python package
This has been added to the FreeBSD ports tree. http://www.freshports.org/devel/py-libvirt/ -jgh On Mon, Dec 30, 2013 at 8:30 AM, Jason Helfman j...@freebsd.org wrote: Hello Everyone, Believe it or not, I don't have any test framework for testing FreeBSD libvirt, so was hoping there may be some folks out there that could help out on that front with this new port I was going to put into our ports tree. :) https://svn.redports.org/jgh/devel/py-libvirt/ Thanks! -jgh -- Jason Helfman | FreeBSD Committer j...@freebsd.org | http://people.freebsd.org/~jgh | The Power to Serve -- Jason Helfman | FreeBSD Committer j...@freebsd.org | http://people.freebsd.org/~jgh | The Power to Serve -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] vbox: add support for v4.2.20+ and v4.3.4+
On Monday 30 December 2013 11:26:08 Ryota Ozaki wrote: On Mon, Dec 30, 2013 at 5:55 PM, Jean-Baptiste Rouault jean-baptiste.roua...@diateam.net wrote: On Sunday 29 December 2013 14:44:10 Ryota Ozaki wrote: On Wed, Dec 25, 2013 at 12:47 AM, Jean-Baptiste Rouault jean-baptiste.roua...@diateam.net wrote: While working on adding virDomain*Stats support to the vbox driver, we found bugs in the VirtualBox API C bindings. These bugs have been fixed in versions 4.2.20 and 4.3.4. However, the changes in the C bindings are incompatible with the vbox_CAPI_v4_2.h and vbox_CAPI_v4_3.h files which are bundled in libvirt source code. This is why the following patch adds vbox_CAPI_v4_2_20.h and vbox_CAPI_v4_3_4.h. We tried to keep compatibility with older VirtualBox 4.2.x and 4.3.x releases so we added a SPECIAL_VERSION identifier to conditionnaly include the right header. I'm not really pleased with this SPECIAL_VERSION identifier, maybe we could instead increase the precision of VBOX_API_VERSION, for example 4002 would become 4002000. This would permit us to select the right header based on the VBOX_API_VERSION only, what do you think ? Can we use VBOX_XPCOMC_VERSION instead of adding a new flag? The version has been bumped up when the incompatibility is introduced. ozaki-r The problem is that VBOX_XPCOMC_VERSION is defined in the vbox_CAPI_v*.h headers and we need a flag to choose which header we have to include. Oops. You're right. Well, one other idea is to include each vbox_CAPI_X_Y.h in the corresponding vbox_VX_Y.c. That's rather straightforward for me than including vbox_CAPI_*.h in vbox_tmpl.c according to VBOX_API_VERSION. ozaki-r This would indeed solve the problem for header inclusion. But what about future code using the new API ? Will it have to check both VBOX_API_VERSION and VBOX_XPCOMC_VERSION ? Wouldn't it be simpler if VBOX_API_VERSION was more precise ? e.g 4003004 -- Jean-Baptiste ROUAULT RD Engineer - diateam : Architectes de l'information Phone : +33 (0)2 98 050 050 Fax : +33 (0)2 98 050 051 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH python] define __GNUC_PREREQ macro before using it
Doug Goldstein wrote: On Dec 29, 2013, at 4:52 PM, Doug Goldstein car...@cardoe.com wrote: We brought over use of the __GNUC_PREREQ macro from libvirt but didn't bring over the definition of it. This brings over the macro from libvirt sources. --- libvirt-utils.h | 9 + 1 file changed, 9 insertions(+) diff --git a/libvirt-utils.h b/libvirt-utils.h index f55be7b..add7553 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -65,6 +65,15 @@ # endif # ifdef __GNUC__ + +# ifndef __GNUC_PREREQ +# if defined __GNUC__ defined __GNUC_MINOR__ +#define __GNUC_PREREQ(maj, min) \ +((__GNUC__ 16) + __GNUC_MINOR__ = ((maj) 16) + (min)) +# else +#define __GNUC_PREREQ(maj,min) 0 +# endif + /** * ATTRIBUTE_UNUSED: * -- 1.8.3.2 Embarrassingly I didn't git add the missing #endif before I did a git commit --amend so it didn't appear here. But if this is ACK'd rest assured, I've fixed it locally. Just for the record, this patch (with adding #endif) fixes build for me as well. Roman Bogorodskiy -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] event: don't overwrite registration error message
Prior to this patch, an attempt to register an event without an event loop started results in the vague: libvirt: Remote Driver error : adding cb to list Now it gives the much nicer: libvirt: error : internal error: could not initialize domain event timer This also avoids hiding other reasonable error messages, such as attempts to register a duplicate callback or OOM errors. Also, document the event loop usage requirement, since that was how I ran into the issue. * src/remote/remote_driver.c (remoteConnectNetworkEventRegisterAny) (remoteConnectDomainEventRegister) (remoteConnectDomainEventRegisterAny): Preserve more detailed error. * src/libvirt.c (virConnectDomainEventRegister) (virConnectDomainEventRegisterAny) (virConnectNetworkEventRegisterAny): Document event loop requirement. Signed-off-by: Eric Blake ebl...@redhat.com --- src/libvirt.c | 24 +++- src/remote/remote_driver.c | 12 +++- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 90773bb..f8b11b3 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -14829,11 +14829,13 @@ error: * @freecb: optional function to deallocate opaque when not used anymore * * Adds a callback to receive notifications of domain lifecycle events - * occurring on a connection + * occurring on a connection. This function requires that an event loop + * has been previously registered with virEventRegisterImpl() or + * virEventRegisterDefaultImpl(). * * Use of this method is no longer recommended. Instead applications * should try virConnectDomainEventRegisterAny() which has a more flexible - * API contract + * API contract. * * The virDomainPtr object handle passed into the callback upon delivery * of an event is only valid for the duration of execution of the callback. @@ -14842,7 +14844,7 @@ error: * The reference can be released once the object is no longer required * by calling virDomainFree. * - * Returns 0 on success, -1 on failure + * Returns 0 on success, -1 on failure. */ int virConnectDomainEventRegister(virConnectPtr conn, @@ -17541,10 +17543,12 @@ error: * @freecb: optional function to deallocate opaque when not used anymore * * Adds a callback to receive notifications of arbitrary domain events - * occurring on a domain. + * occurring on a domain. This function requires that an event loop + * has been previously registered with virEventRegisterImpl() or + * virEventRegisterDefaultImpl(). * * If @dom is NULL, then events will be monitored for any domain. If @dom - * is non-NULL, then only the specific domain will be monitored + * is non-NULL, then only the specific domain will be monitored. * * Most types of event have a callback providing a custom set of parameters * for the event. When registering an event, it is thus necessary to use @@ -17562,7 +17566,7 @@ error: * for the callback. To unregister a callback, this callback ID should * be passed to the virConnectDomainEventDeregisterAny() method. * - * Returns a callback identifier on success, -1 on failure + * Returns a callback identifier on success, -1 on failure. */ int virConnectDomainEventRegisterAny(virConnectPtr conn, @@ -17657,10 +17661,12 @@ error: * @freecb: optional function to deallocate opaque when not used anymore * * Adds a callback to receive notifications of arbitrary network events - * occurring on a network. + * occurring on a network. This function requires that an event loop + * has been previously registered with virEventRegisterImpl() or + * virEventRegisterDefaultImpl(). * * If @net is NULL, then events will be monitored for any network. If @net - * is non-NULL, then only the specific network will be monitored + * is non-NULL, then only the specific network will be monitored. * * Most types of event have a callback providing a custom set of parameters * for the event. When registering an event, it is thus necessary to use @@ -17678,7 +17684,7 @@ error: * for the callback. To unregister a callback, this callback ID should * be passed to the virConnectNetworkEventDeregisterAny() method. * - * Returns a callback identifier on success, -1 on failure + * Returns a callback identifier on success, -1 on failure. */ int virConnectNetworkEventRegisterAny(virConnectPtr conn, diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index be282d6..11785e2 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -2932,10 +2932,8 @@ remoteConnectNetworkEventRegisterAny(virConnectPtr conn, net, eventID, VIR_OBJECT_EVENT_CALLBACK(callback), opaque, freecb, -callbackID)) 0) { -virReportError(VIR_ERR_RPC, %s, _(adding cb to list)); +callbackID))
Re: [libvirt] [PATCH python] define __GNUC_PREREQ macro before using it
On 12/29/2013 03:52 PM, Doug Goldstein wrote: We brought over use of the __GNUC_PREREQ macro from libvirt but didn't bring over the definition of it. This brings over the macro from libvirt sources. --- libvirt-utils.h | 9 + 1 file changed, 9 insertions(+) ACK (with #endif fixed). diff --git a/libvirt-utils.h b/libvirt-utils.h index f55be7b..add7553 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -65,6 +65,15 @@ # endif # ifdef __GNUC__ + +# ifndef __GNUC_PREREQ +# if defined __GNUC__ defined __GNUC_MINOR__ +#define __GNUC_PREREQ(maj, min)\ +((__GNUC__ 16) + __GNUC_MINOR__ = ((maj) 16) + (min)) +# else +#define __GNUC_PREREQ(maj,min) 0 Copy and paste and all, but you could add a space after that comma for consistency. +# endif + /** * ATTRIBUTE_UNUSED: * -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC/PATCH python] expose the bindings version to Python
Doug Goldstein wrote: On Thu, Dec 12, 2013 at 4:29 PM, Eric Blake ebl...@redhat.com wrote: On 12/11/2013 08:43 PM, Doug Goldstein wrote: The method getVersion() retrieves the version of the libvirt library that the binaries are linked against but there is no way to retrieve the version of the bindings you are using. In the future if we support new APIs in Python that don't rely on features in the library there needs to be a way for programmers to detect the version. --- I would expect there's a cleaner way to implement this than I've done but I opted for what I saw as the smallest implementation. If anyone has a suggestion for a better way to do this I'm ok with redoing this patch. The idea sounds sane to me. --- libvirt-override.py | 3 +++ setup.py| 16 2 files changed, 19 insertions(+) Alas, my python is too weak to give either a meaningful review to the code, or to suggest an alternative. :( -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org Ping for some more feedback from others. A have a shorter but probably a little hacky way to do this: diff --git a/libvirt-override.py b/libvirt-override.py index 63f8ecb..93b6e0a 100644 --- a/libvirt-override.py +++ b/libvirt-override.py @@ -2,6 +2,9 @@ # Manually written part of python bindings for libvirt # +version = (1, 2, 0) +__version__ = '.'.join(str(x) for x in version) + # On cygwin, the DLL is called cygvirtmod.dll import sys diff --git a/setup.py b/setup.py index 24d4cf2..1138e15 100755 --- a/setup.py +++ b/setup.py @@ -278,7 +278,7 @@ class my_clean(clean): remove_tree(build) setup(name = 'libvirt-python', - version = '1.2.0', + version = __import__('libvirt-override').__version__, url = 'http://www.libvirt.org', maintainer = 'Libvirt Maintainers', maintainer_email = 'libvir-list@redhat.com', Roman Bogorodskiy -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] event: improve public API docs
Since libvirt 0.9.3, the entire virevent.c file has been a public API, so improve the documentation in this file. Also, fix a potential core dump - it could only be triggered by bogus use of the API and would only affect the caller (not libvirtd), but we might as well be nice. * src/libvirt.c (virConnectDomainEventRegister) (virConnectDomainEventRegisterAny) (virConnectNetworkEventRegisterAny): Document event loop requirement. * src/util/virevent.c (virEventAddHandle, virEventRemoveHandle) (virEventAddTimeout, virEventRemoveTimeout): Likewise. (virEventUpdateHandle, virEventUpdateTimeout): Likewise, and avoid core dump if caller didn't register handler. (virEventRunDefaultImpl): Expand example, and set up code block in html docs. (virEventRegisterImpl, virEventRegisterDefaultImpl): Document more on the use of the event loop. Signed-off-by: Eric Blake ebl...@redhat.com --- src/libvirt.c | 24 ++-- src/util/virevent.c | 82 +++-- 2 files changed, 70 insertions(+), 36 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 66841c8..f43718d 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -16121,11 +16121,13 @@ error: * @freecb: optional function to deallocate opaque when not used anymore * * Adds a callback to receive notifications of domain lifecycle events - * occurring on a connection + * occurring on a connection. This function requires that an event loop + * has been previously registered with virEventRegisterImpl() or + * virEventRegisterDefaultImpl(). * * Use of this method is no longer recommended. Instead applications * should try virConnectDomainEventRegisterAny() which has a more flexible - * API contract + * API contract. * * The virDomainPtr object handle passed into the callback upon delivery * of an event is only valid for the duration of execution of the callback. @@ -16134,7 +16136,7 @@ error: * The reference can be released once the object is no longer required * by calling virDomainFree. * - * Returns 0 on success, -1 on failure + * Returns 0 on success, -1 on failure. */ int virConnectDomainEventRegister(virConnectPtr conn, @@ -19064,10 +19066,12 @@ error: * @freecb: optional function to deallocate opaque when not used anymore * * Adds a callback to receive notifications of arbitrary domain events - * occurring on a domain. + * occurring on a domain. This function requires that an event loop + * has been previously registered with virEventRegisterImpl() or + * virEventRegisterDefaultImpl(). * * If @dom is NULL, then events will be monitored for any domain. If @dom - * is non-NULL, then only the specific domain will be monitored + * is non-NULL, then only the specific domain will be monitored. * * Most types of event have a callback providing a custom set of parameters * for the event. When registering an event, it is thus necessary to use @@ -19085,7 +19089,7 @@ error: * for the callback. To unregister a callback, this callback ID should * be passed to the virConnectDomainEventDeregisterAny() method. * - * Returns a callback identifier on success, -1 on failure + * Returns a callback identifier on success, -1 on failure. */ int virConnectDomainEventRegisterAny(virConnectPtr conn, @@ -19183,10 +19187,12 @@ error: * @freecb: optional function to deallocate opaque when not used anymore * * Adds a callback to receive notifications of arbitrary network events - * occurring on a network. + * occurring on a network. This function requires that an event loop + * has been previously registered with virEventRegisterImpl() or + * virEventRegisterDefaultImpl(). * * If @net is NULL, then events will be monitored for any network. If @net - * is non-NULL, then only the specific network will be monitored + * is non-NULL, then only the specific network will be monitored. * * Most types of event have a callback providing a custom set of parameters * for the event. When registering an event, it is thus necessary to use @@ -19204,7 +19210,7 @@ error: * for the callback. To unregister a callback, this callback ID should * be passed to the virConnectNetworkEventDeregisterAny() method. * - * Returns a callback identifier on success, -1 on failure + * Returns a callback identifier on success, -1 on failure. */ int virConnectNetworkEventRegisterAny(virConnectPtr conn, diff --git a/src/util/virevent.c b/src/util/virevent.c index fde29a2..0c94946 100644 --- a/src/util/virevent.c +++ b/src/util/virevent.c @@ -37,6 +37,16 @@ static virEventAddTimeoutFunc addTimeoutImpl = NULL; static virEventUpdateTimeoutFunc updateTimeoutImpl = NULL; static virEventRemoveTimeoutFunc removeTimeoutImpl = NULL; + +/* + * + * Below this point are *PUBLIC* APIs for event + * loop integration with applications using libvirt. + * These API contracts cannot be changed. + * +
Re: [libvirt] Release of libvirt-python-1.2.0
On Mon, Dec 2, 2013 at 8:41 AM, Daniel P. Berrange berra...@redhat.comwrote: On Mon, Dec 02, 2013 at 02:28:00PM +0800, Daniel Veillard wrote: So this is the first release fo the separated libvirt-python code base out of the main libvirt git. In this case the two release have been made in tandem to avoid disruptions, but there is no guarantee that the future releases of both project will be bound together (though I will try to sync those to minimize churn when possible !) Tarball and rpms are now available on the new location: ftp://libvirt.org/libvirt/python/ FYI I have also uploaded it to PyPI https://pypi.python.org/pypi/libvirt-python So you can just do 'pip install libvirt-python' to install it. Needs libvirt-devel RPM or equiv pkg installed first of course. Regards, Daniel This has been added to the FreeBSD ports tree. http://www.freshports.org/devel/py-libvirt/ -jgh -- Jason Helfman | FreeBSD Committer j...@freebsd.org | http://people.freebsd.org/~jgh | The Power to Serve -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH] docs: return paragraph must be last
Commit eb70ceb tried to create a code block for libvirt-libvirt.html#virConnectGetType, but failed to note that our doc generator treats everything after Returns as part of the return description rather than looking for paragraph and code layout. Fix some other API that also had generic details crammed into the return type paragraph. * src/libvirt.c (virConnectOpen, virConnectOpenReadOnly) (virConnectOpenAuth, virConnectListAllDomains): Fit doc pattern. Signed-off-by: Eric Blake ebl...@redhat.com --- Pushing under the trivial rule. src/libvirt.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index f43718d..0752c3f 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -1379,8 +1379,6 @@ failed: * This function should be called first to get a connection to the * Hypervisor and xen store * - * Returns a pointer to the hypervisor connection or NULL in case of error - * * If @name is NULL, if the LIBVIRT_DEFAULT_URI environment variable is set, * then it will be used. Otherwise if the client configuration file * has the uri_default parameter set, then it will be used. Finally @@ -1393,6 +1391,8 @@ failed: * environment variable LIBVIRT_AUTOSTART=0 * * URIs are documented at http://libvirt.org/uri.html + * + * Returns a pointer to the hypervisor connection or NULL in case of error */ virConnectPtr virConnectOpen(const char *name) @@ -1425,9 +1425,9 @@ error: * See virConnectOpen for notes about environment variables which can * have an effect on opening drivers * - * Returns a pointer to the hypervisor connection or NULL in case of error - * * URIs are documented at http://libvirt.org/uri.html + * + * Returns a pointer to the hypervisor connection or NULL in case of error */ virConnectPtr virConnectOpenReadOnly(const char *name) @@ -1462,9 +1462,9 @@ error: * See virConnectOpen for notes about environment variables which can * have an effect on opening drivers * - * Returns a pointer to the hypervisor connection or NULL in case of error - * * URIs are documented at http://libvirt.org/uri.html + * + * Returns a pointer to the hypervisor connection or NULL in case of error */ virConnectPtr virConnectOpenAuth(const char *name, @@ -9374,12 +9374,6 @@ error: * VIR_CONNECT_LIST_DOMAINS_NO_SNAPSHOT, for filtering based on whether * a domain has snapshots. * - * Returns the number of domains found or -1 and sets domains to NULL in case of - * error. On success, the array stored into @domains is guaranteed to have an - * extra allocated element set to NULL but not included in the return count, to - * make iteration easier. The caller is responsible for calling virDomainFree() - * on each array element, then calling free() on @domains. - * * Example of usage: * * virDomainPtr *domains; @@ -9396,6 +9390,12 @@ error: *virDomainFree(domains[i]); * } * free(domains); + * + * Returns the number of domains found or -1 and sets domains to NULL in case of + * error. On success, the array stored into @domains is guaranteed to have an + * extra allocated element set to NULL but not included in the return count, to + * make iteration easier. The caller is responsible for calling virDomainFree() + * on each array element, then calling free() on @domains. */ int virConnectListAllDomains(virConnectPtr conn, -- 1.8.4.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] Build failed in Jenkins: libvirt-syntax-check #1804
See http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/1804/ -- Started by upstream project libvirt-build build number 2013 Building on master in workspace http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/ws/ [workspace] $ /bin/sh -xe /tmp/hudson1250971132809350241.sh + make syntax-check GENbracket-spacing-check GFDL_version 0.53 GFDL_version TAB_in_indentation 0.41 TAB_in_indentation Wundef_boolean 0.21 Wundef_boolean avoid_attribute_unused_in_header 0.25 avoid_attribute_unused_in_header avoid_ctype_macros 0.64 avoid_ctype_macros avoid_if_before_free 8.01 avoid_if_before_free avoid_strcase 0.81 avoid_strcase avoid_write 0.55 avoid_write bindtextdomain 0.50 bindtextdomain cast_of_argument_to_free 1.37 cast_of_argument_to_free cast_of_x_alloc_return_value 1.22 cast_of_x_alloc_return_value changelog 0.22 changelog const_long_option 0.67 const_long_option copyright_check ./.gnulib/lib/version-etc.c maint.mk: out of date copyright in ./.gnulib/lib/version-etc.c; update it make: *** [sc_copyright_check] Error 1 Build step 'Execute shell' marked build as failure -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] Build failed in Jenkins: libvirt-syntax-check #1804
On 12/31/2013 11:35 PM, Jenkins CI wrote: See http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/1804/ -- Started by upstream project libvirt-build build number 2013 Building on master in workspace http://honk.sigxcpu.org:8001/job/libvirt-syntax-check/ws/ [workspace] $ /bin/sh -xe /tmp/hudson1250971132809350241.sh + make syntax-check copyright_check ./.gnulib/lib/version-etc.c maint.mk: out of date copyright in ./.gnulib/lib/version-etc.c; update it make: *** [sc_copyright_check] Error 1 Build step 'Execute shell' marked build as failure Happens every year :) This will be fixed as soon as I pull in a gnulib update. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list