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

Re: [Libvir] [RFC]OpenVZ XML def

Shuveb Hussain wrote:
Hi Daniel,

Oh at the C level, definitely ! The python layer is really only a language binding wrapper and should remain that way ! Even if we fork as a new process the python side of libvirt is packaged separately, and really the core should be written in C, this would also allow to merge back your code in the existing
daemon code if needed.

I understand the Python bindings part. I was wondering if the daemon
itself could be written in Python, since I have to deal with a lot of
text parsing from the OpenVZ utils. The LibVirt part that will talk to
the daemon over the proxy/pipe code will anyways have to be C.

As I said:

I'm a big advocate of using a sane language instead of C, but libvirt is written in C for better or worse.

Can you give an example of the kind of text processing which you need to do?

I assume that this is just parsing the output of the OpenVZ command line utilities, or are there other things that need to be parsed? We can definitely help in this area.

Writing a separate Python daemon has several problems:
(1) It introduces a dependency on Python for base libvirt.[*]
(2) You have to have a protocol to talk over the pipe, and it's not clear what that would be. (3) You have to create, manage and tear down the pipe and subprocess. Error handling in particular is complicated. What happens if the subprocess goes away suddenly? Or if you can't fork? (4) Pipes / subprocesses / Python don't work well on Windows, not that I personally care much about that, but we shouldn't exclude the possibility that people will wish to run libvirt on Windows.


[*] Although currently the Python bindings are distributed with libvirt, I'd like to see them broken out as a separate package.

Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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