mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-12-06 00:23:47 +03:00
Add c_pointer method to classes.
This returns the raw C pointer to the underlying object, eg:
conn = libvirt.open(None)
print "0x%x" % conn.c_pointer() # returns virConnectPtr of the connection
dom = conn.lookupByName("test")
print "0x%x" % dom.c_pointer() # returns virDomainPtr of the domain
The reason behind this is to allow us to transparently pass Python dom
objects through the libguestfs Python API.
https://bugzilla.redhat.com/show_bug.cgi?id=1075164
This commit is contained in:
@@ -109,6 +109,8 @@ for klassname in gottypes:
|
||||
for name in dir(klassobj):
|
||||
if name[0] == '_':
|
||||
continue
|
||||
if name == 'c_pointer':
|
||||
continue
|
||||
thing = getattr(klassobj, name)
|
||||
if callable(thing):
|
||||
gotfunctions[klassname].append(name)
|
||||
|
||||
Reference in New Issue
Block a user