From: Christopher Covington <cov@codeaurora.org>
To: "Gabriel L. Somlo" <gsomlo@gmail.com>, qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] RFC: Proposal to add QEMU "Guest Environment Variables"
Date: Wed, 04 Feb 2015 10:55:41 -0500 [thread overview]
Message-ID: <54D240FD.6010105@codeaurora.org> (raw)
In-Reply-To: <20150203190921.GR3354@HEDWIG.INI.CMU.EDU>
Hi Gabriel,
Summary up top, why I like the approach below.
On 02/03/2015 02:09 PM, Gabriel L. Somlo wrote:
> Hi,
> For this functionality to really resemble the way environment variables
> are used, environment information should be provided as part of the QEMU
> command line, without the requirement to make a separate/subsequent
> connection to the guest agent. For example:
>
> qemu-system-x86_64 -guest-env="VAR1=value1;VAR2=value 2" -hda image.qcow2
qemu-system-x86_64 -append "myvars=VAR1=value1;VAR2=value2" -hda image.qcow2
> Once the guest is started, it should be possible to query the guest
> environment with something like:
>
> $ qemu-guest-env get VAR1
> value1
>
> $ qemu-guest-env get VAR2
> value 2
eval `sed -nr 's/myvars=(.*)/\1/' /proc/cmdline`
echo $VAR1
echo $VAR2
I have two use cases that I've enabled or would like to enable across a
variety of platforms and architectures:
A) Script workload(s) that should run from a regular "cold" boot.
B) On slow systems, script the workload(s) that should be run immediately
following a checkpoint restore ("warm" boot).
Originally I was using the ARM Angel semihosting command line for both A and
B. But that required a JTAG debugger be attached to hardware devices, so I
switched to appending foo=bar strings to /proc/cmdline, which has the
additional benefit of being portable across architectures. Does QEMU's -append
flag for setting and something like `sed -nr 's/myopts=(.*)/\1/'
/proc/cmdline` for getting work for your use case?
I've wondered about something portable across architectures like QMP or
VirtIO-something for the B use case, but that hasn't really progressed beyond
thought experiment.
Chris
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-02-04 15:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-03 19:09 [Qemu-devel] RFC: Proposal to add QEMU "Guest Environment Variables" Gabriel L. Somlo
2015-02-03 19:14 ` Denis V. Lunev
2015-02-03 20:14 ` Gabriel L. Somlo
2015-02-03 20:23 ` Denis V. Lunev
2015-02-03 19:26 ` Eric Blake
2015-02-03 20:54 ` Gabriel L. Somlo
2015-02-03 20:11 ` Michael Roth
2015-02-03 21:38 ` Gabriel L. Somlo
2015-02-03 21:49 ` Denis V. Lunev
2015-02-03 22:14 ` Gabriel L. Somlo
2015-02-03 22:08 ` Michael Roth
2015-02-04 9:31 ` Daniel P. Berrange
2015-02-04 15:20 ` Gabriel L. Somlo
2015-02-04 15:24 ` Daniel P. Berrange
2015-02-04 15:59 ` Gabriel L. Somlo
2015-02-04 16:12 ` Daniel P. Berrange
2015-02-04 9:29 ` Daniel P. Berrange
2015-02-04 15:55 ` Christopher Covington [this message]
2015-02-04 16:00 ` Richard W.M. Jones
2015-02-04 16:06 ` Gabriel L. Somlo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54D240FD.6010105@codeaurora.org \
--to=cov@codeaurora.org \
--cc=gsomlo@gmail.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).