From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sasha Levin Subject: Re: [PATCH 2/2] kvm tools: Allow easily sandboxing applications within a guest Date: Fri, 02 Dec 2011 09:44:43 +0200 Message-ID: <1322811883.8778.6.camel@lappy> References: <1322810215-9647-1-git-send-email-levinsasha928@gmail.com> <1322810215-9647-2-git-send-email-levinsasha928@gmail.com> <1322811328.8778.1.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com To: Pekka Enberg Return-path: Received: from mail-ww0-f42.google.com ([74.125.82.42]:48308 "EHLO mail-ww0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751796Ab1LBHo5 (ORCPT ); Fri, 2 Dec 2011 02:44:57 -0500 Received: by wgbds13 with SMTP id ds13so514024wgb.1 for ; Thu, 01 Dec 2011 23:44:56 -0800 (PST) In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2011-12-02 at 09:39 +0200, Pekka Enberg wrote: > On Fri, 2011-12-02 at 09:26 +0200, Pekka Enberg wrote: > >> On Fri, Dec 2, 2011 at 9:16 AM, Sasha Levin wrote: > >>> This patch adds a '--sandbox' argument when used in conjuction with a custom > >>> rootfs, it allows running a script or an executable in the guest environment > >>> by using executables and other files from the host. > >>> > >>> This is useful when testing code that might cause problems on the host, or > >>> to automate kernel testing since it's now easy to link a kvm tools test > >>> script with 'git bisect run'. > >>> > >>> Suggested-by: Ingo Molnar > >>> Signed-off-by: Sasha Levin > >> > >> Nice! How do I use this to run trinity sandboxed in a guest? > > On Fri, 2 Dec 2011, Sasha Levin wrote: > > Assuming you have trinity installed in /usr/bin or something similar in > > on the host (you can just 'cp trinity /usr/bin/'), just write this > > script: > > > > test-trinity.sh: > > #! /bin/bash > > trinity --mode=random --quiet -i > > > > and run using: > > ./kvm run -k [kernel to test] --sandbox test-trinity.sh > > Would it not be better to introduce a new command that works like 'perf > stat', for example: > > ./kvm sandbox -k -- trinity --mode=random --quiet -i > > ? So basically proxy the first set of parameters to 'kvm run' and run the second one as the script? Thats possible as well. I did the '--sandbox' parameters so that we could pass a script that could do more complex testing in the guest, but it's also possible with your suggestion so we could do it that way as well. -- Sasha.