diff mbox

[5/5] services: Add spice vdagent service.

Message ID 20160802134531.19272-5-david@craven.ch
State New
Headers show

Commit Message

David Craven Aug. 2, 2016, 1:45 p.m. UTC
* gnu/services/spice.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* doc/guix.texi (Various Services): New node.
---
 doc/guix.texi          | 12 ++++++++
 gnu/local.mk           |  1 +
 gnu/services/spice.scm | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+)
 create mode 100644 gnu/services/spice.scm

Comments

David Craven Aug. 5, 2016, 2:33 p.m. UTC | #1
No comment means these patches are ok to merge?
Andreas Enge Aug. 5, 2016, 6:12 p.m. UTC | #2
On Fri, Aug 05, 2016 at 04:33:03PM +0200, David Craven wrote:
> No comment means these patches are ok to merge?

Or that nobody looked at them? :-)
Unfortunately I have no service expertise; hopefully someone else
can have a look at this.

Andreas
Leo Famulari Aug. 5, 2016, 6:24 p.m. UTC | #3
On Fri, Aug 05, 2016 at 08:12:29PM +0200, Andreas Enge wrote:
> On Fri, Aug 05, 2016 at 04:33:03PM +0200, David Craven wrote:
> > No comment means these patches are ok to merge?
> 
> Or that nobody looked at them? :-)
> Unfortunately I have no service expertise; hopefully someone else
> can have a look at this.

Likewise.
David Craven Aug. 5, 2016, 6:28 p.m. UTC | #4
Ludo looked at them and asked me to resubmit, it's mainly adding the
documentation and splitting a commit into two...
Leo Famulari Aug. 5, 2016, 6:38 p.m. UTC | #5
On Fri, Aug 05, 2016 at 08:28:35PM +0200, David Craven wrote:
> Ludo looked at them and asked me to resubmit, it's mainly adding the
> documentation and splitting a commit into two...

Okay, then I think it's good.

To follow-up on my last comment, I believe that qemu-minimal is used to
build GuixSD VMs and disk images. So, that's the context in which to
decide whether qemu-minimal needs spice / virglrenderer support.
David Craven Aug. 5, 2016, 6:51 p.m. UTC | #6
> To follow-up on my last comment, I believe that qemu-minimal is used to
> build GuixSD VMs and disk images. So, that's the context in which to
> decide whether qemu-minimal needs spice / virglrenderer support.

I'll add spice and virglrenderer to the list of deleted packages for
qemu-minimal and rebuild qemu-minimal

Remove the @node from the documentation commits and amend the commit
messages (for some reason @node breaks make because of some warning,
but doesn't complaing when running make pdf, which I used to test)

And I'll cherry-pick the commit that adds downloads.kde.org to the
mirror list based on our discussion.

And if there aren't any further comments I'll push this tonight.
Ricardo Wurmus Aug. 6, 2016, 7 a.m. UTC | #7
David Craven <david@craven.ch> writes:

> No comment means these patches are ok to merge?

Usually we ask for about one week to pass before merging without
comment.  Otherwise there’s just not enough time for reviewers to look
over the patches.

~~ Ricardo
David Craven Aug. 6, 2016, 9:01 a.m. UTC | #8
> Usually we ask for about one week to pass before merging without
> comment.  Otherwise there’s just not enough time for reviewers to look
> over the patches.

Thank you for the information!

In case you are referring to the 'enable spice in qemu patch', it was first
submitted 2016/07/29. But I should have tested it on all platforms we
support.

Ludo already reviewed the spice-vdagent-service and I thought
that the changes he wanted me to make were minor corrections.

I guess I am trigger happy, if there is a trigger somewhere I'll pull
it =P

David
diff mbox

Patch

diff --git a/doc/guix.texi b/doc/guix.texi
index 1622d71..eb87dde 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9921,6 +9921,18 @@  Finally, @var{extra-options} is a list of additional command-line options
 passed to @command{lircd}.
 @end deffn
 
+@cindex spice
+@node Spice Service
+@subsubheading Spice Service
+
+The @code{(gnu services spice)} module provides the following service.
+
+@deffn {Scheme Procedure} spice-vdagent-service [#:spice-vdagent]
+Returns a service that runs @url{http://www.spice-space.org,VDAGENT}, a daemon
+that enables sharing the clipboard with a vm and setting the guest display
+resolution when the graphical console window resizes.
+@end deffn
+
 @subsubsection Dictionary Services
 The @code{(gnu services dict)} module provides the following service:
 
diff --git a/gnu/local.mk b/gnu/local.mk
index f94b123..306cf72 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -385,6 +385,7 @@  GNU_SYSTEM_MODULES =				\
   %D%/services/networking.scm			\
   %D%/services/shepherd.scm			\
   %D%/services/herd.scm				\
+  %D%/services/spice.scm				\
   %D%/services/ssh.scm				\
   %D%/services/web.scm				\
   %D%/services/xorg.scm				\
diff --git a/gnu/services/spice.scm b/gnu/services/spice.scm
new file mode 100644
index 0000000..26f072e
--- /dev/null
+++ b/gnu/services/spice.scm
@@ -0,0 +1,75 @@ 
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2016 David Craven <david@craven.ch>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu services spice)
+  #:use-module (gnu packages spice)
+  #:use-module (gnu services)
+  #:use-module (gnu services shepherd)
+  #:use-module (guix gexp)
+  #:use-module (guix records)
+  #:export (spice-vdagent-configuration
+            spice-vdagent-configuration?
+            spice-vdagent-service-type
+            spice-vdagent-service))
+
+(define-record-type* <spice-vdagent-configuration>
+  spice-vdagent-configuration make-spice-vdagent-configuration
+  spice-vdagent-configuration?
+  (spice-vdagent spice-vdagent-configuration-spice-vdagent
+                 (default spice-vdagent)))
+
+(define (spice-vdagent-activation config)
+  "Return the activation gexp for CONFIG."
+  #~(mkdir-p "/var/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
+      #~(string-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)))))
+
+(define spice-vdagent-profile
+  (compose list spice-vdagent-configuration-spice-vdagent))
+
+(define spice-vdagent-service-type
+  (service-type (name 'spice-vdagent)
+    (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)))))
+
+(define* (spice-vdagent-service
+          #:optional (config (spice-vdagent-configuration)))
+  "Start the @command{vdagentd} and @command{vdagent} deamons
+from @var{spice-vdagent} to enable guest window resizing and
+clipboard sharing."
+  (service spice-vdagent-service-type config))