Re: [PATCHv3] python: Fixup python binding for virDomain{Set, Get}BlockIoTune APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011年12月29日 13:22, ajia@xxxxxxxxxx wrote:
From: Alex Jia<ajia@xxxxxxxxxx>

Title is changed into:

Fix problems of virDomain{Set,Get}BlockIoTune bindings


The parameter 'params' is useless for virDomainGetBlockIoTune API, and the
return value type should be a virTypedParameterPtr not integer. In addition,

s/not/but not/

the parameter number is also incorrect in libvirt_virDomain{Set, Get}BlockIoTune APIs.

Not a proper description, should be:

PyArg_ParseTuple in libvirt_virDomain{Set,Get}BlockIoTune APIs misses
format unit for "format" argument.


* libvirt-override-api.xml: Remove useless the parameter 'params' from
virDomainGetBlockIoTune API, and change return value type from integer
to virTypedParameterPtr.

* python/libvirt-override.c: Fix the parameter number match issue.

https://bugzilla.redhat.com/show_bug.cgi?id=770683

Signed-off-by: Alex Jia<ajia@xxxxxxxxxx>
---
  python/libvirt-override-api.xml |    3 +--
  python/libvirt-override.c       |    4 ++--
  2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/python/libvirt-override-api.xml b/python/libvirt-override-api.xml
index 07e4a78..a2fd219 100644
--- a/python/libvirt-override-api.xml
+++ b/python/libvirt-override-api.xml
@@ -401,9 +401,8 @@
        <info>Get the I/O tunables for a block device</info>
        <arg name='dom' type='virDomainPtr' info='pointer to the domain'/>
        <arg name='disk' type='const char *' info='disk name'/>
-<arg name='params' type='virTypedParameterPtr' info='Pointer to blkio tuning params object'/>
        <arg name='flags' type='unsigned int' info='an OR&apos;ed set of virDomainModificationImpact'/>
-<return type='int' info='0 in case of success, -1 in case of failure'/>
+<return type='virTypedParameterPtr' info='the I/O tunables value or None in case of error'/>
      </function>
      <function name='virDomainBlockPeek' file='python'>
        <info>Read the contents of domain's disk device</info>
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 8a643a3..a704e78 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -3301,7 +3301,7 @@ libvirt_virDomainSetBlockIoTune(PyObject *self ATTRIBUTE_UNUSED,
      int nparams = 0, i;
      int c_ret;

-    if (!PyArg_ParseTuple(args, (char *)"Ozi:virDomainSetBlockIoTune",
+    if (!PyArg_ParseTuple(args, (char *)"OzOi:virDomainSetBlockIoTune",
                            &pyobj_domain,&disk,&pyinfo,&flags))
          return(NULL);
      domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);
@@ -3395,7 +3395,7 @@ libvirt_virDomainGetBlockIoTune(PyObject *self ATTRIBUTE_UNUSED,
      virTypedParameterPtr params;
      int c_ret;

-    if (!PyArg_ParseTuple(args, (char *)"Oi:virDomainGetBlockIoTune",
+    if (!PyArg_ParseTuple(args, (char *)"Ozi:virDomainGetBlockIoTune",
                            &pyobj_domain,&disk,&flags))
          return(NULL);
      domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain);

Pushed with the commit message updated.

Regards,
Osier

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]