From nobody Mon Apr 29 11:40:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1625598345; cv=none; d=zohomail.com; s=zohoarc; b=H4Zl6a1iA6wsyPyaVq2XHp/7y7YpePxmH6QQsMii6bdab56cxNvqc5HcBC7JWhUtDd80+L+tXimS0aJFEEsust3G3vI9u7PhC4NUg6hx2YUV21bHm7GzWtsk7YbXTXN+P1bkhHzrwIMH/ZEosiGAatRl21MgbRz/x2prSo7slDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625598345; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=LbpxKDnUgiESL8Azqf6XQoBnCuRjSn5PkxTw3Q6Lk+I=; b=L3MLOO6NyJNBNAGr9wreL9VwwH1aa2RHE5Fboa+s6a0xyMhx+fLdBb2kJ0d1Q3AOTUwXMJrgIPis985/hTVSBal02lNtJNBeQx+yIfEbHS3bzTxP0eZVSrLMkWEHnMMe2jl79Hg6kIlTRRUeW6t3t3A7tRx7uYKElJCAhstgwts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 16255983457791016.3941611299089; Tue, 6 Jul 2021 12:05:45 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-225-vbCPDw83NyOrL7AC-dIpfg-1; Tue, 06 Jul 2021 15:05:43 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01E538015C6; Tue, 6 Jul 2021 19:05:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 66C2B60C05; Tue, 6 Jul 2021 19:05:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9D4F74A702; Tue, 6 Jul 2021 19:05:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 166J5Lnw004667 for ; Tue, 6 Jul 2021 15:05:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id CBD58100EBAF; Tue, 6 Jul 2021 19:05:21 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-112-216.phx2.redhat.com [10.3.112.216]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87DA610023AB for ; Tue, 6 Jul 2021 19:05:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1625598344; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=LbpxKDnUgiESL8Azqf6XQoBnCuRjSn5PkxTw3Q6Lk+I=; b=hP0S1onf+0vVTDbOdWuYtYyseOYXl5JaGiGQJ60yUSI3vG52W4aK5XV44BA1HCxX53atVS YC9AwQUsLQC0QF9cm3STS6GpOm/J7a9Vvy2agu751+OJUTvHX/sKPJiSenALPFMLGEXdKb 78GbYdpt3w5Lkjj6ufO8HcTQFYeeDas= X-MC-Unique: vbCPDw83NyOrL7AC-dIpfg-1 From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH] nodedev: Handle inactive mdevs with the same UUID Date: Tue, 6 Jul 2021 14:05:17 -0500 Message-Id: <20210706190517.1604513-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1625598347397100001 Content-Type: text/plain; charset="utf-8" Unfortunately, mdevctl supports defining more than one mdev with the same UUID as long as they have different parent devices. So we can't use the UUID alone as a way to uniquely identify these node devices. Append the parent name to ensure uniqueness. For example: Before: mdev_88a6b868_46bd_4015_8e5b_26107f82da38 After: mdev_88a6b868_46bd_4015_8e5b_26107f82da38_0000_00_02_0 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1979440 Signed-off-by: Jonathon Jongsma --- QUESTION: Is there any expectation of stability in these device names? I'm = not sure to what extent these changes might affect users. Given that support for persistent mdevs is fairly new, there are likely not many users yet. src/node_device/node_device_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_de= vice_driver.c index b4dd57e5f4..89dc704162 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -1038,7 +1038,7 @@ nodeDeviceGetMdevctlListCommand(bool defined, =20 static void mdevGenerateDeviceName(virNodeDeviceDef *dev) { - nodeDeviceGenerateName(dev, "mdev", dev->caps->data.mdev.uuid, NULL); + nodeDeviceGenerateName(dev, "mdev", dev->caps->data.mdev.uuid, dev->pa= rent); } =20 =20 --=20 2.31.1