From nobody Mon Feb 9 14:51:48 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=fail; 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1738081847192259.01962641241005; Tue, 28 Jan 2025 08:30:47 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id E1B42180F; Tue, 28 Jan 2025 11:30:46 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1AA841B76; Tue, 28 Jan 2025 11:28:43 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id C8B2F1859; Tue, 28 Jan 2025 11:28:38 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 69AA3187C for ; Tue, 28 Jan 2025 11:28:31 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-336-R10AmYIiPsKhyPt4duGmzQ-1; Tue, 28 Jan 2025 11:28:29 -0500 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E1AB418018A5 for ; Tue, 28 Jan 2025 16:28:28 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.2]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1C99219560BC for ; Tue, 28 Jan 2025 16:28:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738081711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iLacrI0FjFsUIKLM+MwYd+fkSiNxlBGi7m+vIXSjmoQ=; b=iiM9E50dOsB4YGyyhwJpcsjTqn5F4cexXZaHjVBrbuncxRsejz+t1wDBHNyjgpD2Zp5uVj rempLralNG9sjdpTnbmdWEpl9dncZQpoempJXKezfYIr7CmqWjSBC2113C1Jp3C+NEFhKu tHU7rWXDRwpKRG5SexcHUbQonlfOJf4= X-MC-Unique: R10AmYIiPsKhyPt4duGmzQ-1 X-Mimecast-MFC-AGG-ID: R10AmYIiPsKhyPt4duGmzQ From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH v2 05/15] qemuProcessHandleIOError: Prefer lookup by node name Date: Tue, 28 Jan 2025 17:28:09 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: vkjyOo7C-LYOU4vivrKU9u48IHcuNFF_35KlJWILIDs_1738081709 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LWV5YMJOLVHHERQCKZTNDU2VC4B2Y2S6 X-Message-ID-Hash: LWV5YMJOLVHHERQCKZTNDU2VC4B2Y2S6 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1738081848370019000 Content-Type: text/plain; charset="utf-8" When qemu reports a node name for an I/O error we should prefer the lookup by node name instead as it gives us the path to the specific image which caused the error instead of the top level image path. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_process.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 80a73643f0..1849f68634 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -837,22 +837,26 @@ qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUS= ED, const char *eventPath =3D ""; const char *eventAlias =3D ""; const char *eventReason =3D ""; - virDomainDiskDef *disk; + virDomainDiskDef *disk =3D NULL; + virStorageSource *src =3D NULL; virObjectLock(vm); priv =3D QEMU_DOMAIN_PRIVATE(vm); - if (device) + if (nodename) + disk =3D qemuDomainDiskLookupByNodename(vm->def, priv->backup, nod= ename, &src); + + if (!disk) disk =3D qemuProcessFindDomainDiskByAliasOrQOM(vm, device, NULL); - else if (nodename) - disk =3D qemuDomainDiskLookupByNodename(vm->def, NULL, nodename, N= ULL); - else - disk =3D NULL; - if (disk) { - eventPath =3D virDomainDiskGetSource(disk); + if (!src && disk) + src =3D disk->src; + + if (disk) eventAlias =3D disk->info.alias; - } + + if (src && src->path) + eventPath =3D src->path; if (nospace) eventReason =3D "enospc"; --=20 2.48.1