[libvirt] [libvirt-php PATCH] Add ability to managed save libvirt domains

From: Pavel Odintsov <pavel.odintsov@gmail.com> --- src/libvirt-php.c | 22 ++++++++++++++++++++++ src/libvirt-php.h | 1 + 2 files changed, 23 insertions(+), 0 deletions(-) diff --git a/src/libvirt-php.c b/src/libvirt-php.c index 20e5d27..9cdfd0e 100644 --- a/src/libvirt-php.c +++ b/src/libvirt-php.c @@ -99,6 +99,7 @@ static zend_function_entry libvirt_functions[] = { PHP_FE(libvirt_domain_core_dump, NULL) PHP_FE(libvirt_domain_shutdown, NULL) PHP_FE(libvirt_domain_suspend, NULL) + PHP_FE(libvirt_domain_managedsave, NULL) PHP_FE(libvirt_domain_undefine, NULL) PHP_FE(libvirt_domain_reboot, NULL) PHP_FE(libvirt_domain_define_xml, NULL) @@ -4470,6 +4471,27 @@ PHP_FUNCTION(libvirt_domain_shutdown) } /* + Function name: libvirt_domain_managedsave + Since version: 0.4.1(-1) + Description: Function is used to managed save the domain (domain was unloaded from memory and it state saved to disk) identified by it's resource + Arguments: @res [resource]: libvirt domain resource, e.g. from libvirt_domain_lookup_by_*() + Returns: TRUE for success, FALSE on error +*/ + +PHP_FUNCTION(libvirt_domain_managedsave) +{ + php_libvirt_domain *domain=NULL; + zval *zdomain; + int retval; + + GET_DOMAIN_FROM_ARGS("r",&zdomain); + retval=virDomainManagedSave(domain->domain, 0); + DPRINTF("%s: virDomainManagedSave(%p) returned %d\n", PHPFUNC, domain->domain, retval); + if (retval != 0) RETURN_FALSE; + RETURN_TRUE; +} + +/* Function name: libvirt_domain_suspend Since version: 0.4.1(-1) Description: Function is used to suspend the domain identified by it's resource diff --git a/src/libvirt-php.h b/src/libvirt-php.h index 3c7f254..b06836c 100644 --- a/src/libvirt-php.h +++ b/src/libvirt-php.h @@ -307,6 +307,7 @@ PHP_FUNCTION(libvirt_domain_resume); PHP_FUNCTION(libvirt_domain_core_dump); PHP_FUNCTION(libvirt_domain_shutdown); PHP_FUNCTION(libvirt_domain_suspend); +PHP_FUNCTION(libvirt_domain_managedsave); PHP_FUNCTION(libvirt_domain_undefine); PHP_FUNCTION(libvirt_domain_reboot); PHP_FUNCTION(libvirt_domain_define_xml); -- 1.7.2.5

On Sat, Jun 23, 2012 at 07:01:51AM +0400, Y@billing.fastvps.ru wrote:
From: Pavel Odintsov <pavel.odintsov@gmail.com>
--- src/libvirt-php.c | 22 ++++++++++++++++++++++ src/libvirt-php.h | 1 + 2 files changed, 23 insertions(+), 0 deletions(-)
I see Michal actually commited your patch, thanks ! I'm also pushing the following to keep track of contributors :-) Adding authors of recent patches diff --git a/AUTHORS b/AUTHORS index 0999762..bfdeaa5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -19,6 +19,10 @@ There are also other people that have contributed to the proj Daniel P. Berrange <berrange@redhat.com> Tiziano Mueller <dev-zero@gentoo.org> Yukihiro Kawada <warp.kawada@gmail.com> + Remi Collet <Remi@famillecollet.com> + Ivo van den Abeelen <ivovandenabeelen@gmail.com> + Tiziano Müller <dev-zero@gentoo.org> + Pavel Odintsov <pavel.odintsov@gmail.com> If you would like to be listed in the contributors list feel free to clone this repository to your computer and -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On 06/27/2012 08:31 AM, Daniel Veillard wrote:
On Sat, Jun 23, 2012 at 07:01:51AM +0400, Y@billing.fastvps.ru wrote:
From: Pavel Odintsov <pavel.odintsov@gmail.com>
--- src/libvirt-php.c | 22 ++++++++++++++++++++++ src/libvirt-php.h | 1 + 2 files changed, 23 insertions(+), 0 deletions(-) I see Michal actually commited your patch, thanks !
I'm also pushing the following to keep track of contributors :-)
Adding authors of recent patches
diff --git a/AUTHORS b/AUTHORS index 0999762..bfdeaa5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -19,6 +19,10 @@ There are also other people that have contributed to the proj Daniel P. Berrange <berrange@redhat.com> Tiziano Mueller <dev-zero@gentoo.org> Yukihiro Kawada <warp.kawada@gmail.com> + Remi Collet <Remi@famillecollet.com> + Ivo van den Abeelen <ivovandenabeelen@gmail.com> + Tiziano Müller <dev-zero@gentoo.org> + Pavel Odintsov <pavel.odintsov@gmail.com>
If you would like to be listed in the contributors list feel free to clone this repository to your computer and
Thanks a lot for this patch and commit Daniel and I apologize to anybody missing in the AUTHORS file before :-) Michal -- Michal Novotny <minovotn@redhat.com>, RHCE, Red Hat Virtualization | libvirt-php bindings | php-virt-control.org
participants (3)
-
Daniel Veillard
-
Michal Novotny
-
Y@billing.fastvps.ru