[libvirt] [libvirt-php PATCH 0/1] Fix: mutlithreading compilation: set_error needs 2 params

= Info = Someone reports errors withing "PHP_FUNCTION(libvirt_domain_migrate)" due to "set_error": libvirt-php.c: In function ‘zif_libvirt_domain_migrate’: libvirt-php.c:5456:3: error: too few arguments to function ‘set_error’ = Background = Michal Novotny already reacted to Gentoos bug: Bug 437624 - =dev-php/libvirt-php-0.4.6: too few arguments to function ‘set_error’ https://bugs.gentoo.org/show_bug.cgi?id=437624 with commit: bfca998ae921ab897f95025344fad71d9633ccf6 http://libvirt.org/git/?p=libvirt-php.git;a=commit;h=bfca998ae921ab897f95025... but some calls to "set_error" still lacked the 2nd param "TSRMLS_CC", especially in the "PHP_FUNCTION(libvirt_domain_migrate)". = Patch = Add 2nd param "TSRMLS_CC" to all calls of "set_error" where only 1 param was supplied. Stefan Kuhn (1): Fix: mutlithreading compilation: set_error needs 2 params src/libvirt-php.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 1.7.12.4

--- src/libvirt-php.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libvirt-php.c b/src/libvirt-php.c index 7e7710c..0b8345a 100644 --- a/src/libvirt-php.c +++ b/src/libvirt-php.c @@ -1615,7 +1615,7 @@ PHP_FUNCTION(libvirt_node_get_cpu_stats) #else PHP_FUNCTION(libvirt_node_get_cpu_stats) { - set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3"); + set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3" TSRMLS_CC); RETURN_FALSE; } #endif @@ -1718,7 +1718,7 @@ PHP_FUNCTION(libvirt_node_get_cpu_stats_for_each_cpu) #else PHP_FUNCTION(libvirt_node_get_cpu_stats_for_each_cpu) { - set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3"); + set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3" TSRMLS_CC); RETURN_FALSE; } #endif @@ -1775,7 +1775,7 @@ PHP_FUNCTION(libvirt_node_get_mem_stats) #else PHP_FUNCTION(libvirt_node_get_mem_stats) { - set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3"); + set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3" TSRMLS_CC); RETURN_FALSE; } #endif @@ -3168,7 +3168,7 @@ PHP_FUNCTION(libvirt_domain_get_screenshot_api) #else PHP_FUNCTION(libvirt_domain_get_screenshot_api) { - set_error("Function is not supported by libvirt, you need at least libvirt 0.9.2 to support this function"); + set_error("Function is not supported by libvirt, you need at least libvirt 0.9.2 to support this function" TSRMLS_CC); RETURN_FALSE; } #endif @@ -5453,13 +5453,13 @@ PHP_FUNCTION(libvirt_domain_migrate) GET_DOMAIN_FROM_ARGS("rrl|sl",&zdomain,&zdconn,&flags,&dname,&dname_len,&bandwidth); if ((domain->domain == NULL) || (domain->conn->conn == NULL)) { - set_error("Domain object is not valid"); + set_error("Domain object is not valid" TSRMLS_CC); RETURN_FALSE; } ZEND_FETCH_RESOURCE(dconn, php_libvirt_connection*, &zdconn, -1, PHP_LIBVIRT_CONNECTION_RES_NAME, le_libvirt_connection); if ((dconn==NULL) || (dconn->conn==NULL)) { - set_error("Destination connection object is not valid"); + set_error("Destination connection object is not valid" TSRMLS_CC); RETURN_FALSE; } -- 1.7.12.4

On 02/01/2013 03:25 PM, stefan.kuhn@foss-group.ch wrote:
--- src/libvirt-php.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/libvirt-php.c b/src/libvirt-php.c index 7e7710c..0b8345a 100644 --- a/src/libvirt-php.c +++ b/src/libvirt-php.c @@ -1615,7 +1615,7 @@ PHP_FUNCTION(libvirt_node_get_cpu_stats) #else PHP_FUNCTION(libvirt_node_get_cpu_stats) { - set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3"); + set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3" TSRMLS_CC); RETURN_FALSE; } #endif @@ -1718,7 +1718,7 @@ PHP_FUNCTION(libvirt_node_get_cpu_stats_for_each_cpu) #else PHP_FUNCTION(libvirt_node_get_cpu_stats_for_each_cpu) { - set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3"); + set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3" TSRMLS_CC); RETURN_FALSE; } #endif @@ -1775,7 +1775,7 @@ PHP_FUNCTION(libvirt_node_get_mem_stats) #else PHP_FUNCTION(libvirt_node_get_mem_stats) { - set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3"); + set_error("Function is not supported by libvirt, support has been added in libvirt 0.9.3" TSRMLS_CC); RETURN_FALSE; } #endif @@ -3168,7 +3168,7 @@ PHP_FUNCTION(libvirt_domain_get_screenshot_api) #else PHP_FUNCTION(libvirt_domain_get_screenshot_api) { - set_error("Function is not supported by libvirt, you need at least libvirt 0.9.2 to support this function"); + set_error("Function is not supported by libvirt, you need at least libvirt 0.9.2 to support this function" TSRMLS_CC); RETURN_FALSE; } #endif @@ -5453,13 +5453,13 @@ PHP_FUNCTION(libvirt_domain_migrate) GET_DOMAIN_FROM_ARGS("rrl|sl",&zdomain,&zdconn,&flags,&dname,&dname_len,&bandwidth);
if ((domain->domain == NULL) || (domain->conn->conn == NULL)) { - set_error("Domain object is not valid"); + set_error("Domain object is not valid" TSRMLS_CC); RETURN_FALSE; }
ZEND_FETCH_RESOURCE(dconn, php_libvirt_connection*, &zdconn, -1, PHP_LIBVIRT_CONNECTION_RES_NAME, le_libvirt_connection); if ((dconn==NULL) || (dconn->conn==NULL)) { - set_error("Destination connection object is not valid"); + set_error("Destination connection object is not valid" TSRMLS_CC); RETURN_FALSE; }
Thanks, pushed! Michal -- Michal Novotny <minovotn@redhat.com>, RHCE, Red Hat Virtualization | libvirt-php bindings | php-virt-control.org
participants (2)
-
Michal Novotny
-
stefan.kuhn@foss-group.ch