diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm index 66ae1a1565..9b4512cff7 100644 --- a/gnu/services/virtualization.scm +++ b/gnu/services/virtualization.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ryan Moe -;;; Copyright © 2018, 2020, 2021 Ludovic Courtès +;;; Copyright © 2018, 2020-2022 Ludovic Courtès ;;; Copyright © 2020,2021 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Timotej Lazar ;;; @@ -866,23 +866,23 @@ functionality of the kernel Linux."))) "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 - (match-lambda - (($ qemu device) - (list - (shepherd-service - (provision '(qemu-guest-agent)) - (documentation "Run the QEMU guest agent.") - (start #~(make-forkexec-constructor - `(,(string-append #$qemu "/bin/qemu-ga") "--daemon" - "--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-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") "--daemon" + "--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