From nobody Mon Feb 9 05:07:58 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=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1750167968; cv=none; d=zohomail.com; s=zohoarc; b=j/r3VKqBZ09b4y9gSz97URZWiVGotK1ZagvLcmIouUWkdnGWcGrsuB2EFWLN6Tr307oPv7woP6H0tbBxVmxxVoomF3vFkcMmzbTAv8wpihps1Ysy7v9z9OnRSxhuYAIgZ1qS26HIcb+FSQo/FFdjdP92M3lpx4r6bzow/RQZl3o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1750167968; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=X15toOm88aOIVzWCwasY/Zu5jBEDlxepk8PF6IWDP5k=; b=FrO4RinHMCHaoF8YIZPncoArFrVFgjeeZJ28iNna5j8RcQgoDYAPczVilYGpTn3oNlGHgbORZc3dqUqShqWr/7urZM08Oor5Y1bHcxkbVp0xnK1flWms+Kry1MbPr5x3RChq9P3coD8vMY0jmjBDvW5Sr/vgimONuGx+ZDvG9CI= ARC-Authentication-Results: i=1; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1750167968775309.91702914222094; Tue, 17 Jun 2025 06:46:08 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BD40FC2F; Tue, 17 Jun 2025 09:46:07 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4B380DDF; Tue, 17 Jun 2025 09:44:26 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 2740BBD7; Tue, 17 Jun 2025 09:44:21 -0400 (EDT) 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 99528E73 for ; Tue, 17 Jun 2025 09:44:11 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-164-IwiJ52EHPNWnzNdkSOiaYA-1; Tue, 17 Jun 2025 09:44:09 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C0D1F1956089 for ; Tue, 17 Jun 2025 13:44:08 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.10]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0254C1800288 for ; Tue, 17 Jun 2025 13:44:07 +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, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE 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=1750167851; 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=sblHfjOaOQLZ/JJyzW1tDWixl0hzyPNnZsfokEgznwI=; b=Stxqj6AxQ+sbH4hSEjKxtxTHvTIFCeE4huQz2yrp1utynq4jW/IeAeEUh6fPdsdfoxtbgw zIGJ93GfY5BooW2h+BTuLRJ6OFWhV4Kr2CqSVS3cNQkS1aQhxKELxfYYiuLHTJCDYnLbyc uW/BIlwYnAsNhFw1cNl0ByoLFFGvpcI= X-MC-Unique: IwiJ52EHPNWnzNdkSOiaYA-1 X-Mimecast-MFC-AGG-ID: IwiJ52EHPNWnzNdkSOiaYA_1750167848 To: devel@lists.libvirt.org Subject: [PATCH 5/6] storage: disk: Properly handle partition numbers separated by 'p' Date: Tue, 17 Jun 2025 15:43:58 +0200 Message-ID: <4ead169268cd492679f24908ce852ba0f7b726f3.1750167757.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: sUKteGc9KO8QDWtuzjacfs-guCQBjEQxhWD_xT55NvY_1750167848 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NYJSIPDATQOPB53MRGIR6DMFLK3QMXCV X-Message-ID-Hash: NYJSIPDATQOPB53MRGIR6DMFLK3QMXCV 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: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1750167969716116600 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The 'p' separator for partitions is now common also for NVMe devices. Fix the algorithm to extract the partition number to always consider it. The fix is based on suggestion in the issue mentioned below. Closes: https://gitlab.com/libvirt/libvirt/-/issues/239 Signed-off-by: Peter Krempa --- src/storage/storage_backend_disk.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backe= nd_disk.c index 996395de4a..871226ee22 100644 --- a/src/storage/storage_backend_disk.c +++ b/src/storage/storage_backend_disk.c @@ -805,7 +805,6 @@ virStorageBackendDiskDeleteVol(virStoragePoolObj *pool, virStoragePoolDef *def =3D virStoragePoolObjGetDef(pool); char *src_path =3D def->source.devices[0].path; g_autofree char *srcname =3D g_path_get_basename(src_path); - bool isDevMapperDevice; g_autofree char *devpath =3D NULL; g_autoptr(virCommand) cmd =3D NULL; @@ -822,8 +821,7 @@ virStorageBackendDiskDeleteVol(virStoragePoolObj *pool, * (parthelper.c) that is used to generate the target.path name * for use by libvirt. Changes to either, need to be reflected * in both places */ - isDevMapperDevice =3D virIsDevMapperDevice(vol->target.path); - if (isDevMapperDevice) { + if (virIsDevMapperDevice(vol->target.path)) { dev_name =3D g_path_get_basename(vol->target.path); } else { if (virFileResolveLink(vol->target.path, &devpath) < 0) { @@ -846,9 +844,8 @@ virStorageBackendDiskDeleteVol(virStoragePoolObj *pool, part_num =3D dev_name + strlen(srcname); - /* For device mapper and we have a partition character 'p' as the - * current character, let's move beyond that before checking part_num = */ - if (isDevMapperDevice && *part_num =3D=3D 'p') + /* Check if partition character 'p' is present and move beyond it */ + if (*part_num =3D=3D 'p' && g_ascii_isdigit(*(part_num + 1))) part_num++; if (*part_num =3D=3D 0) { --=20 2.49.0