From fd74fe6325eb54a48e496b3afe5001005b15d802 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 28 Jul 2022 17:03:26 +0200 Subject: tests: Add qemu-guest-agent system test. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enable the QEMU guest agent interface in marionette VMs, run the qemu-guest-agent service in one and try talking to it. * gnu/build/marionette.scm (make-marionette): Enable the guest agent device. * gnu/tests/virtualization.scm (run-qemu-guest-agent-test): New procedure. (%test-qemu-guest-agent): New variable. Signed-off-by: Ludovic Courtès --- gnu/build/marionette.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnu/build') diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index 0d2af642c8..2b241d19e8 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -105,11 +105,14 @@ (define extra-options "-monitor" (string-append "unix:" socket-directory "/monitor") "-chardev" (string-append "socket,id=repl,path=" socket-directory "/repl") + "-chardev" (string-append "socket,id=qga,server=on,wait=off,path=" + socket-directory "/qemu-ga") ;; See ;; . "-device" "virtio-serial" - "-device" "virtserialport,chardev=repl,name=org.gnu.guix.port.0")) + "-device" "virtserialport,chardev=repl,name=org.gnu.guix.port.0" + "-device" "virtserialport,chardev=qga,name=org.qemu.guest_agent.0")) (define (accept* port) (match (select (list port) '() (list port) timeout) -- cgit v1.2.3 From 4b494878380920c8c7eecccd1f299164dd4a2c3f Mon Sep 17 00:00:00 2001 From: Oleg Pykhalov Date: Tue, 19 Jul 2022 19:40:28 +0300 Subject: gnu: system: file-systems: Add shared flag. * gnu/build/file-systems.scm (mount-flags->bit-mask, mount-file-system): Handle shared flag. * gnu/system/file-systems.scm (invalid-file-system-flags): Add shared to known flags. * guix/build/syscalls.scm (MS_SHARED): New variable. * doc/guix.texi (File Systems): Document shared flag. --- doc/guix.texi | 5 +++-- gnu/build/file-systems.scm | 6 ++++++ gnu/system/file-systems.scm | 4 +++- guix/build/syscalls.scm | 3 +++ 4 files changed, 15 insertions(+), 3 deletions(-) (limited to 'gnu/build') diff --git a/doc/guix.texi b/doc/guix.texi index eb3a1a4eb5..99321929cc 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16421,8 +16421,9 @@ include @code{read-only}, @code{bind-mount}, @code{no-dev} (disallow access to special files), @code{no-suid} (ignore setuid and setgid bits), @code{no-atime} (do not update file access times), @code{strict-atime} (update file access time), @code{lazy-time} (only -update time on the in-memory version of the file inode), and -@code{no-exec} (disallow program execution). +update time on the in-memory version of the file inode), +@code{no-exec} (disallow program execution), and @code{shared} (make the +mount shared). @xref{Mount-Unmount-Remount,,, libc, The GNU C Library Reference Manual}, for more information on these flags. diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 1d3b33e7bd..b9d46c9350 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm @@ -6,6 +6,7 @@ ;;; Copyright © 2019–2021 Tobias Geerinckx-Rice ;;; Copyright © 2019 David C. Trudgian ;;; Copyright © 2020 Maxim Cournoyer +;;; Copyright © 2022 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; @@ -1123,6 +1124,8 @@ (define (mount-flags->bit-mask flags) (logior MS_STRICTATIME (loop rest))) (('lazy-time rest ...) (logior MS_LAZYTIME (loop rest))) + (('shared rest ...) + (loop rest)) (() 0)))) @@ -1186,6 +1189,9 @@ (define (mount-nfs source mount-point type flags options) (cond ((string-prefix? "nfs" type) (mount-nfs source target type flags options)) + ((memq 'shared (file-system-flags fs)) + (mount source target type flags options) + (mount "none" target #f MS_SHARED)) (else (mount source target type flags options))) diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm index f8f4276283..464b76a2ca 100644 --- a/gnu/system/file-systems.scm +++ b/gnu/system/file-systems.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020, 2021 Maxim Cournoyer ;;; Copyright © 2021 Tobias Geerinckx-Rice +;;; Copyright © 2022 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; @@ -121,7 +122,8 @@ (define invalid-file-system-flags ;; Note: Keep in sync with 'mount-flags->bit-mask'. (let ((known-flags '(read-only bind-mount no-suid no-dev no-exec - no-atime strict-atime lazy-time))) + no-atime strict-atime lazy-time + shared))) (lambda (flags) "Return the subset of FLAGS that is invalid." (remove (cut memq <> known-flags) flags)))) diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm index a7401fd73f..eda487f52e 100644 --- a/guix/build/syscalls.scm +++ b/guix/build/syscalls.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; Copyright © 2021 Chris Marusich ;;; Copyright © 2021 Tobias Geerinckx-Rice +;;; Copyright © 2022 Oleg Pykhalov ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,6 +50,7 @@ (define-module (guix build syscalls) MS_RELATIME MS_BIND MS_MOVE + MS_SHARED MS_LAZYTIME MNT_FORCE MNT_DETACH @@ -537,6 +539,7 @@ (define MS_REMOUNT 32) (define MS_NOATIME 1024) (define MS_BIND 4096) (define MS_MOVE 8192) +(define MS_SHARED 1048576) (define MS_RELATIME 2097152) (define MS_STRICTATIME 16777216) (define MS_LAZYTIME 33554432) -- cgit v1.2.3 From ce53253d1f8ba70e4013b191481d84d413cca9c0 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 11 Aug 2022 11:38:55 -0400 Subject: build: marionette: Adjust QEMU Info manual reference. * gnu/build/marionette.scm (marionette-control): Update doc to correct the QEMU Info manual reference. --- gnu/build/marionette.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/build') diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm index 2b241d19e8..4f409166db 100644 --- a/gnu/build/marionette.scm +++ b/gnu/build/marionette.scm @@ -258,8 +258,8 @@ (define* (wait-for-unix-socket file-name marionette (define (marionette-control command marionette) "Run COMMAND in the QEMU monitor of MARIONETTE. COMMAND is a string such as -\"sendkey ctrl-alt-f1\" or \"screendump foo.ppm\" (info \"(qemu-doc) -pcsys_monitor\")." +\"sendkey ctrl-alt-f1\" or \"screendump foo.ppm\" (info \"(QEMU) QEMU +Monitor\")." (match marionette (($ _ _ monitor) (display command monitor) -- cgit v1.2.3