• G
    python: return dictionary without value in case of no blockjob · 0f9e67bf
    Guannan Ren 提交于
    Currently, when there is no blockjob, dom.blockJobInfo('vda')
    still reports error because it doesn't distinguish return value 0 from -1.
    libvirt.libvirtError: virDomainGetBlockJobInfo() failed
    
    virDomainGetBlockJobInfo() API return value:
     -1 in case of failure, 0 when nothing found, 1 found.
    
    And use PyDict_SetItemString instead of PyDict_SetItem when key is
    of string type. PyDict_SetItemString increments key/value reference
    count, so call Py_DECREF() for value. For key, we don't need to
    do this, because PyDict_SetItemString will handle it internally.
    0f9e67bf
libvirt-override.c 208.1 KB