[libvirt] [libvirt-php][PATCH] Fix virConnectClose failed issue on list_domains

Michal Novotny minovotn at redhat.com
Thu Mar 31 10:55:30 UTC 2011


[snip]
> +        if (domain != NULL) {
> +                rv = virDomainFree (domain);  // Y.Kawada
> +                if (rv != 0) {
> +                        php_error_docref(NULL TSRMLS_CC,
> E_WARNING,"virDomainFree failed with %i on list_domain: %s", rv,
> LIBVIRT_G (last_error));
> +                }
> +                domain = NULL;
> +        }

Well, this is not the right place to place it. You should place it to
the end of the for cycle that's getting the domain pointers to free the
domains once they're not needed anymore. This has been fixed and pushed
to the repository stating you as the authors however :) Also, the
example PHP scripts have been merged from the local webserver directory
I used for development so please pull the latest contents from git and
before you write any other patch please pull the current tree from the
repository using `git pull` command on the cloned master branch of the
repository.

Your version of the patch was not working for me since it returned
"Unknown error" in my Google Chrome window every time I tried to
libvirt_list_domains() function. I fixed it to put it to the right place
and pushed now.

Thanks for the patch,
Michal

-- 
Michal Novotny <minovotn at redhat.com>, RHCE
Virtualization Team (xen userspace), Red Hat




More information about the libvir-list mailing list