From nobody Fri Apr 26 12:53:33 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=1605616212; cv=none; d=zohomail.com; s=zohoarc; b=oGBwt4gV9YSzcjgi4iaDuXGFTGH6McVsNScfbz+XuMJhJrQahSGxX0raD3D/G/Rh0IT3f8LuVJnWD7QsAhUsQO9WdgaIMe72WZb7/hzdXyMLEy+ZXsSKo03Nhe+0aduOk1Y3oeibWuX1HyCaH2r2tejod6WA7nmj3tuKfOmeCZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605616212; 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=IK22ZHhaTLU1jyf/2/b6IKIYPLA0Mf6/wEc3xSgiJCw=; b=gNMCjxkh9OuReIxY7am88v1tPUIte8qvw6vZ91ssQzl6IxIFQVJ9et0sXzapuXYXnBuHkp2euuXjpu+/GFf6tksEkcB1Qeb6j5WLRBHN6ZWOMd9ck8vhj+LI16tjfgu0jZa0vO0VpCYM7JbPYNSPL8vzGXGAYTGTIKlcLH3WuP8= 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) header.from= 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 1605616212835837.9453235770374; Tue, 17 Nov 2020 04:30:12 -0800 (PST) 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-523-XXCVUG5_MwiCVQd8fyoupQ-1; Tue, 17 Nov 2020 07:30:09 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F48810B9CA5; Tue, 17 Nov 2020 12:30:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6931210013BD; Tue, 17 Nov 2020 12:30:00 +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 9A95B18095FF; Tue, 17 Nov 2020 12:29:56 +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 0AHCTsTk001913 for ; Tue, 17 Nov 2020 07:29:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2C9B910013C4; Tue, 17 Nov 2020 12:29:54 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id A022710013BD for ; Tue, 17 Nov 2020 12:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605616211; 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=IK22ZHhaTLU1jyf/2/b6IKIYPLA0Mf6/wEc3xSgiJCw=; b=CYEFolyIx5VLAKx9vBuHykpsV757IvHgAyOICl4pORdV5mQldoZJ0Y1Uw95O9kkL5JrgVY wxd/OmM8ozY3PH3GTOCw4t8Olmf54rjiWdBmIXH46Lyx+iPzCLZIQgD2DPCmWpTZyZoOM5 vmZDvDS6A9l9gHX3XDbHcq4E3VjRtjU= X-MC-Unique: XXCVUG5_MwiCVQd8fyoupQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] node_device: Use "udev" monitor source Date: Tue, 17 Nov 2020 13:29:47 +0100 Message-Id: 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.84 on 10.5.11.22 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) Content-Type: text/plain; charset="utf-8" In v6.3.0-rc1~67 I've made a switch: instead of listening on udev events the nodedev driver started listening for kernel events. This was because when a device changes its name (e.g. NICs) we will get "move" event with DEVPATH_OLD property set, which we can then use to remove the old device and thus keep our internal list up to date. The switch to "kernel" source was made because if the old NICs naming (eth0, eth1, ...) is enabled (e.g. via net.ifnames=3D0 on the kernel cmd line) then udev overwrites the property with the new name making our internal list go out of sync. Interestingly, when the od NICs naming is not enabled then the DEVPATH_OLD contains the correct value. But as it turns out, "kernel" source might be missing some other important properties, e.g. USB vendor/product IDs. Therefore, switch back to "udev" source and wish the best of luck to users using the old NICs naming. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1897625 Fixes: 9a13704818e4a018723e0ec5b9e97b176f1c8584 Signed-off-by: Michal Privoznik Reviewed-by: Daniel P. Berrang=C3=A9 --- src/node_device/node_device_udev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index 65f312d8f4..dec19a3166 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1983,7 +1983,7 @@ nodeStateInitialize(bool privileged, =20 virObjectLock(priv); =20 - priv->udev_monitor =3D udev_monitor_new_from_netlink(udev, "kernel"); + priv->udev_monitor =3D udev_monitor_new_from_netlink(udev, "udev"); if (!priv->udev_monitor) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("udev_monitor_new_from_netlink returned NULL")); --=20 2.26.2