[libvirt] [PATCHv4] python: Expose virDomain{G, S}etInterfaceParameters APIs in python binding

Eric Blake eblake at redhat.com
Wed Feb 15 22:24:14 UTC 2012


On 02/15/2012 09:33 AM, ajia at redhat.com wrote:
> From: Alex Jia <ajia at redhat.com>
> 
> The v4 patch corrects indentation issues.
> 
> The v3 patch follows latest python binding codes and change 'size'
> type from int to Py_ssize_t.

I'd stick these types of comments after the ---; they are useful for
review, but don't need to be a permanent part of libvirt.git.

> 
> An simple example to show how to use it:
> 
> #!/usr/bin/env python
> 
> import libvirt
> 
> conn = libvirt.open(None)
> dom = conn.lookupByName('foo')
> 
> print dom.interfaceParameters('vnet0', 0)
> 
> params = {'outbound.peak': 10,
>           'inbound.peak': 10,
>           'inbound.burst': 20,
>           'inbound.average': 20,
>           'outbound.average': 30,
>           'outbound.burst': 30}
> 
> print dom.setInterfaceParameters('vnet0', params, 0)
> print dom.interfaceParameters('vnet0', 0)
> 
> Signed-off-by: Alex Jia <ajia at redhat.com>
> ---
>  python/libvirt-override-api.xml |   16 +++++
>  python/libvirt-override.c       |  126 +++++++++++++++++++++++++++++++++++++++
>  2 files changed, 142 insertions(+), 0 deletions(-)

ACK.

-- 
Eric Blake   eblake at 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: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120215/c4384d71/attachment-0001.sig>


More information about the libvir-list mailing list