From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Daniel P. Berrange" Subject: Re: [PATCH 05/11] virt: Introducing libvirt VM class Date: Wed, 12 Oct 2011 09:14:47 +0100 Message-ID: <20111012081447.GC9848@redhat.com> References: <1318367237-26081-1-git-send-email-lmr@redhat.com> <1318367237-26081-6-git-send-email-lmr@redhat.com> Reply-To: "Daniel P. Berrange" Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Lucas Meneghel Rodrigues Return-path: Received: from mx1.redhat.com ([209.132.183.28]:32684 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751670Ab1JLIPG (ORCPT ); Wed, 12 Oct 2011 04:15:06 -0400 Content-Disposition: inline In-Reply-To: <1318367237-26081-6-git-send-email-lmr@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|