emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#30505: closed (marionette/virtio-console issues le


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#30505: closed (marionette/virtio-console issues lead to test failures)
Date: Thu, 15 Mar 2018 10:42:02 +0000

Your message dated Thu, 15 Mar 2018 11:41:05 +0100
with message-id <address@hidden>
and subject line Re: bug#30505: Starting console/terminal Unicode support
has caused the debbugs.gnu.org bug report #30505,
regarding marionette/virtio-console issues lead to test failures
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
30505: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=30505
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: marionette/virtio-console issues lead to test failures Date: Sun, 18 Feb 2018 01:01:31 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
Hello,

On core-updates (or is it master now?), “make check-system TESTS=basic”
fails with:

--8<---------------cut here---------------start------------->8---
Test begin:
  test-name: "/run/current-system is a GC root"
  source-file: "/gnu/store/irm2375f5p7nzyqqllwjfaby3ywhi5wq-basic-builder"
  source-line: 2
  source-form: (test-eq "/run/current-system is a GC root" (quote success!) 
(marionette-eval (quote (begin (add-to-load-path 
"/gnu/store/pn333fnrdazadmzvkbyzby8cfr176yrh-guix-0.14.0-8.bc880f9/share/guile/site/2.2")
 (use-modules (srfi srfi-34) (guix store)) (let ((system (readlink 
"/run/current-system"))) (guard (c ((nix-protocol-error? c) (and (file-exists? 
system) (quote success!)))) (with-store store (delete-paths store (list 
system)) #f))))) marionette))
Test end:
  result-kind: fail
  actual-value: #{\x1b;%G\x1b;%G\x1b;%G\x1b;%G\x1b;%G\x1b;%Gsuccess!}#
  expected-value: success!
--8<---------------cut here---------------end--------------->8---

We see similar issues with other system tests.

The “\x1b;%G” sequences correspond to the “select UTF-8” console code
(see console_codes(4)).  We’re receiving this as if we were a console,
but in fact all we want is to exchange raw bytes between the host and
the guest; we don’t want to be a full-fledged console.

I thought that using virtserialport instead of virtio-console might help
(see patch below), but the problem persists.  I’m not sure if it’s the
kernel that decides to send these codes or what.  Also unclear as to why
this happens on ‘core-updates’ and not ‘master’.

What am I missing?

Ludo’.


diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm
index 7554a710a..173a67cef 100644
--- a/gnu/build/marionette.scm
+++ b/gnu/build/marionette.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -97,8 +97,11 @@ QEMU monitor and to the guest's backdoor REPL."
           "-monitor" (string-append "unix:" socket-directory "/monitor")
           "-chardev" (string-append "socket,id=repl,path=" socket-directory
                                     "/repl")
+
+          ;; See
+          ;; <http://www.linux-kvm.org/page/VMchannel_Requirements#Invocation>.
           "-device" "virtio-serial"
-          "-device" "virtconsole,chardev=repl"))
+          "-device" "virtserialport,chardev=repl,name=org.gnu.guix.port.0"))
 
   (define (accept* port)
     (match (select (list port) '() (list port) timeout)
diff --git a/gnu/tests.scm b/gnu/tests.scm
index 3e4c3d4e3..31249f0be 100644
--- a/gnu/tests.scm
+++ b/gnu/tests.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017 Ludovic Courtès <address@hidden>
+;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2017 Mathieu Othacehe <address@hidden>
 ;;; Copyright © 2017 Tobias Geerinckx-Rice <address@hidden>
 ;;;
@@ -69,7 +69,7 @@
   marionette-configuration make-marionette-configuration
   marionette-configuration?
   (device           marionette-configuration-device ;string
-                    (default "/dev/hvc0"))
+                    (default "/dev/virtio-ports/org.gnu.guix.port.0"))
   (imported-modules marionette-configuration-imported-modules
                     (default '()))
   (requirements     marionette-configuration-requirements ;list of symbols
@@ -87,17 +87,10 @@
 
             (modules '((ice-9 match)
                        (srfi srfi-9 gnu)
-                       (guix build syscalls)
                        (rnrs bytevectors)))
             (start
-             (with-imported-modules `((guix build syscalls)
-                                      ,@imported-modules)
+             (with-imported-modules imported-modules
                #~(lambda ()
-                   (define (clear-echo termios)
-                     (set-field termios (termios-local-flags)
-                                (logand (lognot (local-flags ECHO))
-                                        (termios-local-flags termios))))
-
                    (define (self-quoting? x)
                      (letrec-syntax ((one-of (syntax-rules ()
                                                ((_) #f)
@@ -112,20 +105,7 @@
                       (dynamic-wind
                         (const #t)
                         (lambda ()
-                          (let* ((repl    (open-file #$device "r+0"))
-                                 (termios (tcgetattr (fileno repl)))
-                                 (console (open-file "/dev/console" "r+0")))
-                            ;; Don't echo input back.
-                            (tcsetattr (fileno repl) (tcsetattr-action TCSANOW)
-                                       (clear-echo termios))
-
-                            ;; Redirect output to the console.
-                            (close-fdes 1)
-                            (close-fdes 2)
-                            (dup2 (fileno console) 1)
-                            (dup2 (fileno console) 2)
-                            (close-port console)
-
+                          (let ((repl (open-file #$device "r+0")))
                             (display 'ready repl)
                             (let loop ()
                               (newline repl)
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 1bc7a7027..64332000a 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -323,11 +323,6 @@ info --version")
             'success!
             (marionette-eval '(begin
                                 ;; Make sure the (guix …) modules are found.
-                                ;;
-                                ;; XXX: Currently shepherd and marionette run
-                                ;; on Guile 2.0 whereas Guix is on 2.2.  Yet
-                                ;; we should be able to load the 2.0 Scheme
-                                ;; files since it's pure Scheme.
                                 (add-to-load-path
                                  #+(file-append guix "/share/guile/site/2.2"))
 
@@ -337,9 +332,12 @@ info --version")
                                   (guard (c ((nix-protocol-error? c)
                                              (and (file-exists? system)
                                                   'success!)))
-                                    (with-store store
-                                      (delete-paths store (list system))
-                                      #f))))
+                                    (parameterize ((current-build-output-port
+                                                    (open-file "/dev/console"
+                                                               "r+0")))
+                                     (with-store store
+                                       (delete-paths store (list system))
+                                       #f)))))
                              marionette))
 
           ;; This symlink is currently unused, but better have it point to the

--- End Message ---
--- Begin Message --- Subject: Re: bug#30505: Starting console/terminal Unicode support Date: Thu, 15 Mar 2018 11:41:05 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)
Hello!

address@hidden (Ludovic Courtès) skribis:

> Danny Milosavljevic <address@hidden> skribis:

[...]

>> default_utf8 is a default, and it will be read only when defaulting, so
>> in this case it will be read when Linux is constructing a tty.
>>
>> %base-services contain both console-font-service and mingetty-service which
>> both access the ttys.  Linux VTs are created on demand.
>>
>> Once the VTs are created, us setting default_utf8 is too late.
>>
>> We should set default_utf8 before anyone touches tty[123456].
>>
>> Where will that be?
>>
>> Should we just set it in boot-system ? That's probably a nice way -
>> also since I think this setting is quite Linux-specific.
>
> Alternately we could introduce a ‘virtual-terminal’ service that every
> ‘term-*’ service would depend on.  That ‘virtual-terminal’ service would
> simply write “1” to /sys/…/default_utf8.

Done in bb3062ad6290223ea24144ca8aa1f4cddac8f9be.

Thanks!

Ludo’.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]