guix-glicid/glicid/services/virtualization.scm

43 lines
1.4 KiB
Scheme
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(define-module (glicid services virtualization)
#:use-module (gnu services)
#:use-module (gnu services shepherd)
#:use-module (gnu services virtualization)
#:use-module (gnu packages virtualization))
;;;
;;; QEMU guest agent service.
;;;
;;
;;(define qemu-guest-agent-shepherd-service:gnu (@@ (gnu services virtualization) qemu-guest-agent-shepherd-service))
(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))
(requirement '(udev)) ;; GLiCID
(documentation "Run the QEMU guest agent.")
(start #~(make-forkexec-constructor
`(,(string-append #$qemu "/bin/qemu-ga")
"--statedir" "/var/run"
,@(if (string-null? #$device)
'()
(list "--path" #$device)))
#:log-file "/var/log/qemu-ga.log"))
(stop #~(make-kill-destructor))))))
(define glicid-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.")))