<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small;color:#000000"><span style="color:rgb(34,34,34)">On Mon, Mar 11, 2019 at 11:35 PM Nir Soffer <<a href="mailto:nirsof@gmail.com">nirsof@gmail.com</a>> wrote:</span><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Commit 2b4bd07e0a22 (Add check for params, nparams being a dictionary)<br>
changed the way the optional params argument is treated. If<br>
libvirt.virDomain.blockCopy() is called without specifying params,<br>
params is None, and the call will fail with:<br>
<br>
    TypeError: block params must be a dictionary<br>
<br>
This is wrong as params is defined as kwarg, breaking existing libvirt<br>
users like oVirt. Add a check for Py_None, so we accept either a dict or<br>
None and fail with TypeError with anything else.<br>
<br>
Resolves: <a href="https://bugzilla.redhat.com/1687114" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/1687114</a><br>
<br>
Signed-off-by: Nir Soffer <<a href="mailto:nsoffer@redhat.com" target="_blank">nsoffer@redhat.com</a>><br>
---<br>
 libvirt-override.c | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/libvirt-override.c b/libvirt-override.c<br>
index 857c018..c5e2908 100644<br>
--- a/libvirt-override.c<br>
+++ b/libvirt-override.c<br>
@@ -8835,11 +8835,11 @@ libvirt_virDomainBlockCopy(PyObject *self ATTRIBUTE_UNUSED,<br>
         if (virPyDictToTypedParams(pyobj_dict, &params, &nparams,<br>
                                    virPyDomainBlockCopyParams,<br>
                                    VIR_N_ELEMENTS(virPyDomainBlockCopyParams)) < 0) {<br>
             return NULL;<br>
         }<br>
-    } else {<br>
+    } else if (pyobj_dict != Py_None) {<br>
         PyErr_Format(PyExc_TypeError, "block params must be a dictionary");<br>
         return NULL;<br>
     }<br>
<br>
     dom = (virDomainPtr) PyvirDomain_Get(pyobj_dom);<br>
-- <br>
2.17.2<br>
<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">Tested with oVirt master and qemu master, live storage migration completed successfully.</div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)"><br></div><div class="gmail_default" style="font-size:small;color:rgb(0,0,0)">Nir</div></div></div>