GNU bug report logs - #48262
[PATCH version-1.3.0 0/3] Enable SPICE for the Guix VM image.

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Thu, 6 May 2021 17:25:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 48262 in the body.
You can then email your comments to 48262 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#48262; Package guix-patches. (Thu, 06 May 2021 17:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 06 May 2021 17:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: ludo <at> gnu.org, Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH version-1.3.0 0/3] Enable SPICE for the Guix VM image.
Date: Thu,  6 May 2021 13:23:55 -0400
These three patches enable the use of the SPICE protocol for the VM image,
which provides benefits such as dynamically resizing the display of
the guest, sharing the clip-board, smoother mouse support, etc.

To test, generate the image with something like:

$ image=$(./pre-inst-env guix system image -t qcow2 gnu/system/examples/vm-image.tmpl)
$ cp $image /tmp/vm-test.qcow2
$ chmod +w /tmp/vm-test.qcow2

Then launch a SPICE-capable solution such as GNOME Boxes, and enjoy!

I'd like to have these patches included in the RC2 that will go out later today.

Thanks,

Maxim Cournoyer (3):
  gnu: spice-vdagent: Update to 0.21.0 and enable GTK+ support.
  services: spice-vdagent: Clear the socket file prior to starting.
  gnu: system: Add SPICE capability to the VM image.

 gnu/packages/spice.scm            | 26 +++++++++++++++++++-------
 gnu/services/spice.scm            | 31 +++++++++++++++----------------
 gnu/system/examples/vm-image.tmpl | 11 ++++++++++-
 3 files changed, 44 insertions(+), 24 deletions(-)

-- 
2.31.1





Information forwarded to guix-patches <at> gnu.org:
bug#48262; Package guix-patches. (Thu, 06 May 2021 17:28:01 GMT) Full text and rfc822 format available.

Message #8 received at 48262 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 48262 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH version-1.3.0 1/3] gnu: spice-vdagent: Update to 0.21.0 and
 enable GTK+ support.
Date: Thu,  6 May 2021 13:27:30 -0400
* gnu/packages/spice.scm (spice-vdagent): Update to 0.21.0.
Remove trailing #t.
[make-flags]: New argument.
[phases]{fix-test-termination}: New phase.
[inputs]: Add gtk+.
[native-inputs]{procps}: New input.
---
 gnu/packages/spice.scm | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/spice.scm b/gnu/packages/spice.scm
index 92aeef7f79..0e47609b9e 100644
--- a/gnu/packages/spice.scm
+++ b/gnu/packages/spice.scm
@@ -261,7 +261,7 @@ Internet and from a wide variety of machine architectures.")
 (define-public spice-vdagent
   (package
     (name "spice-vdagent")
-    (version "0.20.0")
+    (version "0.21.0")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -269,11 +269,14 @@ Internet and from a wide variety of machine architectures.")
                 "spice-vdagent-" version ".tar.bz2"))
               (sha256
                (base32
-                "0n9k2kna2gd1zi6jv45zsp2jlv439nz5l5jjijirxqaycwi74srf"))))
+                "0n8jlc1pv6mkry161y656b1nk9hhhminjq6nymzmmyjl7k95ymzx"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
        '("--localstatedir=/var")
