[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] running libguestfs as a service?



Hello,

First off, many thanks for libguestfs... very useful!

I'm trying to run libguestfs as an RPC service by using a python
daemon with the python libguestfs bindings. With this service I'm
"centrally" editing VM images, and often running many GuestFS() on the
same image file in a short amount of time to edit the image's
contents.

The problem I'm running across is that each GuestFS() instance called
from within the python daemon doesn't terminate itself (until a
timeout much later?). I believe this sometimes causes my image edits
to clobber each other and corrupt the image now and then. Each image
edit usually amounts to:

g = guestfs.GuestFS()
g.add_drive(image_file)
g.launch()
g.mount("/dev/vda1", "/")
g.write(file_name, file_contents)
g.sync()
g.umount_all()
g.close()
del g


As I understand things, there is a reference count that should close
"g" once the reference count = 0. However, I can't seem to make that
happen inside of my python daemon which continues to run.

Any clues on how I might accomplish this or what I'm doing wrong?

Thanks

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]