From patchwork Tue Mar 19 15:18:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Z572 X-Patchwork-Id: 61987 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7F8CA27BBEB; Tue, 19 Mar 2024 15:19:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 14C7E27BBE2 for ; Tue, 19 Mar 2024 15:19:53 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmbFP-00034T-4B; Tue, 19 Mar 2024 11:19:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmbFM-00033M-AW for guix-patches@gnu.org; Tue, 19 Mar 2024 11:19:24 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rmbFM-0000Ms-25 for guix-patches@gnu.org; Tue, 19 Mar 2024 11:19:24 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rmbFy-0000ld-Qv for guix-patches@gnu.org; Tue, 19 Mar 2024 11:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69899] [PATCH 7/7] vm: If not the same local architecture, don't enable kvm. Resent-From: Zheng Junjie Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Mar 2024 15:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69899 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69899@debbugs.gnu.org Received: via spool by 69899-submit@debbugs.gnu.org id=B69899.17108615852763 (code B ref 69899); Tue, 19 Mar 2024 15:20:02 +0000 Received: (at 69899) by debbugs.gnu.org; 19 Mar 2024 15:19:45 +0000 Received: from localhost ([127.0.0.1]:51124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmbFg-0000iG-Td for submit@debbugs.gnu.org; Tue, 19 Mar 2024 11:19:45 -0400 Received: from smtp84.cstnet.cn ([159.226.251.84]:51188 helo=cstnet.cn) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmbFa-0000gF-3r for 69899@debbugs.gnu.org; Tue, 19 Mar 2024 11:19:42 -0400 Received: from m.taildaf0f.ts.net (unknown [183.247.5.22]) by APP-05 (Coremail) with SMTP id zQCowAAnLLzZrPlljqBBBw--.46102S8; Tue, 19 Mar 2024 23:18:52 +0800 (CST) From: Zheng Junjie Date: Tue, 19 Mar 2024 23:18:41 +0800 Message-ID: <94accdc1b6c6b86766117e8bf1720f79e33ad2aa.1710861023.git.zhengjunjie@iscas.ac.cn> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: zQCowAAnLLzZrPlljqBBBw--.46102S8 X-Coremail-Antispam: 1UD129KBjvJXoW7CFyUCFyfXw17Cw17tFyUGFg_yoW8Gw15p3 ZIk3WYkr1rGrZFg3WvgFn7Zr9IgwnYk34Uu3yxZw4xZwn8trykKr1Syr13CFWUZFWxCr1D ZFW09ryUZr45Ar7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9Ib7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI 8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_JFI_Gr1l8cAvFVAK0II2c7xJM28C jxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI 8IcVCY1x0267AKxVWUJVW8JwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280 aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzV Aqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S 6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI48JMxC20s026x CaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_ JrWlx4CE17CEb7AF67AKxVWUJVWUXwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r 1I6r4UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_ Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8Jb IYCTnIWIevJa73UjIFyTuYvjxUgeHqDUUUU X-Originating-IP: [183.247.5.22] X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/ X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/system/vm.scm (common-qemu-options): Add target keyword. Change-Id: Ic9bf18cf60ac5ce623289df31ea050a22c6e604e --- gnu/system/vm.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 64cc321ebf..7d9d07ebb7 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -210,7 +210,9 @@ (define* (virtualized-operating-system os virtual-file-systems))))) (define* (common-qemu-options image shared-fs - #:key rw-image?) + #:key + rw-image? + (target (%current-target-system))) "Return the a string-value gexp with the common QEMU options to boot IMAGE, with '-virtfs' options for the host file systems listed in SHARED-FS." @@ -221,7 +223,7 @@ (define* (common-qemu-options image shared-fs #~(;; Only enable kvm if we see /dev/kvm exists. ;; This allows users without hardware virtualization to still use these ;; commands. - #$@(if (file-exists? "/dev/kvm") + #$@(if (and (not target) (file-exists? "/dev/kvm")) '("-enable-kvm") '()) @@ -302,7 +304,8 @@ (define* (system-qemu-image/shared-store-script os #$@(common-qemu-options (if volatile? base-image rw-image) (map file-system-mapping-source (cons %store-mapping mappings)) - #:rw-image? (not volatile?)) + #:rw-image? (not volatile?) + #:target target) "-m " (number->string #$memory-size) #$@options))