[Libvir] A couple of questions about the Python bindings

Richard W.M. Jones rjones at redhat.com
Tue Mar 27 11:58:08 UTC 2007


virDomainGetUUIDString,
virDomainPinVcpu,
virNetworkGetUUIDString:

   These functions don't seem to check whether the parameters are 
correct.  For example, virDomainGetUUIDString doesn't check if the 
buffer parameter passed from Python is large enough to take the UUID string.

   virDomainPinVcpu is just plain strange (but I guess that strangeness 
eminates from the Xen implementation), but it seems possible for the 
Python code to be wrong about the length of the Vcpu map (string). 
Shouldn't the length be taken from the string itself?

virDomainUndefine,
virNetworkUndefine:

   It's unclear from the libvirt documentation, but it sounds as if 
these functions invalidate (free) the virDomainPtr / virNetworkPtr 
object passed to them.  (In fact, the Xen implementation of virDomainPtr 
at least _doesn't_ free it - is that a bug?)  If this is the case, then 
the Python bindings ought to set self._o = None.

Rich.

-- 
Emerging Technologies, Red Hat  http://et.redhat.com/~rjones/
64 Baker Street, London, W1U 7DF     Mobile: +44 7866 314 421
  "[Negative numbers] darken the very whole doctrines of the equations
  and make dark of the things which are in their nature excessively
  obvious and simple" (Francis Maseres FRS, mathematician, 1759)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070327/f6fb5378/attachment-0001.bin>


More information about the libvir-list mailing list