From nobody Sun Feb 8 09:27:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 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=1558086945; cv=none; d=zoho.com; s=zohoarc; b=Kik/riZzO+wdI/WqOVUKFOKY6p9Z+BaWCctNbpTptKnHCK2VcTj8bTxQkLGWIX7PyPneHDlz1jk7P5gjTK22rTpwA7B5SysnDq6QLBttp3OWLLKCdc/BYqu1ERE4kFtcztCR8eWQjqG3/OlznLMaO8GtbbBlO3ppFS9vN38TV0c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558086945; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=9A68kp02CZQNISlgyvmYUCO1vJTsGPE7Wt05Vdaj7SQ=; b=ltkmj5GY08R+viaH2NbY83xd+FUJmoe9O/uMp/Bed5M9Z5RNUHkmPC9rKmrXRWaONHeNiv4k/FVC/2tOtN/lt8ZLaoYufWYSeaJE82d4q5rhC5hZaXO+gpKaAZkwUg5UJs32HemA4sTg2u5sBpekHHhCSCHoi9lzzXWIlGHWLgM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1558086945405486.31344172992726; Fri, 17 May 2019 02:55:45 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 724957EBD3; Fri, 17 May 2019 09:55:43 +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 4D92D5D9DC; Fri, 17 May 2019 09:55:43 +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 1171C1806B13; Fri, 17 May 2019 09:55:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x4H9sgld017704 for ; Fri, 17 May 2019 05:54:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7AD1D5D707; Fri, 17 May 2019 09:54:42 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04CB95D6A9 for ; Fri, 17 May 2019 09:54:41 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 17 May 2019 11:54:16 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/4] m4: Provide default value fore UDEVADM 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 17 May 2019 09:55:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1710575 It may happen that the system where libvirt is built at doesn't have udevadm binary but the one where it runs does have it. If we change how udevadm is ran in virWaitForDevices() then we can safely pass a default value in m4 macro. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- m4/virt-external-programs.m4 | 9 +++------ src/util/virutil.c | 14 ++++++-------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/m4/virt-external-programs.m4 b/m4/virt-external-programs.m4 index 3c915e1a65..f1ae104b32 100644 --- a/m4/virt-external-programs.m4 +++ b/m4/virt-external-programs.m4 @@ -45,7 +45,7 @@ AC_DEFUN([LIBVIRT_CHECK_EXTERNAL_PROGRAMS], [ AC_PATH_PROG([DNSMASQ], [dnsmasq], [dnsmasq], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([RADVD], [radvd], [radvd], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([TC], [tc], [tc], [$LIBVIRT_SBIN_PATH]) - AC_PATH_PROG([UDEVADM], [udevadm], [], [$LIBVIRT_SBIN_PATH]) + AC_PATH_PROG([UDEVADM], [udevadm], [udevadm], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([MODPROBE], [modprobe], [modprobe], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([RMMOD], [rmmod], [rmmod], [$LIBVIRT_SBIN_PATH]) AC_PATH_PROG([MMCTL], [mm-ctl], [mm-ctl], [$LIBVIRT_SBIN_PATH]) @@ -65,11 +65,8 @@ AC_DEFUN([LIBVIRT_CHECK_EXTERNAL_PROGRAMS], [ [Location or name of the mm-ctl program]) AC_DEFINE_UNQUOTED([OVSVSCTL], ["$OVSVSCTL"], [Location or name of the ovs-vsctl program]) - - if test -n "$UDEVADM"; then - AC_DEFINE_UNQUOTED([UDEVADM], ["$UDEVADM"], - [Location or name of the udevadm program]) - fi + AC_DEFINE_UNQUOTED([UDEVADM], ["$UDEVADM"], + [Location or name of the udevadm program]) if test -n "$MODPROBE"; then AC_DEFINE_UNQUOTED([MODPROBE], ["$MODPROBE"], [Location or name of the modprobe program]) diff --git a/src/util/virutil.c b/src/util/virutil.c index ecef24d2f3..2db0e9769c 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -1479,25 +1479,23 @@ virSetUIDGIDWithCaps(uid_t uid, gid_t gid, gid_t *g= roups, int ngroups, #endif =20 =20 -#if defined(UDEVADM) void virWaitForDevices(void) { - const char *const settleprog[] =3D { UDEVADM, "settle", NULL }; + VIR_AUTOPTR(virCommand) cmd =3D NULL; + VIR_AUTOFREE(char *) udev =3D NULL; int exitstatus; =20 - if (access(settleprog[0], X_OK) !=3D 0) + if (!(udev =3D virFindFileInPath(UDEVADM)) || + !virFileIsExecutable(udev) || + !(cmd =3D virCommandNewArgList(udev, "settle", NULL))) return; =20 /* * NOTE: we ignore errors here; this is just to make sure that any dev= ice * nodes that are being created finish before we try to scan them. */ - ignore_value(virRun(settleprog, &exitstatus)); + ignore_value(virCommandRun(cmd, &exitstatus)); } -#else -void virWaitForDevices(void) -{} -#endif =20 #if WITH_DEVMAPPER bool --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list