From nobody Tue Mar 3 04:51:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1771897282; cv=none; d=zohomail.com; s=zohoarc; b=SNJe1o4ndxCM7GeA1sg4/0dAXQZa9eLGGbSN9UN6vLfW4DlvrcwVtxS/naSAcg8Il4vBUfPklFivR1SfQuJ1PKd8CWs7wuoP53bseXIBpJjI/hEIIYQNLukFE2cs8dVeU2qHTf1g3L0UEPLm/hdnfVmGYlrmfOBPxzjwXR4LlU4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771897282; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=oUxzt0D58KzcA9Sg9+QabSYMjoX6Higtm9cWPnzSAPg=; b=m5O0vxaQ5bZLEIZYeMtsSa7mh5epfFGXxCLB7lWI6Atyib3CP1c59yFdvE+KA0lVr8xa/FMbDE5XJhE1+41b7wdp4i5nRe+nP4WkegVxxjU2wis4R6O1qSNQe9FtVoyeTkouXAr2bdNMsD//1D0HJeUjYthOnB6i2naAPkS0mqw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1771897282550905.353255062275; Mon, 23 Feb 2026 17:41:22 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id BB7B941BDD; Mon, 23 Feb 2026 20:41:22 -0500 (EST) Received: from [172.19.199.9] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id AE58741CCB; Mon, 23 Feb 2026 20:40:01 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 7042141C7F; Mon, 23 Feb 2026 20:39:57 -0500 (EST) Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 62C6941B54 for ; Mon, 23 Feb 2026 20:39:54 -0500 (EST) Received: by mail-vk1-f178.google.com with SMTP id 71dfb90a1353d-5663724e4daso4773836e0c.3 for ; Mon, 23 Feb 2026 17:39:54 -0800 (PST) Received: from localhost.localdomain ([2804:29b8:5090:5879:4cd3:397a:436f:4859]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-568f60e0419sm6863782e0c.5.2026.02.23.17.39.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 23 Feb 2026 17:39:52 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HELO_MISC_IP,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771897193; x=1772501993; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oUxzt0D58KzcA9Sg9+QabSYMjoX6Higtm9cWPnzSAPg=; b=DApO3hQTOuufOfSHnV1tRw7XYGmAIbbL+Wmd8dfh6Z82BfKl78AxiFLfpSIBG6YQEy 7rWeAlZlmNbV5mmFCkUHh2nGGYgeJhNajROZlxIV4t3VDFc+D4MAGGoZXagUcEIgZW8d r7cDen3jh1YJHZyI+RwM5BNx1munHjBqVZ6+1REAJqGIfWriE3h8HV82N+UFkQbrx5tg /Rn098YNDmHdO1y3eH2NjA447bLb3gKl6+kLmMyD+DvAAvD0xL1AI/dqXjaA+xjZqUKg 6BNfpSTqftxP7rRgGqlSnP8DqlY/Wf6YD+fwlpURQ3tVT9z/smzhve2Gy8C0/kTjnb5N kh2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771897193; x=1772501993; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=oUxzt0D58KzcA9Sg9+QabSYMjoX6Higtm9cWPnzSAPg=; b=k2IbHDg48X2GXWfIrOQ+I7Z3o7U05SIxiRdxBClUSH9fcMujG6lEIwfETs/DDVOtpf Cl1Uk2YsQKN1tXNxjyaIdoYljnYzBG67uwYbTDSCR1fy7AK5FyLVPJhGwbLiQ0OdY30r NsRfRwuqakF2WYePNnNcVNz0pB7d27SIR5wy+YRlX4wAhPjff1AdGfVdzs8h7efhWjgA zxc76yu85BoYzD/3OCt19B/rqrRbQx/veVIXaK7NECAYxCQVIGBworVp8d+Zr2ZobtXZ u+7PZuGHjHF0pdnNOOQSnTtVTRoZEamwtd2Ps9fuLbnI5vwAHuzPnqsrX8rMKVWquGXt asTg== X-Gm-Message-State: AOJu0YxWpHChAzYZXlhDLOFX77pdw//GXkTSJ8QVRk5krz1TXgdTB8JW +kBZ0tnr3th5zkjvFLeH+xvvQtf65BWBNoWfEjXVgaLyUETCfYwdkwS9P1t5ow== X-Gm-Gg: ATEYQzxr/M4n+TjbByV9NQaZQGFsUEw3tKO5gUik6hfkBgBezo1O15OWzXJ77vrhv+w gFGyoIc1nVAWtHzWP3hWeO7ePy/w01fJ6x2x2h0BxHOwgcE1F1/HEwKo/dEcCy90nXXuZC/Yp+a vxRPljDocnwUVirtV3YnlEQ9JnjSFnCfeAtRJ6OMgCoC7aTnddEOi6YFo1C1l+iB8gvWhVqcofB I1fbNVoT/8VCDSuCrRhxA5xZt72B9NZbYErY0MXdvuhTTyUbhACr7seMs5c6I9e5lKctbFOWQck lIVgkvPEsy/Q1/RBIn9oOJa9qkmOs5HgjLYCzn5o+mslERBCQI/1NGgN2LgpldeyCp8VeNE+v4p aq5zTi+pkxPl0Za9plWrfBVcRW5S+z0z8DDVAftB08SW5YhUraJSOI/utKhKsoUWi09CE1GrbaY ZMKsHLFnbud48HXZU8oX6knaxCZYC4/EkvsQDgpC20eMoYdwFOtAiEv/3fjdO4/ugq X-Received: by 2002:a05:6122:1d0f:b0:537:3e57:6bdc with SMTP id 71dfb90a1353d-568e48681efmr4618632e0c.12.1771897193429; Mon, 23 Feb 2026 17:39:53 -0800 (PST) From: Lucas Amaral To: devel@lists.libvirt.org Subject: [PATCH 1/2] storage: fix error code for async jobs check in pool operations Date: Mon, 23 Feb 2026 22:39:42 -0300 Message-ID: <20260224013943.37829-2-lucaaamaral@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260224013943.37829-1-lucaaamaral@gmail.com> References: <20260224013943.37829-1-lucaaamaral@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: EIO3RNQS2QQS7ZJLEHVZPNLWM4SS7GIA X-Message-ID-Hash: EIO3RNQS2QQS7ZJLEHVZPNLWM4SS7GIA X-MailFrom: lucaaamaral@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Lucas Amaral X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1771897284804158500 Content-Type: text/plain; charset="utf-8" storagePoolUndefine(), storagePoolDestroy(), storagePoolDelete(), and storagePoolRefresh() all report VIR_ERR_INTERNAL_ERROR when a pool has asynchronous jobs running. This error code implies a bug in libvirt, but the condition is a normal transient state that occurs during concurrent volume creation. Change the error code to VIR_ERR_OPERATION_INVALID, which is consistent with the adjacent checks for "pool is not active" and "pool is starting up" in the same functions. Signed-off-by: Lucas Amaral --- Build-tested on CentOS Stream 9 (297 OK, 0 failures). Validated by reproducing the async jobs error using LD_PRELOAD to inject a 15-second delay into fallocate64() for pool directory files (fallocate is instant on local filesystems, making the race window too narrow to hit otherwise). With this patch: Before: error: internal error: pool 'default' has asynchronous jobs running. After: error: Requested operation is not valid: pool 'default' has asynchronou= s jobs running. src/storage/storage_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index e19e032427..8f5c921157 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -868,7 +868,7 @@ storagePoolUndefine(virStoragePoolPtr pool) } =20 if (virStoragePoolObjGetAsyncjobs(obj) > 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_OPERATION_INVALID, _("pool '%1$s' has asynchronous jobs running."), def->name); goto cleanup; @@ -1089,7 +1089,7 @@ storagePoolDestroy(virStoragePoolPtr pool) } =20 if (virStoragePoolObjGetAsyncjobs(obj) > 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_OPERATION_INVALID, _("pool '%1$s' has asynchronous jobs running."), def->name); goto cleanup; @@ -1161,7 +1161,7 @@ storagePoolDelete(virStoragePoolPtr pool, } =20 if (virStoragePoolObjGetAsyncjobs(obj) > 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, + virReportError(VIR_ERR_OPERATION_INVALID, _("pool '%1$s' has asynchronous jobs running."), def->name); goto cleanup; --=20 2.52.0