[libvirt] [PATCH] php: implement libvirt_node_get_free_memory.

Eric Blake eblake at redhat.com
Thu May 1 18:55:12 UTC 2014


[meta-comment]

On 05/01/2014 12:33 PM, Dawid Zamirski wrote:
> This patch adds support for virNodeGetFreeMemory which is available in
> libvirt since v0.3.3. While the php bindings alredy provide
> libvirt_node_get_mem_stats from which such info could be obtained, not
> all hypervisors support it, e.g. vbox and esx driver don't have it but
> they do implement virNodeGetFreeMemory.
> 
> Since virNodeGetFreeMemory returns free bytes as unsigned long long
> which PHP cannot handle, I've added LONGLONG_RETURN_AS_STRING macro
> which returns the amount bytes as a string - similarly to how bcmath
> handles such numbers.
> ---
>  src/libvirt-php.c | 30 ++++++++++++++++++++++++++++++
>  src/libvirt-php.h |  1 +
>  2 files changed, 31 insertions(+)

I'm not a PHP expert, so I'll let others review the patch itself.  But
when contributing patches to libvirt-php.git, it helps if you do:
 git config format.subjectprefix "php PATCH"
to make it obvious which repo you are targetting with your patch.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140501/7a79f0b8/attachment-0001.sig>


More information about the libvir-list mailing list