me
/
guix
Archived
1
0
Fork 0

services: qemu-guest-agent: Fix implementation.

Previously, by accessing the raw <qemu-guest-agent-configuration>
fields, 'qemu' would match the first field, which is the '%location'
field, not the 'qemu' field.

It would seem this bug has always been present since the addition of the
'location' field in d132d9f96b predates
the addition of 'qemu-guest-agent-service-type' in
f634a0baab.

Fixes <https://issues.guix.gnu.org/54041>.
Reported by Ricardo Wurmus <rekado@elephly.net>.

* gnu/services/virtualization.scm (qemu-guest-agent-shepherd-service):
Use accessors for <qemu-guest-agent-configuration>.
Ludovic Courtès 2022-02-18 11:29:10 +01:00
parent 0ca26437cb
commit 01821914e2
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 18 additions and 18 deletions

View File

@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Ryan Moe <ryan.moe@gmail.com> ;;; Copyright © 2017 Ryan Moe <ryan.moe@gmail.com>
;;; Copyright © 2018, 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2018, 2020-2022 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2021 Timotej Lazar <timotej.lazar@araneo.si> ;;; Copyright © 2021 Timotej Lazar <timotej.lazar@araneo.si>
;;; ;;;
@ -866,23 +866,23 @@ functionality of the kernel Linux.")))
"Path to device or socket used to communicate with the host. If not "Path to device or socket used to communicate with the host. If not
specified, the QEMU default path is used.")) specified, the QEMU default path is used."))
(define qemu-guest-agent-shepherd-service (define (qemu-guest-agent-shepherd-service config)
(match-lambda (let ((qemu (qemu-guest-agent-configuration-qemu config))
(($ <qemu-guest-agent-configuration> qemu device) (device (qemu-guest-agent-configuration-device config)))
(list (list
(shepherd-service (shepherd-service
(provision '(qemu-guest-agent)) (provision '(qemu-guest-agent))
(documentation "Run the QEMU guest agent.") (documentation "Run the QEMU guest agent.")
(start #~(make-forkexec-constructor (start #~(make-forkexec-constructor
`(,(string-append #$qemu "/bin/qemu-ga") "--daemon" `(,(string-append #$qemu "/bin/qemu-ga") "--daemon"
"--pidfile=/var/run/qemu-ga.pid" "--pidfile=/var/run/qemu-ga.pid"
"--statedir=/var/run" "--statedir=/var/run"
,@(if #$device ,@(if #$device
(list (string-append "--path=" #$device)) (list (string-append "--path=" #$device))
'())) '()))
#:pid-file "/var/run/qemu-ga.pid" #:pid-file "/var/run/qemu-ga.pid"
#:log-file "/var/log/qemu-ga.log")) #:log-file "/var/log/qemu-ga.log"))
(stop #~(make-kill-destructor))))))) (stop #~(make-kill-destructor))))))
(define qemu-guest-agent-service-type (define qemu-guest-agent-service-type
(service-type (service-type