bug#37860: [PATCH v2] gnu: qemu: Add upstream patch for failing test.

2019-11-08 Thread Miguel Arruga Vivas
Hi,

They have solved the problem on qemu's master branch, as the author
kindly told me[1], so I propose this patch to add their patch on top
of our current version.  I've tested it on x86_64, WDYT?

Happy hacking!
Miguel

[1]
https://lists.nongnu.org/archive/html/qemu-devel/2019-11/msg00340.html
From b91245b18c4e66f05ea9dbc37e62be64ae3bbf07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
 
Date: Fri, 8 Nov 2019 02:13:38 +0100
Subject: [PATCH] gnu: qemu: Add upstream patch for failing test.

* gnu/packages/virtualization.scm (qemu)[patches]: Add upstream patch
to fix tests on linux-libre >= 5.3.
---
 gnu/packages/virtualization.scm | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index f113eee5f7..afe88e16ea 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -114,7 +114,16 @@
  version ".tar.xz"))
  (sha256
   (base32
-   "1ih9v6gxgild3m4g80ld4dr3wp9db3bpy203k73fxgc9hqhn0vk5"
+   "1ih9v6gxgild3m4g80ld4dr3wp9db3bpy203k73fxgc9hqhn0vk5"))
+ (patches
+  (list
+   ;; XXX: Patch from master branch, to be removed with next
+   ;; upstream release.
+   (qemu-patch
+"bf9e0313c27d8e6ecd7f7de3d63e1cb25d8f6311"
+"qemu-tests-make-filemonitor-test-more-robust.patch"
+(base32
+ "1242wqpr8id3cn88pzbig3sqh4znml0g0h2mwdmdyhp81blq7s7n"))
 (build-system gnu-build-system)
 (arguments
  '(;; Running tests in parallel can occasionally lead to failures, like:
-- 
2.23.0



bug#36634: Virtual Machine Manager (virt-manager)

2019-11-07 Thread Miguel Arruga Vivas
Hi Chris,

Chris Marusich  writes:
> With the patch you submitted upstream (not the patches you attached to
> your previous email here), I can confirm the issue is fixed for me,
> and that I do NOT observe the errors you mentioned above.

Sorry, I did not send the email here.

> I see the patch was incorporated into Guix master in commit
> aa1f0896fb15a0bdcc5474839c8afdbb2520d603.  That is good, and I think
> this issue can be resolved.  If nobody follows up in a few days' time,
> let's close the bug report.

I created 38032 on guix-patches and Ludo’ applied them.

> Regarding your other patch in this thread to find the "ip" program at
> run-time, could you open a new bug report or patch (via
> guix-patc...@gnu.org) for that?

It was included in that patchset and it was unrelated, yes.  On
master it's commit 2dfb9ba406.

> It seems unrelated to the issue at hand.

I've been using the patches now on master this week and I have a really
annoying problem: the mouse is drawn on top of the vm screen.  This
one is unrelated too, so I should open a new bug, maybe to
virt-manager...

> Thank you for your help,

Thank you too, as you reported upstream and provided a great test
environment, which will help them to test my solution or find better
ones. :)

Happy hacking!
Miguel





bug#37860: qemu-4.1.0 build failure

2019-11-02 Thread Miguel Arruga Vivas
Hi Danny,

Danny Milosavljevic  wrote:
> On Mon, 21 Oct 2019 23:39:32 +0200
> Danny Milosavljevic  wrote:
> 
> > ERROR:tests/test-util-filemonitor.c:665:test_file_monitor_events:
> > assertion failed: (err == 0) ERROR - Bail out!
> > ERROR:tests/test-util-filemonitor.c:665:test_file_monitor_events:
> > assertion failed: (err == 0)
> > 
> > Four times in a row now.  
> 
> guix commit 05b0b050bce644d96edb7d88414f50bb23d9

I've hit the same error five times in a row too.  The test seems to
depend on the order of notifications between two inotify queues (one
open on the folder and the other one open on the file name).  I don't
know any easy way to fix it, so I propose to comment it out before
check phase as in the attached patch.  What do you think?

Happy hacking!
Miguel
From 53b06fdf0ff5fb343ae5548ff816d0f6fa455b96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
 
Date: Sun, 3 Nov 2019 00:51:08 +0100
Subject: [PATCH] gnu: qemu: Comment out failing test.

* gnu/packages/virtualization.scm (qemu)[disable-unusable-tests]: Comment
out test-util-filemonitor from check phase.
---
 gnu/packages/virtualization.scm | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/gnu/packages/virtualization.scm b/gnu/packages/virtualization.scm
index c2f46985f0..3183916174 100644
--- a/gnu/packages/virtualization.scm
+++ b/gnu/packages/virtualization.scm
@@ -196,6 +196,12 @@ exec smbd $@")))
;; fails within the build environment.
(("check-unit-.* tests/test-char" all)
 (string-append "# " all)))
+ (substitute* "tests/Makefile.include"
+   ;; Comment out the test-util-filemonitor test, as it depends
+   ;; on a specific order of notification between two
+   ;; qemu_file_monitor queues.
+   (("check-unit-.* tests/test-util-filemonitor" all)
+(string-append "# " all)))
  #t)
 (inputs   ; TODO: Add optional inputs.
  `(("alsa-lib" ,alsa-lib)
-- 
2.23.0



bug#36634: Virtual Machine Manager (virt-manager)

2019-10-27 Thread Miguel Arruga Vivas
Hello again,

The two patches attached create the cgroup directory needed and remove
the warning for the ip binary missing.  Still the following errors
are emitted to the log. 

8<---
error : virConnectGetCPUModelNames:1109 : this function is not supported by the 
connection driver: virConnectGetCPUModelNames
error : virConnectGetAllDomainStats:11705 : this function is not supported by 
the connection driver: virConnectGetAllDomainStats
error : virCgroupSetValueRaw:473 : Unable to write to 
'/sys/fs/cgroup/unified/machine/qemu-1-Guix.libvirt-qemu/tasks': No such file 
or directory
error : virCgroupRemoveRecursively:2383 : Unable to remove 
/sys/fs/cgroup/unified/machine/qemu-1-Guix.libvirt-qemu/ (16) 
>8---

The last two may indicate there may be lurking another bug in the
cgroups configuration, but at least the machines can be created and
started/stopped seamlessly.  What do you think?

Happy hacking!
Miguel
>From a5dd055ea0fc20420cca6df2d38302596d397c49 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
 
Date: Sun, 27 Oct 2019 03:56:17 +0100
Subject: [PATCH 1/2] services: libvirtd: Create required control groups.

* gnu/services/virtualization.scm (libvirt-shepherd-service)
[libvirtd-activation]: New shepherd service.
[libvirtd]: Add a requirement of the new service.
---
 gnu/services/virtualization.scm | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index bc8ac9b40a..2f26945efd 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -428,8 +428,19 @@ potential infinite waits blocking libvirt."))
   (let* ((config-file (libvirt-conf-file config))
  (libvirt (libvirt-configuration-libvirt config)))
 (list (shepherd-service
+   ;; See https://libvirt.org/cgroups.html#currentLayoutGeneric
+   (documentation "Create the cgroup hierarchy required by libvirt.")
+   (provision '(libvirtd-activation))
+   (requirement '(file-system-/sys/fs/cgroup))
+   (one-shot? #t)
+   (start #~(lambda args
+  (let ((path "/sys/fs/cgroup/unified/machine"))
+(or (access? path F_OK) (mkdir path)
+   (stop #~(lambda args #t)))
+  (shepherd-service
(documentation "Run the libvirt daemon.")
(provision '(libvirtd))
+   (requirement '(libvirtd-activation))
(start #~(make-forkexec-constructor
  (list (string-append #$libvirt "/sbin/libvirtd")
"-f" #$config-file)
-- 
2.23.0

>From 24f7c06a47562f410ceb982a3b2a0d44980de392 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
 
Date: Sun, 27 Oct 2019 03:59:23 +0100
Subject: [PATCH 2/2] services: libvirtd: Provide ip binary at runtime.

* gnu/services/virtualization.scm (libvirt-shepherd-service): Add sbin to
the PATH variable, as ip binary is installed there.
---
 gnu/services/virtualization.scm | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index 2f26945efd..488cd63041 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -444,9 +444,11 @@ potential infinite waits blocking libvirt."))
(start #~(make-forkexec-constructor
  (list (string-append #$libvirt "/sbin/libvirtd")
"-f" #$config-file)
+ ;; For finding qemu and ip binaries.
  #:environment-variables
- ;; For finding qemu binaries.
- '("PATH=/run/current-system/profile/bin")))
+ (list (string-append
+"PATH=/run/current-system/profile/bin:"
+"/run/current-system/profile/sbin"
(stop #~(make-kill-destructor))
 
 (define libvirt-service-type
-- 
2.23.0



bug#37851: Grub installation only checks for encrypted /boot folder

2019-10-26 Thread Miguel Arruga Vivas
Hi Ludo’,

El Tue, 22 Oct 2019 16:12:49 +0200
Ludovic Courtès  escribió:
> Hola Miguel,
> 
> Miguel Arruga Vivas  skribis:
> > (...)
> > +cryptomount -a  
> 
> Does that cause GRUB to mount all the LUKS partitions it was aware of
> at installation time, or does it cause it to scan all the partitions
> in search of a LUKS signature?

That patch is the first one, it mounts everything it can find, unlike
this one.

The only option I've seen was to modify boot-parameters (as in #35394,
wink wink nudge nudge) in order to store the needed partitions.  I've
reduced it this time to one patch, is it somehow easier to read this
way?  I could split it in two stages (one add the boot-parameters
field, the other one to make use of it) or squash the three for the
other feature into one if that easier for the review.  The main issues
I've found is that the source of the device-mappings needed for boot up
has to be declared by the UUID to ensure they are not system
dependent.  Also, the warning is shown several times and the message
isn't quite good, any idea how to fix/improve this?

Happy hacking!
Miguel
From f6438d1175a1d60d842ab502255a7685b05f4e7d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
 
Date: Sun, 27 Oct 2019 01:35:59 +0200
Subject: [PATCH] system: Use of mapped-devices for boot process.

* gnu/bootloader/depthcharge.scm (depthcharge-configuration-file): New
parameter crypto-devices, not used.
* gnu/bootloader/extlinux.scm (extlinux-configuration-file): Likewise.
* gnu/bootloader/grub.scm (grub-configuration-file)[declaration]: New
parameter crypto-devices, used to ensure unlock every encrypted
partition needed by the bootloader.
[device-uuid->gexp]: New function, emits cryptomount calls.
[body]: Map crypto-devices with device-uuid->gexp.
* gnu/machine/ssh.scm (roll-back-managed-host): Use the crypto-devices
stored from the selected generation in the call to the bootloader
configuration generator.
* gnu/scripts/system.scm (reinstall-bootloader): Likewise.
* gnu/system.scm (define-module)[export]: Export new accessor
boot-parameters-crypto-devices.
(boot-parameters)[crypto-devices]: New field.
(read-boot-parameters)[uuid-sexp->uuid]: New function.
(read-boot-parameters)[body]: Read new field crypto-devices.
(operating-system-boot-parameters-file): Add the new field.
(operating-system-boot-crypto-devices): New function.  Warn about
devices without an UUID.  They are ignored as they would be dependant
on the hardware configuration.
(operating-system-bootcfg): Use operating-system-boot-crypto-devices in
the call to the bootloader configuration generator.
(operating-system-boot-parameters): Use
operating-system-boot-crypto-devices to store the needed devices.
---
 gnu/bootloader/depthcharge.scm |  1 +
 gnu/bootloader/extlinux.scm|  1 +
 gnu/bootloader/grub.scm| 14 
 gnu/machine/ssh.scm|  3 +++
 gnu/system.scm | 40 ++
 guix/scripts/system.scm|  2 ++
 6 files changed, 61 insertions(+)

diff --git a/gnu/bootloader/depthcharge.scm b/gnu/bootloader/depthcharge.scm
index 58cc3f3932..fe4302e93c 100644
--- a/gnu/bootloader/depthcharge.scm
+++ b/gnu/bootloader/depthcharge.scm
@@ -82,6 +82,7 @@
 (define* (depthcharge-configuration-file config entries
  #:key
  (system (%current-system))
+ (crypto-devices '())
  (old-entries '()))
   (match entries
 ((entry)
diff --git a/gnu/bootloader/extlinux.scm b/gnu/bootloader/extlinux.scm
index 40108584a8..3defeab3dd 100644
--- a/gnu/bootloader/extlinux.scm
+++ b/gnu/bootloader/extlinux.scm
@@ -28,6 +28,7 @@
 (define* (extlinux-configuration-file config entries
   #:key
   (system (%current-system))
+  (crypto-devices '())
   (old-entries '()))
   "Return the U-Boot configuration file corresponding to CONFIG, a
  object, and where the store is available at STORE-FS, a
diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index d984d5f5e3..8b5cf848af 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2016 Chris Marusich 
 ;;; Copyright © 2017 Leo Famulari 
 ;;; Copyright © 2017 Mathieu Othacehe 
+;;; Copyright © 2019 Miguel Ángel Arruga Vivas 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -316,6 +317,7 @@ code."
 (define* (grub-configuration-file config entries
   #:key
   (system (%current-system))
+  (crypto-devices '())
   (old-entries '()))
   "Return the GRUB configuration file corresponding to CONFIG, 

bug#37363: emacs and other programs do not display special characters

2019-10-21 Thread Miguel Arruga Vivas
I'm running on guix and spanish symbols work properly, on emacs and the
terminal.

---
miguel@unfall ~/src/gnu/guix$ locale
LANG=es_ES.utf8
LC_CTYPE="es_ES.utf8"
LC_NUMERIC="es_ES.utf8"
LC_TIME="es_ES.utf8"
LC_COLLATE="es_ES.utf8"
LC_MONETARY="es_ES.utf8"
LC_MESSAGES="es_ES.utf8"
LC_PAPER="es_ES.utf8"
LC_NAME="es_ES.utf8"
LC_ADDRESS="es_ES.utf8"
LC_TELEPHONE="es_ES.utf8"
LC_MEASUREMENT="es_ES.utf8"
LC_IDENTIFICATION="es_ES.utf8"
LC_ALL=
---

I've seen some es_EC localizations instead of es_ES, could
you check that's not your issue?

Best regards,
Miguel





bug#37851:

2019-10-21 Thread Miguel Arruga Vivas
merge 25305 37851
quit





bug#36634: Virtual Machine Manager (virt-manager)

2019-10-21 Thread Miguel Arruga Vivas
Hi,

This bug can be easier to fix than we thought. :-D

As a workaround, you only have to execute:

$ sudo mkdir /sys/fs/cgroup/unified/{machine,system,user}

The folders should be created at libvirtd start, probably manually with
some extra cgroup magic that I don't understand yet, but this works
well and new machines can be created.  I'll take a look this week into
the libvirtd service if nobody takes it first, as this is quite trivial.

Best regards,
Miguel





bug#37851: Grub installation only checks for encrypted /boot folder

2019-10-21 Thread Miguel Arruga Vivas
Hi again,

Attached can be found a workaround to mount all encrypted partitions.
There is no way to tell the devices to mount without changing
boot-parameters, where I'd add another field with the needed mapped
devices (a traversal onto the mapped-device dependency tree
of /gnu/store).  Do you think this is a good idea?  At least I think
it's the best way to encode the dependencies into the grub.cfg file,
even though the typical graph will contain 0 or 1 nodes.

Ideas?

Best regards,
Miguel
>From 9b50e2d8eb8b744595a54a9543993eb4e3813742 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
 
Date: Mon, 21 Oct 2019 14:35:02 +0200
Subject: [PATCH] system: Mount luks devices on boot.

* gnu/bootloader/grub.scm (grub-configuration-file)[builder]: Mount all
encrypted partitions.
---
 gnu/bootloader/grub.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index d984d5f5e3..b29477ec71 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -369,6 +369,7 @@ keymap ~a~%" keymap)
   (format port
   "# This file was generated from your Guix configuration.  Any changes
 # will be lost upon reconfiguration.
+cryptomount -a
 ")
   #$sugar
   #$keyboard-layout-config
-- 
2.23.0



bug#37851: Grub installation only checks for encrypted /boot folder

2019-10-21 Thread Miguel Arruga Vivas
Hi,

The following configuration results in an unbootable system.  The
root partition must be manually mounted with cryptomount in order to
boot the system.

The core issue is that grub unencrypts automatically, as
GRUB_ENABLE_CRYPTODISK=y was provided during installation, the /boot
partition, but not the partition which contains /gnu/store.

Happy hacking!
Miguel

 config.scm 
;; 
(operating-system
  ;; ...
  (bootloader
(bootloader-configuration
  (bootloader grub-bootloader)
  (target "/dev/sda")))
  (mapped-devices
(list (mapped-device
(source (uuid "uuid root device"))
(target "root")
(type luks-device-mapping))
  (mapped-device
(source (uuid "uuid boot device"))
(target "boot")
(type luks-device-mapping
  (file-systems
(cons* (file-system
 (mount-point "/")
 (device "/dev/mapper/root")
 (type "btrfs")
 (dependencies mapped-devices))
   (file-system
 (mount-point "/boot")
 (device "/dev/mapper/boot")
 (type "ext4")
 (dependencies mapped-devices))
   %base-file-systems)))
 config.scm