From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id dfJKBsTv+V/kHgAA0tVLHw (envelope-from ) for ; Sat, 09 Jan 2021 18:02:44 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2HubAcTv+V92KwAAB5/wlQ (envelope-from ) for ; Sat, 09 Jan 2021 18:02:44 +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 6AF359403A4 for ; Sat, 9 Jan 2021 18:02:43 +0000 (UTC) Received: from localhost ([::1]:56754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyIZV-0001Fo-Qh for larch@yhetil.org; Sat, 09 Jan 2021 13:02:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:47728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyIYt-0001Fh-F0 for bug-guix@gnu.org; Sat, 09 Jan 2021 13:02:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:41043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kyIYs-0007ID-FP for bug-guix@gnu.org; Sat, 09 Jan 2021 13:02:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kyIYs-0003zi-CW for bug-guix@gnu.org; Sat, 09 Jan 2021 13:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#45716: gnu: qemu: Fix ioclt(=?UTF-8?Q?=E2=80=A6, ?= SIOCGIFCONF, =?UTF-8?Q?=E2=80=A6?=) for emulated 64 bit architectures. Resent-From: Stefan Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 09 Jan 2021 18:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45716 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Danny Milosavljevic Received: via spool by 45716-submit@debbugs.gnu.org id=B45716.161021530915318 (code B ref 45716); Sat, 09 Jan 2021 18:02:02 +0000 Received: (at 45716) by debbugs.gnu.org; 9 Jan 2021 18:01:49 +0000 Received: from localhost ([127.0.0.1]:52589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyIYf-0003yz-D2 for submit@debbugs.gnu.org; Sat, 09 Jan 2021 13:01:49 -0500 Received: from smtpout2.vodafonemail.de ([145.253.239.133]:47312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kyIYa-0003ya-1T for 45716@debbugs.gnu.org; Sat, 09 Jan 2021 13:01:47 -0500 Received: from smtp.vodafone.de (unknown [10.2.0.35]) by smtpout2.vodafonemail.de (Postfix) with ESMTP id 9EDEA123D5D; Sat, 9 Jan 2021 19:01:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vodafonemail.de; s=vfde-smtpout-mb-15sep; t=1610215297; bh=ZQbCkhMMgd2pE5113y3hfcqpUn3rqaVP/BBbgnifx4k=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=H9KEWYYbCR9hYJScSSwJwlmRnrIwPtdiTkjU1E4Q7CFVoXXP+swFhKvse17deAK4H O8/Q9cBClL13zvKz1mcviQajc0GZKpKljwBRlDRFCJTJuMESduhsB3kpToK1mRC5Dc ue7f4ombQaf5vD7haLiWRp+dhDicjCyfmtXsameg= Received: from macbook-pro.kuh-wiese.my-router.de (dslb-002-206-141-230.002.206.pools.vodafone-ip.de [2.206.141.230]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 5F2AF14024E; Sat, 9 Jan 2021 18:01:37 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) From: Stefan In-Reply-To: <18056543-1468-4B69-BFA8-F28CCA234168@vodafonemail.de> Date: Sat, 9 Jan 2021 19:01:39 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <4928FA00-C99D-4C66-877E-308D0B8F3228@vodafonemail.de> References: <19CC6F6C-98CA-4218-A9E7-FE7AC751E924@vodafonemail.de> <5A46F4E0-9823-4614-A7BC-865F9D7C0FB7@vodafonemail.de> <20210108040445.1444c372@scratchpost.org> <18056543-1468-4B69-BFA8-F28CCA234168@vodafonemail.de> X-Mailer: Apple Mail (2.3124) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 2430 X-purgate-ID: 155817::1610215297-0000239E-006B97E0/0/0 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: 45716@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -0.85 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=vodafonemail.de header.s=vfde-smtpout-mb-15sep header.b=H9KEWYYb; dmarc=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: 6AF359403A4 X-Spam-Score: -0.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: aOWaefe+00JS * gnu/packages/virtualization.scm (qemu): Add a snippet to fix a bug in = the do_ioctl_ifconf() function of qemu to make ioclt(=E2=80=A6, SIOCGIFCONF, = =E2=80=A6) work for emulated 64 bit architectures. The sizeof(struct ifreq) is 40 for 64 bit and 32 for 32 bit = architectures. This structure contains a union of other structures, of which struct = ifmap is the biggest for 64 bit architectures. Calling ioclt(=E2=80=A6, = SIOCGIFCONF, =E2=80=A6) fills a struct sockaddr of that union, and do_ioctl_ifconf() only = considered that struct sockaddr for the size of the union, which has the same size = as struct ifmap on 32 bit architectures. So do_ioctl_ifconf() assumed a = wrong size of 32 for struct ifreq instead of the correct size of 40 on 64 bit architectures. The fix makes do_ioctl_ifconf() handle struct ifmap as the biggest part = of the union, treating struct ifreq with the correct size. This fixes (@ (guix build syscalls) network-interface-names) when used = in emulated 64 bit architectures. --- gnu/packages/virtualization.scm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gnu/packages/virtualization.scm = b/gnu/packages/virtualization.scm index 10eae8ea7d..f82a19ecf3 100644 --- a/gnu/packages/virtualization.scm +++ b/gnu/packages/virtualization.scm @@ -140,7 +140,17 @@ (sha256 (base32 = "1rd41wwlvp0vpialjp2czs6i3lsc338xc72l3zkbb7ixjfslw5y9")) - (patches (search-patches = "qemu-build-info-manual.patch")))) + (patches (search-patches "qemu-build-info-manual.patch")) + (modules '((guix build utils))) + (snippet + '(begin + (substitute* '("linux-user/syscall.c") + (("^([[:blank:]]*)const argtype ifreq_arg_type.*$" = line indent) + (string-append line indent + "const argtype ifreq_max_type[] =3D = { MK_STRUCT(STRUCT_ifmap_ifreq) };\n")) + (("^([[:blank:]]*)target_ifreq_size[[:blank:]]=3D.*$"= _ indent) + (string-append indent "target_ifreq_size =3D = thunk_type_size(ifreq_max_type, 0);"))) + #t)))) (outputs '("out" "doc")) ;4.7 MiB of HTML docs (build-system gnu-build-system) (arguments --=20 2.29.2