+       ;; The test-session-info test fails for unknown reasons (see:
+       ;; https://gitlab.freedesktop.org/spice/linux/vd_agent/-/issues/24).
+       #:make-flags '("XFAIL_TESTS=tests/test-session-info")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-makefile.in
@@ -281,19 +284,27 @@ Internet and from a wide variety of machine architectures.")
              (substitute* "Makefile.in"
                (((string-append "\\$\\(mkdir_p\\) \\$\\(DESTDIR\\)"
                                 "\\$\\(localstatedir\\)/run/spice-vdagentd"))
-                 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))
-             #t))
+                 "-$(mkdir_p) $(DESTDIR)$(localstatedir)/run/spice-vdagentd"))))
          (add-after 'unpack 'patch-spice-vdagent.desktop
            (lambda* (#:key outputs #:allow-other-keys)
             (substitute* "data/spice-vdagent.desktop"
               (("Exec=/usr/bin/spice-vdagent")
                (string-append "Exec=" (assoc-ref outputs "out")
-                              "/bin/spice-vdagent")))
-             #t)))))
+                              "/bin/spice-vdagent")))))
+         (add-after 'unpack 'fix-test-termination
+           (lambda _
+             ;; The termination tests depend on finding the socket file name
+             ;; in the spice-vdagent command line it launched, but by default
+             ;; ps truncates its output, which causes the test to fail (see:
+             ;; https://gitlab.freedesktop.org/spice/linux/vd_agent/-/merge_requests/36).
+             (substitute* "tests/test-termination.c"
+               (("ps -ef")
+                "ps -efww")))))))
     (inputs
       `(("alsa-lib" ,alsa-lib)
         ("dbus" ,dbus)
         ("glib" ,glib)
+        ("gtk+" ,gtk+)
         ("libdrm" ,libdrm)
         ("libpciaccess" ,libpciaccess)
         ("libx11" ,libx11)
@@ -303,7 +314,8 @@ Internet and from a wide variety of machine architectures.")
         ("libxrandr" ,libxrandr)
         ("spice-protocol" ,spice-protocol)))
     (native-inputs
-      `(("pkg-config" ,pkg-config)))
+     `(("pkg-config" ,pkg-config)
+       ("procps" ,procps)))             ;tests use 'ps'
     (synopsis "Spice agent for Linux")
     (description "Spice-vdagent enables sharing the clipboard and guest display
 resolution scaling on graphical console window resize.")
-- 
2.31.1





Information forwarded to guix-patches <at> gnu.org:
bug#48262; Package guix-patches. (Thu, 06 May 2021 17:29:02 GMT) Full text and rfc822 format available.

Message #11 received at 48262 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 48262 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH version-1.3.0 2/3] services: spice-vdagent: Clear the socket
 file prior to starting.
Date: Thu,  6 May 2021 13:27:31 -0400
This fixes the following issue where spice-vdagent would fail to start if the
spice-vdagent-sock socket file already existed:

  spice-vdagentd: Fatal could not create the server socket
  /run/spice-vdagentd/spice-vdagent-sock: Error binding to address: Address
  already in use

The requirement is also modified to depend on dbus-system, a cue taken from
upstream's own systemd service file (see 'data/spice-vdagentd.service' in the
sources).

* gnu/services/spice.scm (spice-vdagent-activation): Delete procedure.
(spice-vdagent-shepherd-service): Fix indentation.
[requirement]: Replace udev by dbus-system.
[start]: Ensure the spice-vdagentd run-time directory exists and that the
spice-vdagent-sock socket file does *not* exist before forking the daemon.
---
 gnu/services/spice.scm | 31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/gnu/services/spice.scm b/gnu/services/spice.scm
index a2aee4ab2a..3b88e29043 100644
--- a/gnu/services/spice.scm
+++ b/gnu/services/spice.scm
@@ -34,28 +34,29 @@
   (spice-vdagent spice-vdagent-configuration-spice-vdagent
                  (default spice-vdagent)))
 
-(define (spice-vdagent-activation config)
-  "Return the activation gexp for CONFIG."
-  #~(begin
-      (use-modules (guix build utils))
-      (mkdir-p "/run/spice-vdagentd")))
-
 (define (spice-vdagent-shepherd-service config)
   "Return a <shepherd-service> for spice-vdagentd with CONFIG."
   (define spice-vdagent (spice-vdagent-configuration-spice-vdagent config))
 
   (define spice-vdagentd-command
     (list
-      (file-append spice-vdagent "/sbin/spice-vdagentd")
-      "-x"))
+     (file-append spice-vdagent "/sbin/spice-vdagentd")
+     "-x"))
 
   (list
-    (shepherd-service
-      (documentation "Spice vdagentd service")
-      (requirement '(udev))
-      (provision '(spice-vdagentd))
-      (start #~(make-forkexec-constructor '#$spice-vdagentd-command))
-      (stop #~(make-kill-destructor)))))
+   (shepherd-service
+    (documentation "Spice vdagentd service")
+    (requirement '(dbus-system))
+    (provision '(spice-vdagentd))
+    (start #~(lambda args
+               ;; spice-vdagentd supports being activated upon the client
+               ;; connecting to its socket; when not using such feature, the
+               ;; socket should not exist before vdagentd creates it itself.
+               (mkdir-p "/run/spice-vdagentd")
+               (false-if-exception
+                (delete-file "/run/spice-vdagentd/spice-vdagent-sock"))
+               (fork+exec-command '#$spice-vdagentd-command)))
+    (stop #~(make-kill-destructor)))))
 
 (define spice-vdagent-profile
   (compose list spice-vdagent-configuration-spice-vdagent))
@@ -67,8 +68,6 @@
    (extensions
     (list (service-extension shepherd-root-service-type
                              spice-vdagent-shepherd-service)
-          (service-extension activation-service-type
-                             spice-vdagent-activation)
           (service-extension profile-service-type
                              spice-vdagent-profile)))))
 
-- 
2.31.1





Information forwarded to guix-patches <at> gnu.org:
bug#48262; Package guix-patches. (Thu, 06 May 2021 17:29:02 GMT) Full text and rfc822 format available.

Message #14 received at 48262 <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 48262 <at> debbugs.gnu.org
Cc: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: [PATCH version-1.3.0 3/3] gnu: system: Add SPICE capability to the VM
 image.
Date: Thu,  6 May 2021 13:27:32 -0400
* gnu/system/examples/vm-image.tmpl (services)
[spice-vdagent-service-type]: Add service.
[slim-service-type] <xorg-configuration>: Add the xf86-video-qxl module.
---
 gnu/system/examples/vm-image.tmpl | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl
index bcb2ba614c..1a2dfca452 100644
--- a/gnu/system/examples/vm-image.tmpl
+++ b/gnu/system/examples/vm-image.tmpl
@@ -5,7 +5,7 @@
 ;;
 
 (use-modules (gnu) (guix) (srfi srfi-1))
-(use-service-modules desktop networking ssh xorg)
+(use-service-modules desktop networking spice ssh xorg)
 (use-package-modules bootloaders certs fonts nvi
                      package-management wget xorg)
 
@@ -75,11 +75,20 @@ root ALL=(ALL) ALL
                            (default-user "guest")
                            (xorg-configuration
                             (xorg-configuration
+                             ;; The QXL virtual GPU driver is added to provide
+                             ;; a better SPICE experience.
+                             (modules (cons xf86-video-qxl
+                                            %default-xorg-modules))
                              (keyboard-layout keyboard-layout)))))
 
                  ;; Uncomment the line below to add an SSH server.
                  ;;(service openssh-service-type)
 
+                 ;; Add support for the SPICE protocol, which enables dynamic
+                 ;; resizing of the guest screen resolution, clipboard
+                 ;; integration with the host, etc.
+                 (service spice-vdagent-service-type)
+
                  ;; Use the DHCP client service rather than NetworkManager.
                  (service dhcp-client-service-type))
 
-- 
2.31.1





Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Fri, 07 May 2021 15:37:01 GMT) Full text and rfc822 format available.

Notification sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
bug acknowledged by developer. (Fri, 07 May 2021 15:37:02 GMT) Full text and rfc822 format available.

Message #19 received at 48262-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: 48262-done <at> debbugs.gnu.org
Subject: Re: [PATCH version-1.3.0 3/3] gnu: system: Add SPICE capability to
 the VM image.
Date: Fri, 07 May 2021 11:36:45 -0400
Hi,

Maxim Cournoyer <maxim.cournoyer <at> gmail.com> writes:

> * gnu/system/examples/vm-image.tmpl (services)
> [spice-vdagent-service-type]: Add service.
> [slim-service-type] <xorg-configuration>: Add the xf86-video-qxl module.
> ---
>  gnu/system/examples/vm-image.tmpl | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl
> index bcb2ba614c..1a2dfca452 100644
> --- a/gnu/system/examples/vm-image.tmpl
> +++ b/gnu/system/examples/vm-image.tmpl
> @@ -5,7 +5,7 @@
>  ;;
>  
>  (use-modules (gnu) (guix) (srfi srfi-1))
> -(use-service-modules desktop networking ssh xorg)
> +(use-service-modules desktop networking spice ssh xorg)
>  (use-package-modules bootloaders certs fonts nvi
>                       package-management wget xorg)
>  
> @@ -75,11 +75,20 @@ root ALL=(ALL) ALL
>                             (default-user "guest")
>                             (xorg-configuration
>                              (xorg-configuration
> +                             ;; The QXL virtual GPU driver is added to provide
> +                             ;; a better SPICE experience.
> +                             (modules (cons xf86-video-qxl
> +                                            %default-xorg-modules))
>                               (keyboard-layout keyboard-layout)))))
>  
>                   ;; Uncomment the line below to add an SSH server.
>                   ;;(service openssh-service-type)
>  
> +                 ;; Add support for the SPICE protocol, which enables dynamic
> +                 ;; resizing of the guest screen resolution, clipboard
> +                 ;; integration with the host, etc.
> +                 (service spice-vdagent-service-type)
> +
>                   ;; Use the DHCP client service rather than NetworkManager.
>                   (service dhcp-client-service-type))

I've now pushed this series to the version-1.3.0 branch.

Thank you,

Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 05 Jun 2021 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 323 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.