From nobody Wed Aug 26 17:55:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1779486876; cv=none; d=zohomail.com; s=zohoarc; b=GUoOd/ieZpPbltr8N6iUHhgf3cxFKgBosL45/9BsBQE8iESLEaVHmXxhERHmzy2OiK4ns1REoaCxmT7078WXuB5apHl4WDbLseu9LFJMx69lJ739q0goEmqE/UYBFgtItCotsgvDMgZ+Ny0XAGwd6zQYA7Y8nXkR4EhYEPdVrU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1779486876; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZaT8HCl5sMPJt98H2NkprOpKgSxDiq2cRQgyKrD0RAU=; b=IzJYVcp0Q3BOjfipk9O9IHImSU4pjE5hXagHNTx87flKkSuqnKG3uHlwKGuSwj9Jbf9jxJlx39YRE0GxcA4sTzqStw3TiyfQz98Iji/CbEh1O4fpMXcKUJz9IFdGZzJeBj5uMcezIVxzEHFvuQyB34OkSIveGhXFlif9h1WCJpk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1779486876726399.8188424579871; Fri, 22 May 2026 14:54:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wQXn6-0005DL-8y; Fri, 22 May 2026 17:52:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wQXn3-0004tH-Uq; Fri, 22 May 2026 17:52:21 -0400 Received: from isrv.corpit.ru ([212.248.84.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wQXn2-0004G0-7l; Fri, 22 May 2026 17:52:21 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 29B881AFB79; Sat, 23 May 2026 00:49:21 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 4EC1C3B71C8; Sat, 23 May 2026 00:49:25 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tls.msk.ru; s=202602; t=1779486561; bh=mGFrnJsQruWew9Mlige4612ivSGUgZqccxWubq5PBMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HDNG9lv/cFRW4Uwxl2BLj3TH1Ya3o6RdE7y4EJV/N2DPyy+aIciLgqZbfi+R5pWnS DhuhdN/51AGdW90nZa6sPsO7yJH/gzZ5gllAxgJJjPIdhcCt//aSO+aCwDwn+ITUWX ssIZ9xXEa4/c6Y0IMPI8bpiyA26NplVYXzJL9PLNvciIi5ycn0+I3bxYR2DyQPKIoU 7JvAoyeBfQn3fLoPPJXimkqs7c29tkeJLOcK7sQYZ/AKMg8rvA75QPAjq4s75iAjE8 6nR5KghE9H6NQHY/VehgJQoAQm8EYz3IM9rIb0hoMNSufW0DynSopSk1sjw53bxEyl P8JqU9o68EIzw== From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth , Michael Tokarev Subject: [Stable-10.2.3 131/149] tests/functional/qemu_test/asset.py: Don't use setxattr when it doesn't exist Date: Sat, 23 May 2026 00:49:03 +0300 Message-ID: <20260522214923.807017-32-mjt@tls.msk.ru> X-Mailer: git-send-email 2.47.3 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=212.248.84.144; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @tls.msk.ru) X-ZM-MESSAGEID: 1779486877788154100 From: Peter Maydell The Python os.setxattr() API is Linux-specific, so trying to use it on other OSes triggers a failure: File "/Users/pm215/src/qemu/tests/functional/qemu_test/asset.py", line 227, in fetch os.setxattr(str(tmp_cache_file), "user.qemu-asset-url", ^^^^^^^^^^^ AttributeError: module 'os' has no attribute 'setxattr' Since we only set the attributes here for informational purposes, skip them when os.setxattr() isn't available. Cc: qemu-stable@nongnu.org Fixes: 9903217a4ed013 ("tests/functional: add a module for handling asset d= ownload & caching") Signed-off-by: Peter Maydell Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Thomas Huth Message-id: 20260501115506.3792110-1-peter.maydell@linaro.org (cherry picked from commit 039b057c09c6a9742b91b8f29604651ba3fdb558) (Mjt: context fixup for 10.2.x) Signed-off-by: Michael Tokarev diff --git a/tests/functional/qemu_test/asset.py b/tests/functional/qemu_te= st/asset.py index bae40765ce..ef0dff921d 100644 --- a/tests/functional/qemu_test/asset.py +++ b/tests/functional/qemu_test/asset.py @@ -207,11 +207,14 @@ def fetch(self): raise AssetError(self, "Download retries exceeded", transient= =3DTrue) =20 try: - # Set these just for informational purposes - os.setxattr(str(tmp_cache_file), "user.qemu-asset-url", - self.url.encode('utf8')) - os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash", - self.hash.encode('utf8')) + # Set these just for informational purposes. Note that + # setxattr is Linux-only; as this is only informational + # we can simply skip it on other platforms. + if hasattr(os, "setxattr"): + os.setxattr(str(tmp_cache_file), "user.qemu-asset-url", + self.url.encode('utf8')) + os.setxattr(str(tmp_cache_file), "user.qemu-asset-hash", + self.hash.encode('utf8')) except Exception as e: self.log.debug("Unable to set xattr on %s: %s", tmp_cache_file= , e) =20 --=20 2.47.3