search for: __del__

Displaying 17 results from an estimated 17 matches for "__del__".

2023 Feb 24
1
no way to force-close NBD handle in nbdsh
...ructure knows if its underlying C pointer is live or not; it exposes a way to force early closure, then the bindings return a closed_handle_error() if early closure has happened. We probably need to support something similar in the Python bindings. As a short-term hack, I tried directly calling h.__del__() - this is not a good idea, as our current __del__ implementation is not designed to be called twice, and when the later garbage collection calls it again, we segfault trying to free invalid memory. But less drastic measures, such as: import gc del h h = None gc.collect() were still insufficien...
2008 May 13
2
[LLVMdev] Python bindings available.
...k snake fluently.) class Pet(object): @staticmethod def new(): # Create a 'free' pet. It can later become owned, but not to more than one owner. return Pet(_core.LLVMCreatePet(), None) def __init__(self, ptr, owner): self.ptr = ptr self.owner = owner def __del__(self): # Do not call the dtor if something else has committed to do so for us! if !self.owner: _core.LLVMDisposePet(self.ptr) class Owner(pet): @staticmethod def new(): if pet.owner: raise OwnershipError("Pet already owned!") return Owner(_core.L...
2012 May 08
2
creation of storage volume fails
...9;) #now try to create the volume using the above storage pool object libvirt.virStoragePool.CreateXML(storagepoolobject,xmldesc,0) from python: -bash-4.1$ python >>> import libvirt >>> dir(libvirt.virStoragePool) ['UUID', 'UUIDString', 'XMLDesc', '__del__', '__doc__', '__init__', '__module__', 'autostart', 'build', 'connect', 'create', 'createXML', 'createXMLFrom', 'delete', 'destroy', 'info', 'isActive', 'isPersistent', 'listVolum...
2023 Feb 25
1
no way to force-close NBD handle in nbdsh
...rlying C pointer is live or not; it exposes > a way to force early closure, then the bindings return a > closed_handle_error() if early closure has happened. We probably need > to support something similar in the Python bindings. > > As a short-term hack, I tried directly calling h.__del__() - this is > not a good idea, as our current __del__ implementation is not designed > to be called twice, and when the later garbage collection calls it > again, we segfault trying to free invalid memory. This is a bug :-( > But less drastic > measures, such as: > > import...
2010 Nov 16
4
Remus crashes
...Internal error tc filter del dev vif1.0 parent ffff: proto ip pref 10 u32 RTNETLINK answers: Invalid argument We have an error talking to the kernel Exception xen.remus.util.PipeException: PipeException(''tc failed: 2, No such file or directory'',) in <bound method BufferedNIC.__del__ of <xen.remus.device.BufferedNIC object at 0x7f27844df210>> ignored I have tried to pin one physical core to Domain 0 and another one to the protected domain, using vcpu-pin but it doesn''t help. Currently I am running the Xen-unstable tree (last updated 3-4 days ago), 2.6.32.2...
2008 May 13
0
[LLVMdev] Python bindings available.
Um. Unfortunately in this case, Python will not collect an instance of Pet which owned by an Owner, because both objects in the reference cycle have finalizers (__del__). Python will just add both objects to a garbage list (and will not call any of the finalizers). It does this because it cannot guess which finalizer to call first. But I get your point though, and will try to work this into the code. Let me also add some tests to exercise all these well. Thanks...
2008 May 13
1
[LLVMdev] Python bindings available.
On May 13, 2008, at 07:31, Mahadevan R wrote: > Um. Unfortunately in this case, Python will not collect an instance > of Pet which owned by an Owner, because both objects in the > reference cycle have finalizers (__del__). Python will just add both > objects to a garbage list (and will not call any of the finalizers). Actually, there's no reference cycle, which is what I presume is the problem you're referring to: class Owner(pet): ... def __init__(self, ptr, kid): self.ptr = ptr p...
2011 Nov 04
1
Using guestfs.kill_subprocess()
Hey Rich, In the past I know you have mentioned that using guestfs.kill_subprocess() isn't strictly necessary after you are finished using libguestfs. I believe you said that in the python bindings, that step would happen automatically when the object goes out of scope and the __del__ method is called. However, since it never seemed to harm anything and I wanted to be extra safe, I always called guestfs.kill_subprocess() in Oz, without apparent harm. However, Richard Su has been investigating an issue where guestfs.kill_subprocess() actually does cause harm. I believe the...
2008 May 13
0
[LLVMdev] Python bindings available.
On Tue, May 13, 2008 at 1:22 PM, Gordon Henriksen <gordonhenriksen at mac.com> wrote: > On 2008-05-13, at 02:12, Mahadevan R wrote: > > >>> That's not how the object works... > > > > Gordon, I think I can make it work if we have the following additional > > function in LLVM-C: > > > > LLVMModuleRef LLVMGetModule(LLVMModuleProviderRef
2008 May 13
2
[LLVMdev] Python bindings available.
On 2008-05-13, at 02:12, Mahadevan R wrote: >>> That's not how the object works... > > Gordon, I think I can make it work if we have the following additional > function in LLVM-C: > > LLVMModuleRef LLVMGetModule(LLVMModuleProviderRef MP) { > return wrap(unwrap(MP)->getModule()); > } Can I ask, how general is your solution? I only intended to use this
2015 Sep 16
0
[PATCH] python: Set program name to the true name instead of 'python'.
...self._o = libguestfsmod.create (flags) self._python_return_dict = python_return_dict + # If we don't do this, the program name is always set to 'python'. + program = os.path.basename (sys.argv[0]) + libguestfsmod.set_program (self._o, program) + def __del__ (self): if self._o: libguestfsmod.close (self._o) -- 2.5.0
2011 Jan 03
1
availability of snapshots functionality via Python bindings
...t virtualization systems ii python-libvirt 0.4.6-10+lenny1 libvirt Python bindings I don't see anything like snapshots available via libvirt.virDomain: >>> dir(dom0) ['ID', 'OSType', 'UUID', 'UUIDString', 'XMLDesc', '__del__', '__doc__', '__init__', '__module__', '_conn', '_o', 'attachDevice', 'autostart', 'blockPeek', 'blockStats', 'connect', 'coreDump', 'create', 'destroy', 'detachDevice', 'info'...
2011 Feb 14
1
Use libvirt-python to attach cdrom
Hi all, I want to attach cdrom by libvirt.py .But can't find a func in libvirt.py can finish this work. Who can help me ? Regard -- Seven Ling E-mail: jiejie.ling at qq.com
2005 Nov 14
0
Xend fails to start on newly compiled xen dom0 kernel
...store/xstransact.py", line 103, in _list return map(lambda x: key + "/" + x, xshandle().ls(path)) RuntimeError: (2, ''No such file or directory'') Exception exceptions.RuntimeError: (2, ''No such file or directory'') in <bound method xstransact.__del__ of <xen.xend.xenstore.xstransact.xstransact instance$Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvDomainDir.py", line 78, in op_create dominfo = self.xd.domain_create(config) File "/usr/lib/python2.4/site-packages/xen/xend/Xe...
2006 Jun 09
15
[RFC][PATCH] Secure XML-RPC for Xend
Hi, The following patch implements a secure XML-RPC protocol for Xend. Instead of using HTTPS with basic authentication and dealing with all that nasty OpenSSL/PAM integration, it just uses SSH. This gives you all the properties you want (great security and PAM integration) with very little code. There are some minor issues so I''d rather it not be applied immediately.
2016 May 04
9
[PATCH 0/8] python: PEP 8 fixes
Hi, this series cleans up the Python sources, either static or generated, including also tests, to make them PEP 8 compliant; see https://www.python.org/dev/peps/pep-0008/ and tools like pep8. Almost all the issues reported by pep8 are fixed, reducing the issues from 3818 to 7. The changes should have no effect on the actual code, while it will help Python users with consistency with other
2019 May 23
2
[PATCH libnbd] api: Get rid of nbd_connection.
This isn't quite finished because not all of the tests or examples have been updated, but it demonstrates an idea: Should we forget about the concept of having multiple connections managed under a single handle? In this patch there is a single ‘struct nbd_handle *’ which manages a single state machine and connection (and therefore no nbd_connection). To connect to a multi-conn server you must