From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lucas Meneghel Rodrigues Subject: Re: [Autotest] Adding kvm_subprocess Date: Wed, 01 Jul 2009 11:01:46 -0300 Message-ID: <1246456906.14963.4.camel@freedom> References: <36016862.218871245338828210.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: lookkas@gmail.com, autotest@test.kernel.org, kvm@vger.kernel.org To: Michael Goldish Return-path: Received: from mx2.redhat.com ([66.187.237.31]:44948 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755450AbZGAOBv (ORCPT ); Wed, 1 Jul 2009 10:01:51 -0400 In-Reply-To: <36016862.218871245338828210.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi Michael, On Thu, 2009-06-18 at 11:27 -0400, Michael Goldish wrote: > kvm_subprocess is a little weird in that it does two different things -- > handling of both non-interactive subprocesses and SSH sessions. > With this approach I don't think we need to write an SSH subclass of > kvm_spawn because it already does a lot of SSH stuff. Fair enough. I just happen to like the approach took by pexpect folks to separate SSH implementation on a subclass, because the generic problem itself is 'interacting with interactive programs on a programatic way', and handling SSH connections is a subset of this problem. > If we do any subclassing at all -- I suggest that we remove all the SSH > stuff from kvm_spawn and put it in a subclass somehow, so that kvm_spawn > natively only handles non-interactive subprocess (with _tail(), > get_output(), get_status() etc), and the subclass does everything else > (read_up_to_prompt(), get_command_status_output() etc). ssh_login() > can remain an external function that creates and returns a kvm_spawn > object. > This will have to be done carefully because each 'user' of the kvm_spawn > server needs a named pipe of its own, which will have to be handled by > the constructor. > If you think this is a good idea I'd rather make the necessary changes > to kvm_subprocess myself. Sounds good to me, I am totally OK with it. > Does this make sense to you, or did I misunderstand what you meant by > writing an SSH subclass? No, you've nailed it. Sorry for the delay in answering.