On 10/12/2011 05:14 AM, Daniel P. Berrange wrote:
On Tue, Oct 11, 2011 at 06:07:11PM -0300, Lucas Meneghel Rodrigues wrote:
This is a first attempt at providing a libvirt VM class,
in order to implement the needed methods for virt testing.
With this class, we will be able to implement a libvirt
test, that behaves similarly to the KVM test.
As of implementation details, libvirt_vm uses virsh
(a userspace program written on top of libvirt) to
do domain start, stop, verification of status and
other common operations. The reason why virsh was
used is to get more coverage of the userspace stack
that libvirt offers, and also to catch issues that
virsh users would catch.
Personally I would have recommended that you use the libvirt Python API.
virsh is a very thin layer over the libvirt API, which mostly avoidse
adding any logic of its own, so once it has been tested once, there's
not much value in doing more. By using the Python API directly, you will
be able todo more intelligent handling of errors, since you'll get the
full libvirt python exception object instead of a blob of stuff on stderr.
Not to mention that it is so much more efficient, and robust against
any future changes in virsh.
Thanks Daniel. We've discussed about that quite a few times during the
development of the code. The plan is to just add methods that will do
the same as the API counterpart moving forward, so we can test both the
think layer that is virsh and the py API. We just wanted to focusing in
one implementation to get something functional first.
We'll keep you guys posted about progress on py bindings.
Cheers,
Lucas
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html