mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
services: hurd-vm: Support persistent images again.
Fixes a regression introduced in bab6434f58
whereby following the example from the manual regarding non-volatile images
would no longer work.
* gnu/services/virtualization.scm (hurd-vm-shepherd-service): Pass ‘image’ to
‘system-image’ only if it’s an image.
* doc/guix.texi (Virtualization Services): Explicitly say that the ‘image’
field can contain a file name. Remove use of ‘const’ for the ‘image’ field in
persistent image example and adjust text.
Fixes: guix/guix#4130
Reported-by: Maxim Cournoyer <maxim@guixotic.coop>
Change-Id: I1a81ce27fb45978a681310b8a8788ab671b3edf8
This commit is contained in:
@@ -40911,6 +40911,10 @@ The image type name. Use @code{'hurd-qcow2} for a 32-bit image or
|
|||||||
The image object representing the disk image of this virtual machine
|
The image object representing the disk image of this virtual machine
|
||||||
(@pxref{System Images}).
|
(@pxref{System Images}).
|
||||||
|
|
||||||
|
Alternatively, this can be the file name (a string) of an image, which
|
||||||
|
is useful if you want the image to persist across service restarts---see
|
||||||
|
example below.
|
||||||
|
|
||||||
@item @code{disk-size} (default: @code{'guess})
|
@item @code{disk-size} (default: @code{'guess})
|
||||||
The size of the disk image.
|
The size of the disk image.
|
||||||
|
|
||||||
@@ -41009,15 +41013,16 @@ with the following non-volatile secrets, unless they already exist:
|
|||||||
@end table
|
@end table
|
||||||
@end deftp
|
@end deftp
|
||||||
|
|
||||||
Note that by default the VM image is volatile, i.e., once stopped the
|
Note that by default the VM image is volatile---i.e., once the service
|
||||||
contents are lost. If you want a stateful image instead, override the
|
is stopped, the contents are lost. If you want a persistent image
|
||||||
configuration's @code{image} and @code{options} without
|
instead, override the configuration's @code{image} and @code{options}
|
||||||
the @code{--snapshot} flag using something along these lines:
|
without the @option{--snapshot} flag using something along these lines:
|
||||||
|
|
||||||
@lisp
|
@lisp
|
||||||
(service hurd-vm-service-type
|
(service hurd-vm-service-type
|
||||||
(hurd-vm-configuration
|
(hurd-vm-configuration
|
||||||
(image (const "/out/of/store/writable/hurd.img"))
|
;; Specify an out-of-store, persistent image.
|
||||||
|
(image "/out/of/store/writable/hurd.img")
|
||||||
(options '())))
|
(options '())))
|
||||||
@end lisp
|
@end lisp
|
||||||
|
|
||||||
|
|||||||
@@ -1904,7 +1904,9 @@ is added to the OS specified in CONFIG."
|
|||||||
'())
|
'())
|
||||||
#$@net-options
|
#$@net-options
|
||||||
#$@options
|
#$@options
|
||||||
"--hda" #+(system-image image)
|
"--hda" #+(if (image? image)
|
||||||
|
(system-image image)
|
||||||
|
image)
|
||||||
|
|
||||||
;; Cause the service to be respawned if the guest
|
;; Cause the service to be respawned if the guest
|
||||||
;; reboots (it can reboot for instance if it did not
|
;; reboots (it can reboot for instance if it did not
|
||||||
|
|||||||
Reference in New Issue
Block a user