From b7249aa4726193653e05e694ec4bb311aa4ec6c2 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Sat, 20 Jun 2020 10:04:30 +0200 Subject: services: childhurd: Support more than one instance. * gnu/services/virtualization.scm ()[options]: Remove "--hda" option. [id,net-options]: New fields. (hurd-vm-net-options): New procedure. Parameterize port forwarding with ID. * gnu/services/virtualization.scm (hurd-vm-shepherd-service): Use them. Parameterize provision with ID, if set. Hardcode "--hda" option for image. * doc/guix.texi (Virtualization Services): Document new fields. Update for hardcoding of "--hda". --- doc/guix.texi | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 2268e159a2..5b854ccbd4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -24728,12 +24728,31 @@ The size of the disk image. @item @code{memory-size} (default: @code{512}) The memory size of the Virtual Machine in mebibytes. -@item @code{options} (default: @code{'("--device"} @code{"rtl8139,netdev=net0"} @ - @code{"--netdev"} @ - @code{"user,id=net0,hostfwd=tcp:127.0.0.1:20022-:2222,hostfwd=tcp:127.0.0.1:25900-:5900"} @ - @code{"--snapshot"} @ - @code{"--hda")}) +@item @code{options} (default: @code{'("--snapshot")}) The extra options for running QEMU. + +@item @code{id} (default: @code{#f}) +If set, a non-zero positive integer used to parameterize Childhurd +instances. It is appended to the service's name, +e.g. @code{childhurd1}. + +@item @code{net-options} (default: @var{hurd-vm-net-options}) +The procedure used to produce the list of QEMU networking options. + +By default, it produces + +@lisp +'("--device" "rtl8139,netdev=net0" + "--netdev" "user,id=net0\ + ,hostfwd=tcp:127.0.0.1:-:2222\ + ,hostfwd=tcp:127.0.0.1:-:5900") +@end lisp +with forwarded ports +@example +: @code{(+ 10022 (* 1000 @var{ID}))} +: @code{(+ 15900 (* 1000 @var{ID}))} +@end example + @end table @end deftp @@ -24745,10 +24764,8 @@ the @code{--snapshot} flag using something along these lines: @lisp (service hurd-vm-service-type (hurd-vm-configuration - (image (const "/out/of/store/writable/hurd.img")) - (options '("--device" "rtl8139,netdev=net0" - "--netdev" - "user,id=net0,hostfwd=tcp:127.0.0.1:20022-:2222")))) + (image (const "/out/of/store/writable/hurd.img")) + (options '("--hda")))) @end lisp @node Version Control Services -- cgit v1.2.3