From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQXy8-0004Uf-Nm for qemu-devel@nongnu.org; Wed, 25 Feb 2015 04:09:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQXy4-0007NJ-UQ for qemu-devel@nongnu.org; Wed, 25 Feb 2015 04:09:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQXy4-0007NA-Me for qemu-devel@nongnu.org; Wed, 25 Feb 2015 04:09:20 -0500 Date: Wed, 25 Feb 2015 09:09:13 +0000 From: "Daniel P. Berrange" Message-ID: <20150225090912.GB4263@redhat.com> References: <1424806987-24790-1-git-send-email-somlo@cmu.edu> <1424806987-24790-3-git-send-email-somlo@cmu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1424806987-24790-3-git-send-email-somlo@cmu.edu> Subject: Re: [Qemu-devel] [RFC PATCH 2/2] qga: add --getenv option to get env. vars from fw_cfg Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gabriel L. Somlo" Cc: lersek@redhat.com, rjones@redhat.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On Tue, Feb 24, 2015 at 02:43:07PM -0500, Gabriel L. Somlo wrote: > The new "-g" (or "--getenv") command line option causes qemu-ga to extract > and parse the "etc/guestenv" blob from fw_cfg, and return the value of > the requested key (if available) on stdout. > > Warnings and error messages are printed to stderr, and only the actual > value portion of a "key=value" string matching the "--getenv key" argument > will be printed to stdout. Strings are searched in reverse order to > implement a sort of "last dupe wins" policy -- but I expect to refine > things quite a bit after receiving some feedback. > > I've added a flag to qemu-ga instead of creating a completely separate > binary, but I don't feel strongly about keeping it that way. I just need > something that would end up tightly integrated with the "qemu guest tools" > package... It should really be a separate binary. Overloading multiple functions in one binary makes it very hard to write a security policy to confine what the binary can do, as you can't get the kernel to apply different policies based on what CLI flag was passed. 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 :|