Commit Graph

14 Commits

Author SHA1 Message Date
Matt Churchyard
ad0425e7ce Fix #26. Just provide sample dnsmasq configuration 2015-11-09 09:18:37 +00:00
Matt Churchyard
6e2f3726cb More relentless performance chasing
Try to reduce number of shell callouts to the bare minimum.
It's slightly more ugly but use setvar to set return values where possible.
Over the top 1000-round testing showed almost a second for $(), and near instant
for setvar. The following functions now take a variable name and set that rather than
echo'ing the response, so can be called inline rather than via $().

__switch_get_ident
__config_get
__vm_running_check
__vm_find_console
__vm_get_disk_path

Also use ${var%%} & ${var##} to parse slot/func numbers from passthru devices rather
than callout to echo/cut.
2015-10-19 16:26:20 +01:00
Matt Churchyard
1ecbb3bb4b Line up 'list' and 'switch list' output :) 2015-10-19 14:44:54 +01:00
Matt Churchyard
b4f0854a3b Code documentation
Add some (admittedly php style) comments to each function to explain what they
do, arguments, and what they output. Useful for anyone who's trying to figure
out how things work and why certain things are done.
2015-10-19 13:27:55 +01:00
Matt Churchyard
30f46b4ce9 Speed up 'vm switch_list' with __config functions 2015-10-19 10:56:22 +01:00
Matt Churchyard
48e669bb23 Tidy up virtual switches
Get rid of '-' on the end of the name - Just use $ in grep to make sure we get an entire match
Will need to keep additional search for '{name}-'  for now as existing switches may have old style names
until a reboot.
Remove interfaces from configuration first otherwise you have to manually edit configuration if
ifconfig command doesn't complete for any reason.
Hide ifconfig errors and just produce our own messages when things don't work correctly
2015-10-19 10:47:50 +01:00
Matt Churchyard
93b44198a6 Small switch fixes 2015-08-13 09:27:26 +01:00
Matt Churchyard
d6281efc19 Tidy up and comment on some of the logic 2015-08-12 15:11:44 +01:00
Matt Churchyard
16f281a47d Various changes - see full commit message for details
Replace spaces with tabs
Change __nat_init function name to match other functions in the switch library
Completely rewrite guest support, making vm-core logic much cleaner
Guests are now supported via the lib/vm-guest library
Each guest has a function which unifies the install/run logic in once place rather than two.
Loaders now run in the background; Not 100% ideal in some cases but better for most.
This also fixes the small tap0 issue which will now only present itself if you start a guest
with no networking
All guests need more testing with these changes but should be functional.
2015-08-08 12:21:01 +01:00
Matt Churchyard
f84a338bc6 Slight mistake in pf include rule 2015-08-07 16:54:32 +01:00
Matt Churchyard
01687e55f2 Add some basic nat support, few quirks but fairly automated 2015-08-07 16:52:07 +01:00
Matt Churchyard
a279c8f4ee Centralise console (currently nmdm) creation 2015-08-03 12:51:02 +01:00
Charlie Root
183a87dc4f Move to BSD dev environment 2015-06-30 10:21:30 +01:00
churchers
3e93f7d1c7 Big tidy up
Simplify main script and move functions into independent libraries.
Add a Makefile to install everything to the correct places.
Add an initial man page.
2015-06-29 11:14:42 +01:00