From: Ingo Molnar Subject: Re: [PATCH 5/7] kvm tools: Add help and info messages to 'kvm setup' Date: Fri, 14 Oct 2011 08:08:51 +0200 Message-ID: <20111014060851.GA19874@elte.hu> References: <1318498366-7824-1-git-send-email-levinsasha928@gmail.com> <1318498366-7824-5-git-send-email-levinsasha928@gmail.com> <20111013100046.GA13651@elte.hu> <20111013165233.GB30861@elte.hu> <4E978A3B.5070608@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Pekka Enberg , Sasha Levin , kvm@vger.kernel.org, gorcunov@gmail.com To: Asias He Return-path: Received: from mx2.mail.elte.hu ([157.181.151.9]:40472 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755459Ab1JNGK2 (ORCPT ); Fri, 14 Oct 2011 02:10:28 -0400 Content-Disposition: inline In-Reply-To: <4E978A3B.5070608@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: * Asias He wrote: > On 10/14/2011 02:22 AM, Pekka Enberg wrote: > > On Thu, Oct 13, 2011 at 7:52 PM, Ingo Molnar wrote: > >>>> Btw., will 'kvm run' select the last-created rootfs by default? > >>> > >>> No, it runs rootfs that's named 'default'. We can change that but > >>> I'm not completely convinced running that last-created rootfs is > >>> the right thing to do here. Hmm. > >> > >> I'm not convinced either - just wanted to raise the issue. > > > > Right. So 'kvm run' is supposed to setup and launch a 'default' rootfs > > if no rootfs is specified. > > > >> Also, i raised this in the other thread, why not use .kvmtool of the > >> current directory? That way it's cwd local like Git and perf. A 'kvm > >> run' (union?) mount the cwd or so - so this would be a natural > >> equivalent to chroot. The $HOME/.kvmtool is a Qemu-ish global > >> workflow. > > > > Yeah, that definitely makes sense. 'kvm setup rootfs' wouldn't create > > rootfs under $HOME/.kvmtool/rootfs but under $(PWD)/rootfs. > > I also think $(PWD)/rootfs is much better than > $HOME/.kvmtool/rootfs. I think 'kvm setup $absolute_rootfs_path' > make sense as well. The nice thing about $CWD and chroot is that it takes the current directly as the 'root directory' of the chroot environment. The canonical extension of that would be to create .kvmtool/ in $CWD and to union-mount the files in the current directory on top of the .kvmtool 'binary environment' - or such. Or, an approximation of that would be to simply mount $CWD as /home of the guest environment. Thus $CWD/.kvmtool/default/ would be the default root fs (multiple instances can be created), and $CWD would be the default /home or /host filesystem. > > I guess we'll lose the ability to 'kvm list' all available rootfs > > directories, though? > > User can create and put the rootfs directories where he/she likes. > We do not need to track where the rootfs directories is, thus we do > not need to 'kvm list' them. listing the current ones in $CWD would still be handy. *If* users prefer some kind of global workflow then $HOME/.kvmtool can still be special and we can do a 'kvm list --all' kind of thing which would also list $HOME/.kvmtool instances. Or 'kvm list' could list both $CWD and $HOME instances and would be able to run them. Naming clashes could be handled via some straightforward way, for example by naming the default rootfs in $HOME 'global' - it would be in $HOME/.kvmtool/global. The default one in $CWD would be named 'local' and be in $CWD/.kvmtool/local. Or so. Thanks, Ingo