From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qBbBFs3aT2DYQgAA0tVLHw (envelope-from ) for ; Mon, 15 Mar 2021 22:08:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KNhbEs3aT2BBGAAAbx9fmQ (envelope-from ) for ; Mon, 15 Mar 2021 22:08:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D3F61E331 for ; Mon, 15 Mar 2021 23:08:12 +0100 (CET) Received: from localhost ([::1]:38674 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLvNk-0000NV-0b for larch@yhetil.org; Mon, 15 Mar 2021 18:08:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLvNb-0000MO-US for bug-guix@gnu.org; Mon, 15 Mar 2021 18:08:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54155) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLvNb-0007XQ-1j for bug-guix@gnu.org; Mon, 15 Mar 2021 18:08:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lLvNa-0002g8-U0 for bug-guix@gnu.org; Mon, 15 Mar 2021 18:08:02 -0400 Subject: bug#36117: qemu-binfmt with non-native chroot Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Date: Mon, 15 Mar 2021 22:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 36117 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Mail-Followup-To: 36117@debbugs.gnu.org, maxim.cournoyer@gmail.com, vagrant@debian.org Received: via spool by 36117-done@debbugs.gnu.org id=D36117.161584605610229 (code D ref 36117); Mon, 15 Mar 2021 22:08:02 +0000 Received: (at 36117-done) by debbugs.gnu.org; 15 Mar 2021 22:07:36 +0000 Received: from localhost ([127.0.0.1]:37461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLvN9-0002eu-PG for submit@debbugs.gnu.org; Mon, 15 Mar 2021 18:07:36 -0400 Received: from mail-qk1-f169.google.com ([209.85.222.169]:36194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lLvN7-0002eh-Uv for 36117-done@debbugs.gnu.org; Mon, 15 Mar 2021 18:07:34 -0400 Received: by mail-qk1-f169.google.com with SMTP id n79so33347094qke.3 for <36117-done@debbugs.gnu.org>; Mon, 15 Mar 2021 15:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=wdls19hmxPk4170NrZ8Xoa4WyGj0bGcQNXO9Cqq0sNY=; b=X3vZGhPc8CzYec0iwpijZJBgTVqzAS3ce0Rpd+eLqS9zXjagRrBQSraHzKX23EupIz 99I/GGVa4xeRZP2MVmlGhNaNKhm13NplTI8ICwK+xe9ivOlEKKHp77UwDX8Htob2bUZF LreUJpoG9sx1Rf9cNypg5YEsldyO8EQItJ/Vtg1rZfXD6dVrGcCH22mYmp8a7j0ypO0t Tc0faMHqow+S39wynrLS4FBBU9qPmTUxX42hJAq5J2u7AtveWSn90rw6TyZl5qbXioBL tJ8BBxVH+AdY7RsmvaK84Xv7U7lSdHLMO1nHvBJ7Grk20yp4poDw0GkLM1loK30XZGk6 tu7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=wdls19hmxPk4170NrZ8Xoa4WyGj0bGcQNXO9Cqq0sNY=; b=DeWQ/meeBh4aIpqEM46crHTE0gVahtmRr7+ziWVUAp0vXqOn2svX7vFHQpS/twJtZI DKHvTPyT+JafCUhD0rvENwGf0UueDgagwdwggbddxPgH6gE8xvGfkDsnbY47953xEIWy sUPSREi2Y1bTUx36Hl4QC0Y03hlCKtCso0j4J4TdGct+AHVkVdYLG4GJflbyfCrrh6or rrWHhN22liF3r+ZdN02dLPYiXdUC2PkS3Cc6SA1vdbrWjHapYeUMWZWDgDHbdGDupCt5 D9bJKOOuslF4tU2goMG63FaVBdk1x4hnd/mZMPyfk6FPelZZmKLRV3e8M0Mrp4BBmtE1 WKJw== X-Gm-Message-State: AOAM5339mc6JPgt3G2JMiH6PIOsr9+uXTw11kR6dEOtod/GE1Sk2E2AV 2SuxIbxbpi6D1ZFO6PfRuyee0meJf+jweyE6 X-Google-Smtp-Source: ABdhPJwN7HF9/gQ5zXiMVmom3v0Z3NIT5xd9o/+jDAG20ZueWttYa/NxeIr3KgC5yK4YHKKunnlALg== X-Received: by 2002:a05:620a:450f:: with SMTP id t15mr26817237qkp.323.1615846048350; Mon, 15 Mar 2021 15:07:28 -0700 (PDT) Received: from hurd (dsl-10-135-27.b2b2c.ca. [72.10.135.27]) by smtp.gmail.com with ESMTPSA id d68sm13365298qkf.93.2021.03.15.15.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 15:07:28 -0700 (PDT) From: Maxim Cournoyer References: <87k1dbb260.fsf@gnu.org> <20210222195006.11357-1-maxim.cournoyer@gmail.com> <20210222195006.11357-4-maxim.cournoyer@gmail.com> <87zgzv6uyp.fsf@gnu.org> <877dmv95v8.fsf@gmail.com> Date: Mon, 15 Mar 2021 18:07:27 -0400 In-Reply-To: <877dmv95v8.fsf@gmail.com> (Maxim Cournoyer's message of "Thu, 25 Feb 2021 16:47:55 -0500") Message-ID: <87eeggrrz4.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vagrant Cascadian , 36117-done@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615846093; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=wdls19hmxPk4170NrZ8Xoa4WyGj0bGcQNXO9Cqq0sNY=; b=hqGPnuPsewJ6oijqyiox1SHXvK+9ezAqha2AYttKNt6FXP/iRUFpk3eSBpspf2IZct73fC agyVLCiQGEaFhm+XRGq5MklCFGOXnzXYXh9xsOISPoU3fMgqHcfEYS6yO4ymJGFRb4L7Lr 7zh0BJYWQcA1sbzuQDPcC9xX2wUInhLpHmRCL3tOQ2vGMPe79edSWiRHXg6t0v3VXfuvVP CnEcNPZ6YJMSwG2nMm6HxXAeHryQcInEf8/8CPP7hKugsQV+3sKkEvoYyCfy/+eWyKBPa4 MY29Jmq2i6159xJwNid9yjJY7yRi4KiD28gBrHdWtWlk4+kgrQplXE44hl9Bzg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615846093; a=rsa-sha256; cv=none; b=q5+WKOqEhsliFrRMLIQE3TPVi2iWP03pJFTvSRfz6kl1tHui4zsbqQHl9sSfmodmMq+CTO IjgBf0FdUrHnYF6pRWPItRp7oGgf6eG74J9Jz+or8D0XtiH6EXirA/mmzvAytrH+VDHhJ4 Lf4iFBWo/895jafYI+F7VGA8y2Q08uD/hv80Iy/1XRg5llHSJmHxZmde3E+3fd0HduHVyu gcq4mNOoD7KwteUEnBYbnhqfsgMe5Cst5kTuni167ja96Ir/RDvabXzBCuhb6nngCT310Y RYMAVMj7fvtwDnyKcdGlnMSNNCrJSAFZzN2Th5WMnrd5vt5Qo/JtzWe2h1fWFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=X3vZGhPc; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=X3vZGhPc; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: D3F61E331 X-Spam-Score: -1.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: PmgbzgmEssa6 Hi, Maxim Cournoyer writes: > Hello again, > > Ludovic Court=C3=A8s writes: > > [...] > >>> ;; Platforms that QEMU can emulate. >>> -(define-record-type >>> - (qemu-platform name family magic mask) >>> +(define-record-type* >> >> Since this is for internal consumption, I=E2=80=99m in favor of keeping = plain >> =E2=80=98define-record-type=E2=80=99. Also, I don=E2=80=99t think the = =E2=80=9CF=E2=80=9D flag belongs here, >> it=E2=80=99s mostly orthogonal. > > Even though it's still internal for now, the intent here was to allow > the advanced users (those who would use (@@ ...) to access what they > need) to configure the qemu-platform objects should they have special > needs for it. > > I also don't think the flags belong to a qemu-platform object, but the > same can be said for the magic field. The most elegant thing would be > to have a binfmt_misc service which we would then extend for QEMU, but > that's more work and the use cases appear to be rare outside of QEMU (I > can only think of WINE). If you feel strongly about it I can revert > those hunks and hard-coded the F flag. > >>> (define qemu-binfmt-service-type >>> ;; TODO: Make a separate binfmt_misc service out of this? >>> (service-type (name 'qemu-binfmt) >>> @@ -800,9 +833,7 @@ given QEMU package." >>> (const >>> (list %binary-format-file-s= ystem))) >>> (service-extension shepherd-root-service-type >>> - qemu-binfmt-shepherd-service= s) >>> - (service-extension guix-service-type >>> - qemu-binfmt-guix-chroot))) >>> + qemu-binfmt-shepherd-service= s))) >> >> As discussed on IRC, the downside of this approach is increased disk and >> memory footprint (those big binaries have to be loaded in memory). > > The 'big' binaries are not that bigger than what we already have. For a > typical one: > > $ du -h {/gnu/store/7w04gv6m92n40dainn4s6xr3l20r90xw-qemu-5.1.0,\ > /gnu/store/wqh2dyskzkl4vjn6harclyl317h4vfaf-qemu-5.1.0-static}/bin/qemu= -arm > > 4.6M /gnu/store/7w04gv6m92n40dainn4s6xr3l20r90xw-qemu-5.1.0/bin/qemu-a= rm > 6.4M /gnu/store/wqh2dyskzkl4vjn6harclyl317h4vfaf-qemu-5.1.0-static/bin= /qemu-arm > > Only the registered QEMU architectures would be preloaded; so if you > enable 5, the increase it at worst ~ 30 MiB. Nothing too worrying on > machines that should be quite capable for transparent emulation > purposes, in my opinion. > >> One possibility would be to add an option to choose between this and the >> current approach, but maybe it=E2=80=99s not worth the maintenance troub= le. > > I would rather K.I.S.S., with this only case that works everywhere and > thus doesn't surprise anyone. > >> Thanks for fixing this issue! > > Thanks for the review! > > Maxim I went ahead and pushed this change to master alongside the update to QEMU 5.2.0. If there are improvements/changes to be made, we can pick it up from there! Closing, Maxim