I've been running some experiments with rumprun+xen and needed the ability
to pass additional parameters to xen (e.g. cpu-pool or tsc_mode). I added
this support (the -g option for a xen guest) by appending the guest args to
${TEMPDIR}/xr.conf. I also expanded the output of "rumprun -D xen..." to
include the contents of ${TEMPDIR}/xr.conf since this is important for
understanding the effects of the guest options. I figured I'd offer up the
changes in case anyone thought they were interesting.
Notes:
- -D
- The -D output isn't pretty, but I'm not sure how to improve it.
Note the extra newlines surrounding the contents. In particular,
it doesn't
follow the "this is the literal command that would be run"
pattern of -D. A
more literal output is less readable, and still can't be copy/pasted from
the output of -D.
- The bash code for printing xr.conf includes literal newlines. I'm
not sure how to portably inject newlines in bash variables in a readable
way.
- Are there other known issues with -D on xen? Do we still need the
warning?
- -g
- The use of ";" in xr.conf instead of newlines is used because it's
more convenient to write on the command line. I'm not sure the
best way to
convey the intended usage to users (is this sort of thing documented
somewhere users can find?).
- I've tested this locally on xen 4.8 and Ubuntu 16.04. The version
of Xen shouldn't matter because the xl.conf behavior is very stable.
- One potential issue is users overwriting rumprun args like cpus or
memory. The way I've implemented it, -g args will take priority over
existing rumprun settings.
A patch is attached (output of git diff). Let me know if this looks useful
or suggest changes.
Nathan Pemberton
P.S.
Example usage and output for simple hello world:
$ rumprun -DS xen -g "tsc_mode=\"native\";pool=\"test\"" hellorr
!!!
!!! NOTE: rumprun is experimental. syntax may change in the future
!!!
WARNING: -D not perfectly supported by Xen
sudo xenstore-write /local/domain/sudo xl domid rumprun-hellorr/rumprun/cfg
{,
"blk" : {,
"source": "dev",
"path": "virtual",
"fstype": "kernfs",
"mountpoint": "/kern",
},
"cmdline": "hellorr",
},
xl config (/tmp/rumprun.trDhvvm9/xr.conf):
kernel="hellorr"
name="rumprun-hellorr"
vcpus=1
memory=64
on_poweroff="destroy"
on_crash="destroy"
;tsc_mode="native";pool="test"
xen:sudo xl domid rumprun-hellorr
xen_support_patch.diff
Description: Binary data
