mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-04-30 06:08:37 +02:00
updating qemu-guest-agent to use glicid version of qemu
This commit is contained in:
parent
3cd1d127a3
commit
946e4ec825
1 changed files with 61 additions and 0 deletions
61
glicid/services/virtualization.scm
Normal file
61
glicid/services/virtualization.scm
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
(define-module (glicid services virtualization)
|
||||||
|
#:use-module (glicid packages virtualizartion)
|
||||||
|
#:export (
|
||||||
|
qemu-guest-agent-configuration
|
||||||
|
qemu-guest-agent-configuration?
|
||||||
|
qemu-guest-agent-service-type
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(define-configuration qemu-guest-agent-configuration
|
||||||
|
(qemu (file-like qemu-minimal) "QEMU package.")
|
||||||
|
(device
|
||||||
|
(string "")
|
||||||
|
"Path to device or socket used to communicate with the host. If not specified, the QEMU default path is used."
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(define (qemu-guest-agent-shepherd-service config)
|
||||||
|
(let
|
||||||
|
(
|
||||||
|
(qemu (qemu-guest-agent-configuration-qemu config))
|
||||||
|
(device (qemu-guest-agent-configuration-device config))
|
||||||
|
)
|
||||||
|
(list
|
||||||
|
(shepherd-service
|
||||||
|
(provision '(qemu-guest-agent))
|
||||||
|
(documentation "Run the QEMU guest agent.")
|
||||||
|
(start #~(make-forkexec-constructor
|
||||||
|
`(,
|
||||||
|
(string-append #$qemu "/bin/qemu-ga")
|
||||||
|
"-d"
|
||||||
|
"--pidfile=/var/run/qemu-ga.pid"
|
||||||
|
"--statedir=/var/run"
|
||||||
|
,@(if #$device
|
||||||
|
(list (string-append "--path=" #$device))
|
||||||
|
'()
|
||||||
|
)
|
||||||
|
)
|
||||||
|
#:pid-file "/var/run/qemu-ga.pid"
|
||||||
|
#:log-file "/var/log/qemu-ga.log")
|
||||||
|
)
|
||||||
|
(stop #~(make-kill-destructor))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(define qemu-guest-agent-service-type
|
||||||
|
(service-type
|
||||||
|
(name 'qemu-guest-agent)
|
||||||
|
(extensions
|
||||||
|
(list (
|
||||||
|
service-extension
|
||||||
|
shepherd-root-service-type
|
||||||
|
qemu-guest-agent-shepherd-service
|
||||||
|
))
|
||||||
|
)
|
||||||
|
(default-value (qemu-guest-agent-configuration))
|
||||||
|
(description "Run the QEMU guest agent.")
|
||||||
|
)
|
||||||
|
)
|
Loading…
Add table
Reference in a new issue