[libvirt] [PATCH python] Skip sparseRecvAll / sparseSendAll in sanity test

The sanity test check aims to ensure that every function listed in the Python code maps to a corresponding C function. The Sparse send/recv methods are special though - we're never calling the corresponding C APIs, instead we have a pure python impl. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- sanitytest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanitytest.py b/sanitytest.py index deec200..a5cb01b 100644 --- a/sanitytest.py +++ b/sanitytest.py @@ -351,7 +351,8 @@ for klass in gotfunctions: for func in sorted(gotfunctions[klass]): # These are pure python methods with no C APi if func in ["connect", "getConnect", "domain", "getDomain", - "virEventInvokeFreeCallback"]: + "virEventInvokeFreeCallback", + "sparseRecvAll", "sparseSendAll"]: continue key = "%s.%s" % (klass, func) -- 2.13.5

On 09/14/2017 02:50 PM, Daniel P. Berrange wrote:
The sanity test check aims to ensure that every function listed in the Python code maps to a corresponding C function. The Sparse send/recv methods are special though - we're never calling the corresponding C APIs, instead we have a pure python impl.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- sanitytest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sanitytest.py b/sanitytest.py index deec200..a5cb01b 100644 --- a/sanitytest.py +++ b/sanitytest.py @@ -351,7 +351,8 @@ for klass in gotfunctions: for func in sorted(gotfunctions[klass]): # These are pure python methods with no C APi if func in ["connect", "getConnect", "domain", "getDomain", - "virEventInvokeFreeCallback"]: + "virEventInvokeFreeCallback", + "sparseRecvAll", "sparseSendAll"]: continue
key = "%s.%s" % (klass, func)
Looks good to me. I tested it with libvirt v3.1.0 since with libvirt-python commit id d7e1c97 the sanitytest failed during build. This means all libvirt-python versions starting from 3.4.0 are hit by this bug. -- Mit freundlichen Grüßen/Kind regards Boris Fiuczynski IBM Deutschland Research & Development GmbH Vorsitzender des Aufsichtsrats: Martina Köderitz Geschäftsführung: Dirk Wittkopp Sitz der Gesellschaft: Böblingen Registergericht: Amtsgericht Stuttgart, HRB 243294

On 09/14/2017 02:50 PM, Daniel P. Berrange wrote:
The sanity test check aims to ensure that every function listed in the Python code maps to a corresponding C function. The Sparse send/recv methods are special though - we're never calling the corresponding C APIs, instead we have a pure python impl.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- sanitytest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sanitytest.py b/sanitytest.py index deec200..a5cb01b 100644 --- a/sanitytest.py +++ b/sanitytest.py @@ -351,7 +351,8 @@ for klass in gotfunctions: for func in sorted(gotfunctions[klass]): # These are pure python methods with no C APi if func in ["connect", "getConnect", "domain", "getDomain", - "virEventInvokeFreeCallback"]: + "virEventInvokeFreeCallback", + "sparseRecvAll", "sparseSendAll"]: continue
key = "%s.%s" % (klass, func)
Well, what if somebody builds -python against older libvirt that lacks virStreamSparseRecvAll()? Are they facing an exception because cmod is unable to find that func? Michal

On Mon, Sep 18, 2017 at 11:47:24AM +0200, Michal Privoznik wrote:
On 09/14/2017 02:50 PM, Daniel P. Berrange wrote:
The sanity test check aims to ensure that every function listed in the Python code maps to a corresponding C function. The Sparse send/recv methods are special though - we're never calling the corresponding C APIs, instead we have a pure python impl.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- sanitytest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sanitytest.py b/sanitytest.py index deec200..a5cb01b 100644 --- a/sanitytest.py +++ b/sanitytest.py @@ -351,7 +351,8 @@ for klass in gotfunctions: for func in sorted(gotfunctions[klass]): # These are pure python methods with no C APi if func in ["connect", "getConnect", "domain", "getDomain", - "virEventInvokeFreeCallback"]: + "virEventInvokeFreeCallback", + "sparseRecvAll", "sparseSendAll"]: continue
key = "%s.%s" % (klass, func)
Well, what if somebody builds -python against older libvirt that lacks virStreamSparseRecvAll()? Are they facing an exception because cmod is unable to find that func?
Yes, the same is true of any of the functions where we manually written the Python API. To be fully correct we ought to annotate the manually written python code and then process the .py file to strip out the APIs we can't support. Patches welcome for doing that.... Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|

On 09/18/2017 11:49 AM, Daniel P. Berrange wrote:
On Mon, Sep 18, 2017 at 11:47:24AM +0200, Michal Privoznik wrote:
On 09/14/2017 02:50 PM, Daniel P. Berrange wrote:
The sanity test check aims to ensure that every function listed in the Python code maps to a corresponding C function. The Sparse send/recv methods are special though - we're never calling the corresponding C APIs, instead we have a pure python impl.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com> --- sanitytest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sanitytest.py b/sanitytest.py index deec200..a5cb01b 100644 --- a/sanitytest.py +++ b/sanitytest.py @@ -351,7 +351,8 @@ for klass in gotfunctions: for func in sorted(gotfunctions[klass]): # These are pure python methods with no C APi if func in ["connect", "getConnect", "domain", "getDomain", - "virEventInvokeFreeCallback"]: + "virEventInvokeFreeCallback", + "sparseRecvAll", "sparseSendAll"]: continue
key = "%s.%s" % (klass, func)
Well, what if somebody builds -python against older libvirt that lacks virStreamSparseRecvAll()? Are they facing an exception because cmod is unable to find that func?
Yes, the same is true of any of the functions where we manually written the Python API. To be fully correct we ought to annotate the manually written python code and then process the .py file to strip out the APIs we can't support. Patches welcome for doing that....
Okay. Since we're doing that for others you have my ACK. This makes things better and no worse. Michal
participants (3)
-
Boris Fiuczynski
-
Daniel P. Berrange
-
Michal Privoznik