From nobody Tue May 7 06:56:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1598969664; cv=none; d=zohomail.com; s=zohoarc; b=DfzX/BlXVJUR5j+FG6ANyjzO+U86SmSASnRrX2ip9tOJ5JAW90B9M8lL34tNeSFk5ZCczbLD4wM2tFZOhAUSUQP64RuSRmkpnOCQSMtUutHCLTAoCUS0nfpZqDqawk/QdrBhFx69yxBLfklJouNKACB0ZJ/xA4MWZZVrSE6gp04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598969664; 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; bh=goJE8NwR4Ye4vJY1YfXqiJYstRzUMbQO7zXGDJ6pJu8=; b=SCAE5ZjpONDSNyEWdi/W4D2Auv/swakF6ndalCe0Ow3yCqtwaObS1Ry09WGBN8RBxvyfUSzAttaNwtbaenfziWJ8PtvlCbpNWDMa/kDmLfV/i6K6VLiOqobgoGReTcysDBUjGrbUNlOmnFUliiouAu4hHx3/sqhcz4rE/e9QqPk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1598969664201963.4044147612626; Tue, 1 Sep 2020 07:14:24 -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-521-dpO39zLUPV6n8aZ7XhNjOw-1; Tue, 01 Sep 2020 10:00:33 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 792348030DD; Tue, 1 Sep 2020 14:00:25 +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 5639A78B56; Tue, 1 Sep 2020 14:00:25 +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 D7840181A720; Tue, 1 Sep 2020 14:00:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 081E0KUG013098 for ; Tue, 1 Sep 2020 10:00:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A02F7AED4; Tue, 1 Sep 2020 14:00:20 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8C0557B931 for ; Tue, 1 Sep 2020 14:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598969362; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=goJE8NwR4Ye4vJY1YfXqiJYstRzUMbQO7zXGDJ6pJu8=; b=YFi09xlQTtmRGyDKmFl8stm9GsIjIHUrs0kA4KEp1HNd/LzDH3DmDRDh399TizCfMb8faV +IO8AdDO1x/X7aOLSfH5A4BMdFgWcTXe4onaExg7GJdAA7Tw1kmdISDHGQYOPCMyICYDPW CXPsRHRhUaUWq1pn2bJ7sM1hkWw6UzE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598969662; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=goJE8NwR4Ye4vJY1YfXqiJYstRzUMbQO7zXGDJ6pJu8=; b=EmGLdErZorm4+Q1xVjewJuZr+AEkFWd6at3GZKh9KB4i38x3QBB302aeIxaJ5IVRCN7ncU zF7Yd9N5O/FJUnkHG3ENE2OSPlDuSumJ9zEBU8us/BL0Pmjan/kzne++Jf8Z697QwJ6IDK Vqb3sovBI9TQHGRl+p4+uE1X+umBEUo= X-MC-Unique: dpO39zLUPV6n8aZ7XhNjOw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/5] util: Check for HAVE_NET_IF_H correctly Date: Tue, 1 Sep 2020 16:00:10 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) (identity @redhat.com) Content-Type: text/plain; charset="utf-8" There are two places where we try to check whether the host system has net/if.h before including it. But the check is missing '_H' suffix. Fixes: 7f3eb533f44742071366e07a35ab41070956707b Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/util/virnetdevbridge.c | 2 +- src/util/virnetdevtap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index 8ce1a07c41..ccac97e8d0 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -27,7 +27,7 @@ #include "virstring.h" #include "virsocket.h" =20 -#ifdef HAVE_NET_IF +#ifdef HAVE_NET_IF_H # include #endif =20 diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index c0a7c3019e..931be9e36d 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -36,7 +36,7 @@ #ifndef WIN32 # include #endif -#ifdef HAVE_NET_IF +#ifdef HAVE_NET_IF_H # include #endif #include --=20 2.26.2 From nobody Tue May 7 06:56:36 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=1598968847; cv=none; d=zohomail.com; s=zohoarc; b=QzeAWAgFSNOSahU2tPoRQb0emsKCsI6s/IAh4sY47s8rW9uyAfjJojAxQuuOnUTcu5ZkwnvBQOqqtBA+RH2sMiKz6/0LbOjqMDG1TmpKBGkeV0bTzAn35SfU7qVV7nHO9ubL/67RHnk/JRiaF2wnqHrBy5SUl3U7fYgO8SFz/cM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598968847; 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; bh=GfEljaaqZRbHZApuW2bEAYTFSBx1vbpXoGoopZ4SFPk=; b=HbQ2qyQrtVQILpt413lLZyZM20IDx8Ob2swTzBeiz8lOC9+vAtESVbm4ov/INCNUS4GGdQLFVVNaZYfo6osZkHkvVth/TgZmHlgWAkqL/yehQwt/E9kI2Wrtka6MXWNhQshjbxJYTjSdJk+BYMP1tYY33N8tN3LcBpjwFxJt/Bo= 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 1598968847039407.74643364899464; Tue, 1 Sep 2020 07:00:47 -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-499-mYtv-vbdOg-_8mOg8N6OMw-1; Tue, 01 Sep 2020 10:00:39 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2466610ABDAF; Tue, 1 Sep 2020 14:00:31 +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 E7BC75C1BB; Tue, 1 Sep 2020 14:00:29 +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 779827A2E7; Tue, 1 Sep 2020 14:00:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 081E0KsF013108 for ; Tue, 1 Sep 2020 10:00:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id EAC057EB72; Tue, 1 Sep 2020 14:00:20 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6BB887EB91 for ; Tue, 1 Sep 2020 14:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598968843; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=GfEljaaqZRbHZApuW2bEAYTFSBx1vbpXoGoopZ4SFPk=; b=UqaL7N9wy3y3rrysQhZiRJE4HzEAWt/IEl4rPk+KWlZcbgS39DRqMmWjrPfyrHBHylyOxw Jr7aL3Mul9FkkxoWi7TWMC848a4gbPR3/8EwQdVzPKj0bjrRZ2wm4BvxGOIJ2SGygZ/Gjz oRY/5M1jOSfUjdSrjE1m+9MXfOP3AvI= X-MC-Unique: mYtv-vbdOg-_8mOg8N6OMw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/5] virfile.c: Remove some #endif comments Date: Tue, 1 Sep 2020 16:00:11 +0200 Message-Id: <63f00411bfb33a25b71c5ace13fd93e4076e8521.1598968735.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.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" There are couple of conditional #includes at the beginning of virfile.c and they try to be nice and document #endifs. But they are mostly wrong because either they have the condition in the comment inverted or the comment refers to a different condition than they belong to. Just remove the comments as these #includes are single line mostly. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/util/virfile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 09658c1623..716bf62593 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -28,19 +28,19 @@ #include #ifndef WIN32 # include -#endif /* !WIN32 */ +#endif #ifdef HAVE_PTY_H /* Linux openpty */ # include -#endif /* !HAVE_PTY_H */ +#endif #ifdef HAVE_UTIL_H /* macOS openpty */ # include -#endif /* !HAVE_LIBUTIL_H */ +#endif #ifdef HAVE_LIBUTIL_H /* FreeBSD openpty */ # include -#endif /* !HAVE_LIBUTIL_H */ +#endif #include #if defined(HAVE_SYS_MOUNT_H) # include --=20 2.26.2 From nobody Tue May 7 06:56:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1598968862; cv=none; d=zohomail.com; s=zohoarc; b=XDzSGFgu9fL/bRuCDvzv20G8r9wcSqcyy6mlrifEcO/zVnzkL4npWsK7HMbr0bzZo5YQIaLx3jfJU57tAKPRAakQWCVPAPaPP6zYU0aiKq2GLuRIeT+o0wMOAWQkPtvemJbDG76BpfPrZ5eq7mDuQ77x4+enpS6a4xsQtBWK7DE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598968862; 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; bh=xRzQbntRDcmX4DqPaoLYxbbtN4WMEg+m5ZzM5bAGLf0=; b=ZmDLDmWUXpZMovq8lW6tE2w8LgGzvArGyi3BmTjLjTIny/qwijqETk933cqzTYUgIT6LXERCjuyEMzqn660G1dcIRcJ1E5bO/rHti3pBnVVyddD5LhyBt+BrcK6gIJUkSUUKxDObfY8Sm9gkq2D0tXzDR6xvQvyteRP7PRO0bcs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1598968862396334.57552756152563; Tue, 1 Sep 2020 07:01:02 -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-346-z5fLvVBqOzet0HNqI8DK6w-1; Tue, 01 Sep 2020 10:00:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 85DD62FD0F; Tue, 1 Sep 2020 14:00:50 +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 674D97C549; Tue, 1 Sep 2020 14:00:50 +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 2F759181A870; Tue, 1 Sep 2020 14:00:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 081E0LIk013113 for ; Tue, 1 Sep 2020 10:00:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id C8E3D7EB72; Tue, 1 Sep 2020 14:00:21 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 488A37B931 for ; Tue, 1 Sep 2020 14:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598968860; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xRzQbntRDcmX4DqPaoLYxbbtN4WMEg+m5ZzM5bAGLf0=; b=RIEcdTs8XA+NSE2r9ub1qq2IUph4I28EPOttsuRhtyX/4nnv4cigRG5DBij4WpOEuBffPz sfeejXTybUdXXuIGIwBGMEh+rjplOxIooa+jVyDotGTtCI8GIcixRxk3i0moqcoUGsVDJb OFgqXM5c2RXfouLiP1cm7ox6GtxyZEU= X-MC-Unique: z5fLvVBqOzet0HNqI8DK6w-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/5] meson: Drop checks for some functions and header files Date: Tue, 1 Sep 2020 16:00:12 +0200 Message-Id: <5030896a5d55a00a59a993cc76883c120a6c0204.1598968735.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.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 meson.build, we check for presence of unshare() function explicitly (even though there is the function usability check a few hundred lines below), but never have any code depending on HAVE_UNSHARE. The same applies to stdarg.h and sys/sysctl.h header files - either we simply include them or guard their include using different conditionals. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- meson.build | 3 --- 1 file changed, 3 deletions(-) diff --git a/meson.build b/meson.build index e193166a9b..cdf33436f3 100644 --- a/meson.build +++ b/meson.build @@ -672,7 +672,6 @@ functions =3D [ 'stat64', 'symlink', 'sysctlbyname', - 'unshare', ] =20 foreach function : functions @@ -696,11 +695,9 @@ headers =3D [ 'net/if.h', 'pty.h', 'pwd.h', - 'stdarg.h', 'sys/ioctl.h', 'sys/mount.h', 'sys/syscall.h', - 'sys/sysctl.h', 'sys/ucred.h', 'syslog.h', 'util.h', --=20 2.26.2 From nobody Tue May 7 06:56:36 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=1598968865; cv=none; d=zohomail.com; s=zohoarc; b=GLX8neZDg4Au9Kt/JGcjBg+WTMhIqGyzGCOUhe+imZ87Ry5wjEp7aXXThOrV6LC/51fHBrzxNcdRHyHkTh3rPjoqtIvYKcoIkV+bFL3XqfjeRq3gyEVURLO5Z10/Un8jraI1EK0wZvKJgtGkbuvGTCFF69J9j6eCUoeDJBxdQ64= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598968865; 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; bh=cNldtpkJnyPmZfdZY9MVvuKtM2//K3CeXBVkgJ3ixUU=; b=cOmK0V7mWuGt8tVI9hRMZ0SnJUOWtsl02OD+x4Qs8J9/ItwhuQYkDqVfeSodPuqHtRBv4B8FEw5Qd8DdPb8mskF4bRLZLgxJCl+eYm4kDnFHyw2kPrM71uvRoJC+EIZ6so1GnDit/C8k95cHmMDK47pgb2eXdx8ycz0h29ydMhk= 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 1598968865104250.818777051633; Tue, 1 Sep 2020 07:01:05 -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-527-60IprhkwPOe0egCcZrAPtw-1; Tue, 01 Sep 2020 10:01:00 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 17489191E2A7; Tue, 1 Sep 2020 14:00:53 +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 EBE2A7C5A0; Tue, 1 Sep 2020 14:00:52 +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 B836E7A2F4; Tue, 1 Sep 2020 14:00:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 081E0Mfu013118 for ; Tue, 1 Sep 2020 10:00:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id A66717EB72; Tue, 1 Sep 2020 14:00:22 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 26D757B931 for ; Tue, 1 Sep 2020 14:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598968862; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=cNldtpkJnyPmZfdZY9MVvuKtM2//K3CeXBVkgJ3ixUU=; b=JFO5/B99OttquSR4N97Hs7WpMmyFEU+T8vjvaaCt7Jc4RE0u0Vh2xgC2ECcu/2ejf4sGis qEZTX7BD0bPGUttbfUTDz3fEpxYx0ENdc66YuxcErqZ2zCO3Ow+RgAGLDNu0e0WWykiwBA Tz6cr1vF2mZ5XA3N1r+CxyqON99kLBQ= X-MC-Unique: 60IprhkwPOe0egCcZrAPtw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/5] nss: Drop needless include of rpc/types.h Date: Tue, 1 Sep 2020 16:00:13 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.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 packet-libvirt.c in wireshark dissector we include rpc/types.h but guard the include with a condition (that is supposed to be true if we detected during configure phase that the host system has the header file). Thing is, it looks like we were never doing the configure check and thus the file was never included and yet, the NSS plugin works. Drop the include then. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tools/wireshark/src/packet-libvirt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/wireshark/src/packet-libvirt.c b/tools/wireshark/src/pac= ket-libvirt.c index 89dd18080e..9f3c7f650d 100644 --- a/tools/wireshark/src/packet-libvirt.c +++ b/tools/wireshark/src/packet-libvirt.c @@ -22,9 +22,6 @@ #include #include #include -#ifdef HAVE_RPC_TYPES_H -# include -#endif #include #include "packet-libvirt.h" #include "internal.h" --=20 2.26.2 From nobody Tue May 7 06:56:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1598969410; cv=none; d=zohomail.com; s=zohoarc; b=Ht9yTM8+HJhAwLo0GiSI6R25btSrd7v+Ot9PXwGlmOncAz4XoWVJIkqkEQHjcMyKu0DogVuNDZKgAlVnPDBnXN4E9dJoq06XmRJ+4PPVIED2F1e/+EzZKjqLPrJvAGLx73PRYKzC/X92OjilXP486BHNJyfTzt0O8gBw/WEOn6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598969410; 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; bh=F4Ksu1dGx80KBBjh9VJHsUNgmyHieqBDqY4qJ8Bm0fI=; b=HADBVthv445UMeXyBrzTnVyMXfqJR+cCDaHaYqH/g19OW3qZjY5UBC47x+ka9KG1XmMRqtQYVBzqJx1S+2dgIu+IgGIKT+RKsHkJnraTw+XaHBIIwPsVLSZFFsY50uj4ofNTA3w7ujVWTvj9PMJD9hopEJIdwMm5QYWcbpUFcR8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 159896941070986.07330645642367; Tue, 1 Sep 2020 07:10:10 -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-280-kcEjRBC1MfW_JtX6O47WXg-1; Tue, 01 Sep 2020 10:01:01 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C39B191E2A1; Tue, 1 Sep 2020 14:00:55 +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 695EA7AED4; Tue, 1 Sep 2020 14:00:55 +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 361977A30E; Tue, 1 Sep 2020 14:00:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 081E0OiF013140 for ; Tue, 1 Sep 2020 10:00:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 368BF7B931; Tue, 1 Sep 2020 14:00:24 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0466F7EB94 for ; Tue, 1 Sep 2020 14:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598969401; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=F4Ksu1dGx80KBBjh9VJHsUNgmyHieqBDqY4qJ8Bm0fI=; b=EBQPIiujAcnG4KaErg5tEH6bEMRXQ0/02sszJfCNZkXUoqJ9uwgEhSZRuu0naofcp4LcOC Cbl2Th8mKon1/63vPJ5MOoX5PQ1tFBqqRmhbJ/JYMrpMJVasJ/ILxaSzke9vX/nzvLu+V9 stfGMXI7EDYoFnWNnHdPm94LUtF+FLs= X-MC-Unique: kcEjRBC1MfW_JtX6O47WXg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 5/5] lib: Prefer WITH_* prefix for #if conditionals Date: Tue, 1 Sep 2020 16:00:14 +0200 Message-Id: <143aa313681f941665ebcbba539a80960d16aa3d.1598968735.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.104 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Currently, we are mixing: #if HAVE_BLAH with #if WITH_BLAH. Things got way better with Pavel's work on meson, but apparently, mixing these two lead to confusing and easy to miss bugs (see 31fb929eca for instance). While we were forced to use HAVE_ prefix with autotools, we are free to chose our own prefix with meson and since WITH_ prefix appears to be more popular let's use it everywhere. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- build-aux/syntax-check.mk | 10 +-- docs/coding-style.rst | 2 +- meson.build | 60 +++++++++--------- src/admin/libvirt-admin.c | 4 +- src/conf/nwfilter_conf.c | 2 +- src/cpu/cpu_arm.c | 8 +-- src/internal.h | 8 +-- src/libvirt.c | 4 +- src/libxl/libxl_capabilities.c | 2 +- src/libxl/libxl_conf.c | 4 +- src/libxl/xen_xl.c | 2 +- src/locking/lock_driver_sanlock.c | 2 +- src/locking/lock_manager.c | 14 ++--- src/network/bridge_driver.c | 4 +- src/nwfilter/nwfilter_dhcpsnoop.c | 8 +-- src/nwfilter/nwfilter_learnipaddr.c | 10 +-- src/qemu/qemu_namespace.c | 4 +- src/qemu/qemu_process.c | 6 +- src/rpc/virnetsocket.c | 8 +-- src/storage/storage_backend_rbd.c | 6 +- src/storage/storage_driver.c | 2 +- src/storage/storage_util.c | 6 +- src/util/iohelper.c | 2 +- src/util/virbpf.c | 6 +- src/util/virbpf.h | 6 +- src/util/vircgroupv2devices.c | 10 +-- src/util/virdbus.c | 2 +- src/util/virdbuspriv.h | 2 +- src/util/virfile.c | 86 +++++++++++++------------- src/util/virgettext.c | 6 +- src/util/virhostcpu.c | 14 ++--- src/util/virhostmem.c | 4 +- src/util/virhostuptime.c | 12 ++-- src/util/virlog.c | 24 ++++---- src/util/virmodule.c | 6 +- src/util/virnetdev.c | 94 ++++++++++++++--------------- src/util/virnetdev.h | 4 +- src/util/virnetdevbridge.c | 46 +++++++------- src/util/virnetdevip.c | 16 ++--- src/util/virnetdevmacvlan.c | 2 +- src/util/virnetdevtap.c | 6 +- src/util/virnetlink.c | 2 +- src/util/virnetlink.h | 2 +- src/util/virnuma.c | 12 ++-- src/util/virperf.c | 4 +- src/util/virprocess.c | 60 +++++++++--------- src/util/virstring.c | 8 +-- src/util/virthread.c | 4 +- src/util/virutil.c | 24 ++++---- src/util/virutil.h | 8 +-- src/util/virvsock.c | 6 +- tests/eventtest.c | 2 +- tests/libxlxml2domconfigtest.c | 2 +- tests/meson.build | 2 +- tests/securityselinuxhelper.c | 2 +- tests/virfilemock.c | 2 +- tests/virfiletest.c | 14 ++--- tests/virmock.h | 2 +- tests/virmockstathelpers.c | 16 ++--- tests/virnetsockettest.c | 8 +-- tests/virnettlscontexttest.c | 2 +- tests/virnettlshelpers.c | 2 +- tests/virnettlshelpers.h | 2 +- tests/virnettlssessiontest.c | 2 +- tests/virportallocatormock.c | 2 +- tests/virportallocatortest.c | 2 +- tests/virstoragetest.c | 4 +- tests/vshtabletest.c | 2 +- tools/nss/libvirt_nss.c | 4 +- tools/nss/libvirt_nss.h | 4 +- tools/virt-host-validate.c | 4 +- 71 files changed, 367 insertions(+), 367 deletions(-) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 16c70750e8..af3af54de4 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1397,8 +1397,8 @@ sc_require_config_h_first: else :; \ fi =20 -sc_prohibit_HAVE_MBRTOWC: - @prohibit=3D'\bHAVE_MBRTOWC\b' \ +sc_prohibit_WITH_MBRTOWC: + @prohibit=3D'\bWITH_MBRTOWC\b' \ halt=3D"do not use $$prohibit; it is always defined" \ $(_sc_search_regexp) =20 @@ -1617,8 +1617,8 @@ sc_unmarked_diagnostics: =20 =20 sc_prohibit_defined_have_decl_tests: - @prohibit=3D'(#[ ]*ifn?def|\[ (]+HAVE_DECL_' \ - halt=3D'HAVE_DECL macros are always defined' \ + @prohibit=3D'(#[ ]*ifn?def|\[ (]+WITH_DECL_' \ + halt=3D'WITH_DECL macros are always defined' \ $(_sc_search_regexp) =20 # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D @@ -1801,7 +1801,7 @@ sc_po_check: rm -f $@-1 $@-2; \ fi =20 -# #if HAVE_... will evaluate to false for any non numeric string. +# #if WITH_... will evaluate to false for any non numeric string. # That would be flagged by using -Wundef, however gnulib currently # tests many undefined macros, and so we can't enable that option. # So at least preclude common boolean strings as macro values. diff --git a/docs/coding-style.rst b/docs/coding-style.rst index 9212a42a77..deaa72041e 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -474,7 +474,7 @@ indentation to track nesting: =20 :: =20 - #if defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_FALLOCATE) + #if defined(WITH_POSIX_FALLOCATE) && !defined(WITH_FALLOCATE) # define fallocate(a, ignored, b, c) posix_fallocate(a, b, c) #endif =20 diff --git a/meson.build b/meson.build index cdf33436f3..c0d15da736 100644 --- a/meson.build +++ b/meson.build @@ -583,7 +583,7 @@ supported_cc_flags =3D cc.get_supported_arguments(cc_fl= ags) add_project_arguments(supported_cc_flags, language: 'c') =20 if cc.has_argument('-Wsuggest-attribute=3Dformat') - conf.set('HAVE_SUGGEST_ATTRIBUTE_FORMAT', 1) + conf.set('WITH_SUGGEST_ATTRIBUTE_FORMAT', 1) endif =20 # used in tests @@ -676,7 +676,7 @@ functions =3D [ =20 foreach function : functions if cc.has_function(function) - conf.set('HAVE_@0@'.format(function.to_upper()), 1) + conf.set('WITH_@0@'.format(function.to_upper()), 1) endif endforeach =20 @@ -715,7 +715,7 @@ endif =20 foreach name : headers if cc.has_header(name) - conf.set('HAVE_@0@'.format(name.underscorify().to_upper()), 1) + conf.set('WITH_@0@'.format(name.underscorify().to_upper()), 1) endif endforeach =20 @@ -799,7 +799,7 @@ endif =20 foreach symbol : symbols if cc.has_header_symbol(symbol[0], symbol[1], args: '-D_GNU_SOURCE', pre= fix: symbol.get(2, '')) - conf.set('HAVE_DECL_@0@'.format(symbol[1].to_upper()), 1) + conf.set('WITH_DECL_@0@'.format(symbol[1].to_upper()), 1) endif endforeach =20 @@ -810,19 +810,19 @@ brd_required_headers =3D '''#include if (cc.has_header_symbol('net/if_bridgevar.h', 'BRDGSFD', prefix: brd_requ= ired_headers) and cc.has_header_symbol('net/if_bridgevar.h', 'BRDGADD', prefix: brd_requ= ired_headers) and cc.has_header_symbol('net/if_bridgevar.h', 'BRDGDEL', prefix: brd_requ= ired_headers)) - conf.set('HAVE_BSD_BRIDGE_MGMT', 1) + conf.set('WITH_BSD_BRIDGE_MGMT', 1) endif =20 # Check for BSD CPU affinity availability if cc.has_header_symbol('sys/cpuset.h', 'cpuset_getaffinity') - conf.set('HAVE_BSD_CPU_AFFINITY', 1) + conf.set('WITH_BSD_CPU_AFFINITY', 1) endif =20 # whether Mach clock routines are available if (cc.has_header_symbol('mach/clock.h', 'clock_serv_t') and cc.has_header_symbol('mach/clock.h', 'host_get_clock_service') and cc.has_header_symbol('mach/clock.h', 'clock_get_time')) - conf.set('HAVE_MACH_CLOCK_ROUTINES', 1) + conf.set('WITH_MACH_CLOCK_ROUTINES', 1) endif =20 =20 @@ -836,7 +836,7 @@ types =3D [ foreach type : types if cc.has_type(type[0], prefix: type[1]) name =3D type[0].underscorify().to_upper() - conf.set('HAVE_@0@'.format(name), 1) + conf.set('WITH_@0@'.format(name), 1) endif endforeach =20 @@ -867,7 +867,7 @@ foreach member : members if cc.has_member(member[0], member[1], prefix: member[2]) type =3D member[0].underscorify().to_upper() member =3D member[1].underscorify().to_upper() - conf.set('HAVE_@0@_@1@'.format(type, member), 1) + conf.set('WITH_@0@_@1@'.format(type, member), 1) endif endforeach =20 @@ -966,7 +966,7 @@ endforeach =20 if host_machine.system() =3D=3D 'linux' and cc.has_header('sys/acl.h') acl_dep =3D cc.find_library('acl', required: false) - conf.set('HAVE_SYS_ACL_H', 1) + conf.set('WITH_SYS_ACL_H', 1) else acl_dep =3D dependency('', required: false) endif @@ -983,7 +983,7 @@ endif =20 attr_dep =3D cc.find_library('attr', required: get_option('attr')) if attr_dep.found() - conf.set('HAVE_LIBATTR', 1) + conf.set('WITH_LIBATTR', 1) endif =20 audit_dep =3D cc.find_library('audit', required: get_option('audit')) @@ -1028,12 +1028,12 @@ if dbus_dep.found() =20 function =3D 'dbus_watch_get_unix_fd' if cc.has_function(function, dependencies: dbus_dep) - conf.set('HAVE_@0@'.format(function.to_upper()), 1) + conf.set('WITH_@0@'.format(function.to_upper()), 1) endif =20 type =3D 'DBusBasicValue' if cc.has_type(type, dependencies: dbus_dep, prefix: '#include ') - conf.set('HAVE_@0@'.format(type.to_upper()), 1) + conf.set('WITH_@0@'.format(type.to_upper()), 1) endif endif =20 @@ -1056,7 +1056,7 @@ if dlopen_dep.found() if not cc.has_header('dlfcn.h') error('Unable to find dlfcn.h') endif - conf.set('HAVE_DLFCN_H', 1) + conf.set('WITH_DLFCN_H', 1) endif =20 fuse_version =3D '2.8.6' @@ -1103,7 +1103,7 @@ if host_machine.system() =3D=3D 'linux' libnl_dep =3D declare_dependency( dependencies: [ libnl_dep, libnl_route_dep ], ) - conf.set('HAVE_LIBNL', 1) + conf.set('WITH_LIBNL', 1) endif else libnl_dep =3D dependency('', required: false) @@ -1134,7 +1134,7 @@ if not libpcap_dep.found() endif endif if libpcap_dep.found() - conf.set('HAVE_LIBPCAP', 1) + conf.set('WITH_LIBPCAP', 1) endif =20 libssh_version =3D '0.7' @@ -1188,7 +1188,7 @@ if use_macvtap conf.set('WITH_MACVTAP', 1) =20 if cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_PASSTHRU') - conf.set('HAVE_DECL_MACVLAN_MODE_PASSTHRU', 1) + conf.set('WITH_DECL_MACVLAN_MODE_PASSTHRU', 1) endif endif =20 @@ -1213,7 +1213,7 @@ if not get_option('nls').disabled() endif =20 if cc.has_header('libintl.h') - conf.set('HAVE_LIBINTL_H', 1) + conf.set('WITH_LIBINTL_H', 1) elif get_option('nls').enabled() error('libintl.h is required to build libvirt') endif @@ -1241,7 +1241,7 @@ if numactl_dep.found() conf.set('WITH_NUMACTL', 1) =20 if cc.has_function('numa_bitmask_isbitset', dependencies: [ numactl_dep = ]) - conf.set('HAVE_NUMA_BITMASK_ISBITSET', 1) + conf.set('WITH_NUMA_BITMASK_ISBITSET', 1) endif endif =20 @@ -1267,7 +1267,7 @@ if rbd_dep.found() and not cc.has_function('rbd_get_f= eatures', dependencies: rbd endif if rbd_dep.found() and rados_dep.found() if cc.has_function('rbd_list2', dependencies: rbd_dep) - conf.set('HAVE_RBD_LIST2', 1) + conf.set('WITH_RBD_LIST2', 1) endif =20 rbd_dep =3D declare_dependency(dependencies: [ rbd_dep, rados_dep ]) @@ -1347,7 +1347,7 @@ if not get_option('sanlock').disabled() conf.set('WITH_SANLOCK', 1) # check for sanlock_strerror introduced in sanlock-3.5.0 if cc.has_function('sanlock_strerror', dependencies: sanlock_dep) - conf.set('HAVE_SANLOCK_STRERROR', 1) + conf.set('WITH_SANLOCK_STRERROR', 1) endif endif endif @@ -1548,7 +1548,7 @@ elif get_option('firewalld_zone').enabled() error('You must have firewalld support enabled to enable firewalld_zone') endif =20 -if conf.has('WITH_MACVTAP') and not conf.has('HAVE_LIBNL') +if conf.has('WITH_MACVTAP') and not conf.has('WITH_LIBNL') error('libnl3-devel is required for macvtap support') endif =20 @@ -1651,7 +1651,7 @@ if not get_option('driver_libxl').disabled() and conf= .has('WITH_LIBVIRTD') =20 # If building with libxl, use the libxl utility header and lib too if cc.has_header('libxlutil.h') - conf.set('HAVE_LIBXLUTIL_H', 1) + conf.set('WITH_LIBXLUTIL_H', 1) endif xl_util_dep =3D cc.find_library('xlutil') =20 @@ -1677,7 +1677,7 @@ if not get_option('driver_libxl').disabled() and conf= .has('WITH_LIBVIRTD') =20 # Check if Xen has support for PVH if cc.has_header_symbol('libxl.h', 'LIBXL_DOMAIN_TYPE_PVH') - conf.set('HAVE_XEN_PVH', 1) + conf.set('WITH_XEN_PVH', 1) endif =20 conf.set('WITH_LIBXL', 1) @@ -1698,7 +1698,7 @@ void main(void) { ''' if cc.compiles(lxc_support_code, name: 'lxc support', args: '-D_GNU_SOUR= CE') conf.set('WITH_LXC', 1) - conf.set('HAVE_DECL_LO_FLAGS_AUTOCLEAR', 1) + conf.set('WITH_DECL_LO_FLAGS_AUTOCLEAR', 1) elif get_option('driver_lxc').enabled() error('Required kernel features for LXC were not found') endif @@ -1713,7 +1713,7 @@ void main(void) { } ''' if cc.compiles(lxc_get_free_code) - conf.set('HAVE_DECL_LOOP_CTL_GET_FREE', 1) + conf.set('WITH_DECL_LOOP_CTL_GET_FREE', 1) endif elif get_option('driver_lxc').enabled() error('linux and remote_driver are required for LXC') @@ -2091,7 +2091,7 @@ endif =20 driver_modules_flags =3D [] if conf.has('WITH_LIBVIRTD') - if not conf.has('HAVE_DLFCN_H') or not dlopen_dep.found() + if not conf.has('WITH_DLFCN_H') or not dlopen_dep.found() error('You must have dlfcn.h / dlopen() support to build driver module= s') endif driver_modules_flags =3D libvirt_export_dynamic @@ -2168,7 +2168,7 @@ if not get_option('nss').disabled() conf.set('WITH_NSS', 1) =20 if cc.has_type('struct gaih_addrtuple', prefix: '#include ') - conf.set('HAVE_STRUCT_GAIH_ADDRTUPLE', 1) + conf.set('WITH_STRUCT_GAIH_ADDRTUPLE', 1) endif =20 if (cc.has_type('ns_mtab', prefix: '#include ') and @@ -2181,7 +2181,7 @@ endif if not get_option('numad').disabled() and numactl_dep.found() numad_prog =3D find_program('numad', required: get_option('numad'), dirs= : libvirt_sbin_path) if numad_prog.found() - conf.set('HAVE_NUMAD', 1) + conf.set('WITH_NUMAD', 1) conf.set_quoted('NUMAD', numad_prog.path()) endif elif get_option('numad').enabled() @@ -2472,7 +2472,7 @@ misc_summary =3D { 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'DTrace': conf.has('WITH_DTRACE_PROBES'), - 'numad': conf.has('HAVE_NUMAD'), + 'numad': conf.has('WITH_NUMAD'), 'Init script': init_script, 'Char device locks': chrdev_lock_files, 'Loader/NVRAM': loader_res, diff --git a/src/admin/libvirt-admin.c b/src/admin/libvirt-admin.c index b7f21275cb..ad70d4f108 100644 --- a/src/admin/libvirt-admin.c +++ b/src/admin/libvirt-admin.c @@ -57,10 +57,10 @@ virAdmGlobalInit(void) =20 virLogSetFromEnv(); =20 -#ifdef HAVE_LIBINTL_H +#ifdef WITH_LIBINTL_H if (!bindtextdomain(PACKAGE, LOCALEDIR)) goto error; -#endif /* HAVE_LIBINTL_H */ +#endif /* WITH_LIBINTL_H */ =20 if (!VIR_CLASS_NEW(remoteAdminPriv, virClassForObjectLockable())) goto error; diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index 779da3dddb..53794e8f6d 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -28,7 +28,7 @@ #include #include #include -#if HAVE_NET_ETHERNET_H +#if WITH_NET_ETHERNET_H # include #endif #include diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index 374a4d6f6c..939a3b8390 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -22,7 +22,7 @@ =20 #include #if defined(__aarch64__) -# if defined(HAVE_ASM_HWCAP_H) +# if defined(WITH_ASM_HWCAP_H) # include # endif # include @@ -520,7 +520,7 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data) int cpu_feature_index =3D 0; size_t i; =20 -# if defined(HAVE_GETAUXVAL) +# if defined(WITH_GETAUXVAL) if (!(getauxval(AT_HWCAP) & HWCAP_CPUID)) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("CPUID registers unavailable")); @@ -537,9 +537,9 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data) /* parse the corresponding vendor_id bits */ data->vendor_id =3D (cpuid >> 24) & 0xff; =20 -# if defined(HAVE_GETAUXVAL) +# if defined(WITH_GETAUXVAL) hwcaps =3D getauxval(AT_HWCAP); -# elif defined(HAVE_ELF_AUX_INFO) +# elif defined(WITH_ELF_AUX_INFO) elf_aux_info(AT_HWCAP, &hwcaps, sizeof(u_long)); # else # error No routines to retrieve a value from the auxiliary vector diff --git a/src/internal.h b/src/internal.h index d95db330b3..7a510e1368 100644 --- a/src/internal.h +++ b/src/internal.h @@ -49,13 +49,13 @@ /* The library itself needs to know enum sizes. */ #define VIR_ENUM_SENTINELS =20 -#ifdef HAVE_LIBINTL_H +#ifdef WITH_LIBINTL_H # define DEFAULT_TEXT_DOMAIN PACKAGE # include # define _(str) dgettext(PACKAGE, str) -#else /* HAVE_LIBINTL_H */ +#else /* WITH_LIBINTL_H */ # define _(str) str -#endif /* HAVE_LIBINTL_H */ +#endif /* WITH_LIBINTL_H */ #define N_(str) str =20 #include "libvirt/libvirt.h" @@ -165,7 +165,7 @@ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wpointer-sign\"") =20 -#if HAVE_SUGGEST_ATTRIBUTE_FORMAT +#if WITH_SUGGEST_ATTRIBUTE_FORMAT # define VIR_WARNINGS_NO_PRINTF \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=3Dformat\"") diff --git a/src/libvirt.c b/src/libvirt.c index b2d0ba3d23..39e465dd1c 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -242,10 +242,10 @@ virGlobalInit(void) =20 g_networking_init(); =20 -#ifdef HAVE_LIBINTL_H +#ifdef WITH_LIBINTL_H if (!bindtextdomain(PACKAGE, LOCALEDIR)) goto error; -#endif /* HAVE_LIBINTL_H */ +#endif /* WITH_LIBINTL_H */ =20 /* * Note that the order is important: the first ones have a higher diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index beac8c8cfc..8284ea3d53 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -497,7 +497,7 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps) * HVM guest type. Add a PVH guest type for each new HVM * guest type. */ -#ifdef HAVE_XEN_PVH +#ifdef WITH_XEN_PVH if (hvm && i =3D=3D nr_guest_archs-1) { /* Ensure we have not exhausted the guest_archs array */ if (nr_guest_archs >=3D G_N_ELEMENTS(guest_archs)) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index e7c7022b69..585f43b183 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -130,7 +130,7 @@ libxlMakeDomCreateInfo(libxl_ctx *ctx, =20 if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM || def->os.type =3D=3D VIR_DOMAIN_OSTYPE_XENPVH) { -#ifdef HAVE_XEN_PVH +#ifdef WITH_XEN_PVH c_info->type =3D def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM ? LIBXL_DOMAIN_TYPE_HVM : LIBXL_DOMAIN_TYPE_PVH; #else @@ -300,7 +300,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, if (hvm) { libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_HVM); } else if (pvh) { -#ifdef HAVE_XEN_PVH +#ifdef WITH_XEN_PVH libxl_domain_build_info_init_type(b_info, LIBXL_DOMAIN_TYPE_PVH); #else virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 258aca5c73..30a8125f5f 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -46,7 +46,7 @@ VIR_LOG_INIT("xen.xen_xl"); * corresponding header file wasn't. Use the header file if detected duri= ng * configure, otherwise provide extern declarations for any functions used. */ -#ifdef HAVE_LIBXLUTIL_H +#ifdef WITH_LIBXLUTIL_H # include #else typedef struct XLU_Config XLU_Config; diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sa= nlock.c index d4816030cf..640033eb97 100644 --- a/src/locking/lock_driver_sanlock.c +++ b/src/locking/lock_driver_sanlock.c @@ -100,7 +100,7 @@ virLockManagerSanlockError(int err, char **message) { if (err <=3D -200) { -#if HAVE_SANLOCK_STRERROR +#if WITH_SANLOCK_STRERROR *message =3D g_strdup(sanlock_strerror(err)); #else *message =3D g_strdup_printf(_("sanlock error %d"), err); diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c index ada950e03e..07034b1799 100644 --- a/src/locking/lock_manager.c +++ b/src/locking/lock_manager.c @@ -30,7 +30,7 @@ #include "viruuid.h" #include "virstring.h" =20 -#if HAVE_DLFCN_H +#if WITH_DLFCN_H # include #endif #include @@ -116,7 +116,7 @@ static void virLockManagerLogParams(size_t nparams, * * Returns a plugin object, or NULL if loading failed. */ -#if HAVE_DLFCN_H +#if WITH_DLFCN_H virLockManagerPluginPtr virLockManagerPluginNew(const char *name, const char *driverName, const char *configDir, @@ -191,7 +191,7 @@ virLockManagerPluginPtr virLockManagerPluginNew(const c= har *name, dlclose(handle); return NULL; } -#else /* !HAVE_DLFCN_H */ +#else /* !WITH_DLFCN_H */ virLockManagerPluginPtr virLockManagerPluginNew(const char *name G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, @@ -202,7 +202,7 @@ virLockManagerPluginNew(const char *name G_GNUC_UNUSED, _("this platform is missing dlopen")); return NULL; } -#endif /* !HAVE_DLFCN_H */ +#endif /* !WITH_DLFCN_H */ =20 =20 /** @@ -227,7 +227,7 @@ void virLockManagerPluginRef(virLockManagerPluginPtr pl= ugin) * result in an unsafe scenario. * */ -#if HAVE_DLFCN_H +#if WITH_DLFCN_H void virLockManagerPluginUnref(virLockManagerPluginPtr plugin) { if (!plugin) @@ -249,11 +249,11 @@ void virLockManagerPluginUnref(virLockManagerPluginPt= r plugin) VIR_FREE(plugin->name); VIR_FREE(plugin); } -#else /* !HAVE_DLFCN_H */ +#else /* !WITH_DLFCN_H */ void virLockManagerPluginUnref(virLockManagerPluginPtr plugin G_GNUC_UNUSE= D) { } -#endif /* !HAVE_DLFCN_H */ +#endif /* !WITH_DLFCN_H */ =20 =20 const char *virLockManagerPluginGetName(virLockManagerPluginPtr plugin) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 54cedd7325..b016d86b9f 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -32,7 +32,7 @@ #include #include #include -#ifdef HAVE_SYSCTLBYNAME +#ifdef WITH_SYSCTLBYNAME # include #endif =20 @@ -2140,7 +2140,7 @@ networkEnableIPForwarding(bool enableIPv4, bool enableIPv6) { int ret =3D 0; -#ifdef HAVE_SYSCTLBYNAME +#ifdef WITH_SYSCTLBYNAME int enabled =3D 1; if (enableIPv4) ret =3D sysctlbyname("net.inet.ip.forwarding", NULL, 0, diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index 649c4441ab..d0992b782c 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -36,7 +36,7 @@ */ #include =20 -#ifdef HAVE_LIBPCAP +#ifdef WITH_LIBPCAP # include #endif =20 @@ -65,7 +65,7 @@ =20 VIR_LOG_INIT("nwfilter.nwfilter_dhcpsnoop"); =20 -#ifdef HAVE_LIBPCAP +#ifdef WITH_LIBPCAP =20 # define LEASEFILE_DIR RUNSTATEDIR "/libvirt/network/" # define LEASEFILE LEASEFILE_DIR "nwfilter.leases" @@ -2118,7 +2118,7 @@ virNWFilterDHCPSnoopShutdown(void) virNWFilterSnoopActiveUnlock(); } =20 -#else /* HAVE_LIBPCAP */ +#else /* WITH_LIBPCAP */ =20 int virNWFilterDHCPSnoopInit(void) @@ -2150,4 +2150,4 @@ virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr tech= driver G_GNUC_UNUSED, "=3D'dhcp'\" requires it.")); return -1; } -#endif /* HAVE_LIBPCAP */ +#endif /* WITH_LIBPCAP */ diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_le= arnipaddr.c index c28b12f2f0..faf66ac84a 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -23,7 +23,7 @@ =20 #include =20 -#ifdef HAVE_LIBPCAP +#ifdef WITH_LIBPCAP # include #endif =20 @@ -225,7 +225,7 @@ virNWFilterIPAddrLearnReqFree(virNWFilterIPAddrLearnReq= Ptr req) } =20 =20 -#if HAVE_LIBPCAP +#if WITH_LIBPCAP =20 static int virNWFilterRegisterLearnReq(virNWFilterIPAddrLearnReqPtr req) @@ -306,7 +306,7 @@ freeLearnReqEntry(void *payload) } =20 =20 -#ifdef HAVE_LIBPCAP +#ifdef WITH_LIBPCAP =20 static virNWFilterIPAddrLearnReqPtr virNWFilterDeregisterLearnReq(int ifindex) @@ -325,7 +325,7 @@ virNWFilterDeregisterLearnReq(int ifindex) =20 #endif =20 -#ifdef HAVE_LIBPCAP +#ifdef WITH_LIBPCAP =20 static void procDHCPOpts(struct dhcp *dhcp, int dhcp_opts_len, @@ -761,7 +761,7 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr tech= driver G_GNUC_UNUSED, "support")); return -1; } -#endif /* HAVE_LIBPCAP */ +#endif /* WITH_LIBPCAP */ =20 =20 /** diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index b6724a095f..454d6a7b4d 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_namespace.c @@ -24,7 +24,7 @@ #ifdef __linux__ # include #endif -#if defined(HAVE_SYS_MOUNT_H) +#if defined(WITH_SYS_MOUNT_H) # include #endif #ifdef WITH_SELINUX @@ -850,7 +850,7 @@ qemuDomainNamespaceAvailable(qemuDomainNamespace ns G_G= NUC_UNUSED) =20 switch (ns) { case QEMU_DOMAIN_NS_MOUNT: -# if !defined(HAVE_SYS_ACL_H) || !defined(WITH_SELINUX) +# if !defined(WITH_SYS_ACL_H) || !defined(WITH_SELINUX) /* We can't create the exact copy of paths if either of * these is not available. */ return false; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index ad461d8f34..44f978e771 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2524,7 +2524,7 @@ qemuProcessGetAllCpuAffinity(virBitmapPtr *cpumapRet) /* * To be run between fork/exec of QEMU only */ -#if defined(HAVE_SCHED_GETAFFINITY) || defined(HAVE_BSD_CPU_AFFINITY) +#if defined(WITH_SCHED_GETAFFINITY) || defined(WITH_BSD_CPU_AFFINITY) static int qemuProcessInitCpuAffinity(virDomainObjPtr vm) { @@ -2577,13 +2577,13 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm) =20 return 0; } -#else /* !defined(HAVE_SCHED_GETAFFINITY) && !defined(HAVE_BSD_CPU_AFFINIT= Y) */ +#else /* !defined(WITH_SCHED_GETAFFINITY) && !defined(WITH_BSD_CPU_AFFINIT= Y) */ static int qemuProcessInitCpuAffinity(virDomainObjPtr vm G_GNUC_UNUSED) { return 0; } -#endif /* !defined(HAVE_SCHED_GETAFFINITY) && !defined(HAVE_BSD_CPU_AFFINI= TY) */ +#endif /* !defined(WITH_SCHED_GETAFFINITY) && !defined(WITH_BSD_CPU_AFFINI= TY) */ =20 /* set link states to down on interfaces at qemu start */ static int diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index f3aba01fd5..90e0f7c475 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -25,11 +25,11 @@ #include #include #include -#ifdef HAVE_IFADDRS_H +#ifdef WITH_IFADDRS_H # include #endif =20 -#ifdef HAVE_SYS_UCRED_H +#ifdef WITH_SYS_UCRED_H # include #endif =20 @@ -182,7 +182,7 @@ virNetSocketCheckProtocolByLookup(const char *address, int virNetSocketCheckProtocols(bool *hasIPv4, bool *hasIPv6) { -#ifdef HAVE_IFADDRS_H +#ifdef WITH_IFADDRS_H struct ifaddrs *ifaddr =3D NULL, *ifa; =20 *hasIPv4 =3D *hasIPv6 =3D false; @@ -1480,7 +1480,7 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock, pid_t *pid, unsigned long long *timestamp) { -# if defined(HAVE_STRUCT_SOCKPEERCRED) +# if defined(WITH_STRUCT_SOCKPEERCRED) struct sockpeercred cr; # else struct ucred cr; diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backen= d_rbd.c index cb298419e6..09928fdc3c 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -580,7 +580,7 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr = vol, } =20 =20 -#ifdef HAVE_RBD_LIST2 +#ifdef WITH_RBD_LIST2 static char ** virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr) { @@ -620,7 +620,7 @@ virStorageBackendRBDGetVolNames(virStorageBackendRBDSta= tePtr ptr) return NULL; } =20 -#else /* ! HAVE_RBD_LIST2 */ +#else /* ! WITH_RBD_LIST2 */ =20 static char ** virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr) @@ -669,7 +669,7 @@ virStorageBackendRBDGetVolNames(virStorageBackendRBDSta= tePtr ptr) virStringListFreeCount(names, nnames); return NULL; } -#endif /* ! HAVE_RBD_LIST2 */ +#endif /* ! WITH_RBD_LIST2 */ =20 =20 static int diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 7e82c09be5..9e79dbe1e4 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -27,7 +27,7 @@ #include #include =20 -#if HAVE_PWD_H +#if WITH_PWD_H # include #endif =20 diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 629f6fd1ee..843282091f 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -45,10 +45,10 @@ =20 #ifdef FICLONE # define REFLINK_IOC_CLONE FICLONE -#elif HAVE_LINUX_BTRFS_H +#elif WITH_LINUX_BTRFS_H # include # define REFLINK_IOC_CLONE BTRFS_IOC_CLONE -#elif HAVE_XFS_XFS_H +#elif WITH_XFS_XFS_H # include # define REFLINK_IOC_CLONE XFS_IOC_CLONE #endif @@ -337,7 +337,7 @@ createRawFile(int fd, virStorageVolDefPtr vol, } =20 /* Avoid issues with older kernel's namespace pollution. */ -#if HAVE_FALLOCATE - 0 +#if WITH_FALLOCATE - 0 /* Try to preallocate all requested disk space, but fall back to * other methods if this fails with ENOSYS or EOPNOTSUPP. If allocation * is 0 (or less than 0), then fallocate will fail with EINVAL. diff --git a/src/util/iohelper.c b/src/util/iohelper.c index 342bae229b..c3eb6f8c54 100644 --- a/src/util/iohelper.c +++ b/src/util/iohelper.c @@ -56,7 +56,7 @@ runIO(const char *path, int fd, int oflags) bool direct =3D O_DIRECT && ((oflags & O_DIRECT) !=3D 0); off_t end =3D 0; =20 -#if HAVE_POSIX_MEMALIGN +#if WITH_POSIX_MEMALIGN if (posix_memalign(&base, alignMask + 1, buflen)) { virReportOOMError(); goto cleanup; diff --git a/src/util/virbpf.c b/src/util/virbpf.c index 987fc34ef4..df4f333614 100644 --- a/src/util/virbpf.c +++ b/src/util/virbpf.c @@ -25,7 +25,7 @@ VIR_LOG_INIT("util.bpf"); =20 #define VIR_FROM_THIS VIR_FROM_BPF =20 -#if HAVE_SYS_SYSCALL_H && HAVE_DECL_BPF_PROG_QUERY +#if WITH_SYS_SYSCALL_H && WITH_DECL_BPF_PROG_QUERY # include # include =20 @@ -293,7 +293,7 @@ virBPFDeleteElem(int mapfd, } =20 =20 -#else /* !HAVE_SYS_SYSCALL_H || !HAVE_DECL_BPF_PROG_QUERY */ +#else /* !WITH_SYS_SYSCALL_H || !WITH_DECL_BPF_PROG_QUERY */ =20 =20 int @@ -421,4 +421,4 @@ virBPFDeleteElem(int mapfd G_GNUC_UNUSED, errno =3D ENOSYS; return -1; } -#endif /* !HAVE_SYS_SYSCALL_H || !HAVE_DECL_BPF_PROG_QUERY */ +#endif /* !WITH_SYS_SYSCALL_H || !WITH_DECL_BPF_PROG_QUERY */ diff --git a/src/util/virbpf.h b/src/util/virbpf.h index 1f38a683b9..1eafce86c0 100644 --- a/src/util/virbpf.h +++ b/src/util/virbpf.h @@ -18,7 +18,7 @@ =20 #pragma once =20 -#if HAVE_DECL_BPF_PROG_QUERY +#if WITH_DECL_BPF_PROG_QUERY =20 # include =20 @@ -171,7 +171,7 @@ .imm =3D 0, \ }) =20 -#else /* HAVE_DECL_BPF_PROG_QUERY */ +#else /* WITH_DECL_BPF_PROG_QUERY */ =20 struct bpf_prog_info; struct bpf_map_info; @@ -191,7 +191,7 @@ struct bpf_insn; # define VIR_BPF_CALL_INSN(func) # define VIR_BPF_EXIT_INSN() =20 -#endif /* HAVE_DECL_BPF_PROG_QUERY */ +#endif /* WITH_DECL_BPF_PROG_QUERY */ =20 int virBPFCreateMap(unsigned int mapType, diff --git a/src/util/vircgroupv2devices.c b/src/util/vircgroupv2devices.c index 234e0f2278..f31244f3c1 100644 --- a/src/util/vircgroupv2devices.c +++ b/src/util/vircgroupv2devices.c @@ -17,13 +17,13 @@ */ #include =20 -#if HAVE_DECL_BPF_CGROUP_DEVICE +#if WITH_DECL_BPF_CGROUP_DEVICE # include # include # include # include # include -#endif /* !HAVE_DECL_BPF_CGROUP_DEVICE */ +#endif /* !WITH_DECL_BPF_CGROUP_DEVICE */ =20 #include "internal.h" =20 @@ -41,7 +41,7 @@ VIR_LOG_INIT("util.cgroup"); =20 #define VIR_FROM_THIS VIR_FROM_CGROUP =20 -#if HAVE_DECL_BPF_CGROUP_DEVICE +#if WITH_DECL_BPF_CGROUP_DEVICE bool virCgroupV2DevicesAvailable(virCgroupPtr group) { @@ -581,7 +581,7 @@ virCgroupV2DevicesGetPerms(int perms, =20 return ret; } -#else /* !HAVE_DECL_BPF_CGROUP_DEVICE */ +#else /* !WITH_DECL_BPF_CGROUP_DEVICE */ bool virCgroupV2DevicesAvailable(virCgroupPtr group G_GNUC_UNUSED) { @@ -632,7 +632,7 @@ virCgroupV2DevicesGetPerms(int perms G_GNUC_UNUSED, { return 0; } -#endif /* !HAVE_DECL_BPF_CGROUP_DEVICE */ +#endif /* !WITH_DECL_BPF_CGROUP_DEVICE */ =20 =20 uint64_t diff --git a/src/util/virdbus.c b/src/util/virdbus.c index fbfc09c949..459b57abc6 100644 --- a/src/util/virdbus.c +++ b/src/util/virdbus.c @@ -242,7 +242,7 @@ static dbus_bool_t virDBusAddWatch(DBusWatch *watch, if (dbus_watch_get_enabled(watch)) flags =3D virDBusTranslateWatchFlags(dbus_watch_get_flags(watch)); =20 -# if HAVE_DBUS_WATCH_GET_UNIX_FD +# if WITH_DBUS_WATCH_GET_UNIX_FD fd =3D dbus_watch_get_unix_fd(watch); # else fd =3D dbus_watch_get_fd(watch); diff --git a/src/util/virdbuspriv.h b/src/util/virdbuspriv.h index f96f393ff5..5b4fe217f9 100644 --- a/src/util/virdbuspriv.h +++ b/src/util/virdbuspriv.h @@ -27,7 +27,7 @@ =20 #include "virdbus.h" =20 -#if defined(WITH_DBUS) && !HAVE_DBUSBASICVALUE +#if defined(WITH_DBUS) && !WITH_DBUSBASICVALUE /* Copied (and simplified) from dbus 1.6.12, for use with older dbus heade= rs */ typedef union { diff --git a/src/util/virfile.c b/src/util/virfile.c index 716bf62593..90156845df 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -29,44 +29,44 @@ #ifndef WIN32 # include #endif -#ifdef HAVE_PTY_H +#ifdef WITH_PTY_H /* Linux openpty */ # include #endif -#ifdef HAVE_UTIL_H +#ifdef WITH_UTIL_H /* macOS openpty */ # include #endif -#ifdef HAVE_LIBUTIL_H +#ifdef WITH_LIBUTIL_H /* FreeBSD openpty */ # include #endif #include -#if defined(HAVE_SYS_MOUNT_H) +#if defined(WITH_SYS_MOUNT_H) # include #endif #include #include -#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R +#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R # include #endif -#if HAVE_MMAP +#if WITH_MMAP # include #endif -#if HAVE_SYS_SYSCALL_H +#if WITH_SYS_SYSCALL_H # include #endif -#if HAVE_SYS_ACL_H +#if WITH_SYS_ACL_H # include #endif #include =20 #ifdef __linux__ -# if HAVE_LINUX_MAGIC_H +# if WITH_LINUX_MAGIC_H # include # endif # include -# if HAVE_DECL_LO_FLAGS_AUTOCLEAR +# if WITH_DECL_LO_FLAGS_AUTOCLEAR # include # endif # include @@ -74,7 +74,7 @@ # include #endif =20 -#if HAVE_LIBATTR +#if WITH_LIBATTR # include #endif =20 @@ -618,9 +618,9 @@ int virFileUpdatePerm(const char *path, } =20 =20 -#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR +#if defined(__linux__) && WITH_DECL_LO_FLAGS_AUTOCLEAR =20 -# if HAVE_DECL_LOOP_CTL_GET_FREE +# if WITH_DECL_LOOP_CTL_GET_FREE =20 /* virFileLoopDeviceOpenLoopCtl() returns -1 when a real failure has occur= red * while in the process of allocating or opening the loop device. On succ= ess @@ -665,7 +665,7 @@ static int virFileLoopDeviceOpenLoopCtl(char **dev_name= , int *fd) *dev_name =3D looppath; return 0; } -# endif /* HAVE_DECL_LOOP_CTL_GET_FREE */ +# endif /* WITH_DECL_LOOP_CTL_GET_FREE */ =20 static int virFileLoopDeviceOpenSearch(char **dev_name) { @@ -735,7 +735,7 @@ static int virFileLoopDeviceOpen(char **dev_name) { int loop_fd =3D -1; =20 -# if HAVE_DECL_LOOP_CTL_GET_FREE +# if WITH_DECL_LOOP_CTL_GET_FREE if (virFileLoopDeviceOpenLoopCtl(dev_name, &loop_fd) < 0) return -1; =20 @@ -743,7 +743,7 @@ static int virFileLoopDeviceOpen(char **dev_name) =20 if (loop_fd >=3D 0) return loop_fd; -# endif /* HAVE_DECL_LOOP_CTL_GET_FREE */ +# endif /* WITH_DECL_LOOP_CTL_GET_FREE */ =20 /* Without the loop control device we just use the old technique. */ loop_fd =3D virFileLoopDeviceOpenSearch(dev_name); @@ -1082,7 +1082,7 @@ safewrite(int fd, const void *buf, size_t count) return nwritten; } =20 -#ifdef HAVE_POSIX_FALLOCATE +#ifdef WITH_POSIX_FALLOCATE static int safezero_posix_fallocate(int fd, off_t offset, off_t len) { @@ -1092,7 +1092,7 @@ safezero_posix_fallocate(int fd, off_t offset, off_t = len) errno =3D ret; return -1; } -#else /* !HAVE_POSIX_FALLOCATE */ +#else /* !WITH_POSIX_FALLOCATE */ static int safezero_posix_fallocate(int fd G_GNUC_UNUSED, off_t offset G_GNUC_UNUSED, @@ -1100,9 +1100,9 @@ safezero_posix_fallocate(int fd G_GNUC_UNUSED, { return -2; } -#endif /* !HAVE_POSIX_FALLOCATE */ +#endif /* !WITH_POSIX_FALLOCATE */ =20 -#if HAVE_SYS_SYSCALL_H && defined(SYS_fallocate) +#if WITH_SYS_SYSCALL_H && defined(SYS_fallocate) static int safezero_sys_fallocate(int fd, off_t offset, @@ -1110,7 +1110,7 @@ safezero_sys_fallocate(int fd, { return syscall(SYS_fallocate, fd, 0, offset, len); } -#else /* !HAVE_SYS_SYSCALL_H || !defined(SYS_fallocate) */ +#else /* !WITH_SYS_SYSCALL_H || !defined(SYS_fallocate) */ static int safezero_sys_fallocate(int fd G_GNUC_UNUSED, off_t offset G_GNUC_UNUSED, @@ -1118,9 +1118,9 @@ safezero_sys_fallocate(int fd G_GNUC_UNUSED, { return -2; } -#endif /* !HAVE_SYS_SYSCALL_H || !defined(SYS_fallocate) */ +#endif /* !WITH_SYS_SYSCALL_H || !defined(SYS_fallocate) */ =20 -#ifdef HAVE_MMAP +#ifdef WITH_MMAP static int safezero_mmap(int fd, off_t offset, off_t len) { @@ -1154,7 +1154,7 @@ safezero_mmap(int fd, off_t offset, off_t len) * example because of virtual memory limits) */ return -2; } -#else /* !HAVE_MMAP */ +#else /* !WITH_MMAP */ static int safezero_mmap(int fd G_GNUC_UNUSED, off_t offset G_GNUC_UNUSED, @@ -1162,7 +1162,7 @@ safezero_mmap(int fd G_GNUC_UNUSED, { return -2; } -#endif /* !HAVE_MMAP */ +#endif /* !WITH_MMAP */ =20 static int safezero_slow(int fd, off_t offset, off_t len) @@ -1226,7 +1226,7 @@ int virFileAllocate(int fd, off_t offset, off_t len) return safezero_sys_fallocate(fd, offset, len); } =20 -#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R +#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R /* search /proc/mounts for mount point of *type; return pointer to * malloc'ed string of the path if found, otherwise return NULL * with errno set to an appropriate value. @@ -1259,7 +1259,7 @@ virFileFindMountPoint(const char *type) return ret; } =20 -#else /* defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */ +#else /* defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */ =20 char * virFileFindMountPoint(const char *type G_GNUC_UNUSED) @@ -1269,7 +1269,7 @@ virFileFindMountPoint(const char *type G_GNUC_UNUSED) return NULL; } =20 -#endif /* defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */ +#endif /* defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */ =20 int virBuildPathInternal(char **path, ...) @@ -1969,7 +1969,7 @@ virFileIsCDROM(const char *path) #endif /* defined(__linux__) */ =20 =20 -#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R +#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R static int virFileGetMountSubtreeImpl(const char *mtabpath, const char *prefix, @@ -2020,7 +2020,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath, endmntent(procmnt); return ret; } -#else /* ! defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */ +#else /* ! defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */ static int virFileGetMountSubtreeImpl(const char *mtabpath G_GNUC_UNUSED, const char *prefix G_GNUC_UNUSED, @@ -2032,7 +2032,7 @@ virFileGetMountSubtreeImpl(const char *mtabpath G_GNU= C_UNUSED, _("Unable to determine mount table on this platfo= rm")); return -1; } -#endif /* ! defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */ +#endif /* ! defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */ =20 /** * virFileGetMountSubtree: @@ -3691,7 +3691,7 @@ int virFileIsSharedFS(const char *path) } =20 =20 -#if defined(__linux__) && defined(HAVE_SYS_MOUNT_H) +#if defined(__linux__) && defined(WITH_SYS_MOUNT_H) int virFileSetupDev(const char *path, const char *mount_options) @@ -3761,7 +3761,7 @@ virFileMoveMount(const char *src, } =20 =20 -#else /* !defined(__linux__) || !defined(HAVE_SYS_MOUNT_H) */ +#else /* !defined(__linux__) || !defined(WITH_SYS_MOUNT_H) */ =20 int virFileSetupDev(const char *path G_GNUC_UNUSED, @@ -3791,10 +3791,10 @@ virFileMoveMount(const char *src G_GNUC_UNUSED, _("mount move is not supported on this platform."= )); return -1; } -#endif /* !defined(__linux__) || !defined(HAVE_SYS_MOUNT_H) */ +#endif /* !defined(__linux__) || !defined(WITH_SYS_MOUNT_H) */ =20 =20 -#if defined(HAVE_SYS_ACL_H) +#if defined(WITH_SYS_ACL_H) int virFileGetACLs(const char *file, void **acl) @@ -3824,7 +3824,7 @@ virFileFreeACLs(void **acl) *acl =3D NULL; } =20 -#else /* !defined(HAVE_SYS_ACL_H) */ +#else /* !defined(WITH_SYS_ACL_H) */ =20 int virFileGetACLs(const char *file G_GNUC_UNUSED, @@ -3850,7 +3850,7 @@ virFileFreeACLs(void **acl) *acl =3D NULL; } =20 -#endif /* !defined(HAVE_SYS_ACL_H) */ +#endif /* !defined(WITH_SYS_ACL_H) */ =20 int virFileCopyACLs(const char *src, @@ -3909,7 +3909,7 @@ virFileComparePaths(const char *p1, const char *p2) } =20 =20 -#if HAVE_DECL_SEEK_HOLE +#if WITH_DECL_SEEK_HOLE /** * virFileInData: * @fd: file to check @@ -4027,7 +4027,7 @@ virFileInData(int fd, return ret; } =20 -#else /* !HAVE_DECL_SEEK_HOLE */ +#else /* !WITH_DECL_SEEK_HOLE */ =20 int virFileInData(int fd G_GNUC_UNUSED, @@ -4040,7 +4040,7 @@ virFileInData(int fd G_GNUC_UNUSED, return -1; } =20 -#endif /* !HAVE_DECL_SEEK_HOLE */ +#endif /* !WITH_DECL_SEEK_HOLE */ =20 =20 /** @@ -4309,7 +4309,7 @@ virFileWaitForExists(const char *path, } =20 =20 -#if HAVE_LIBATTR +#if WITH_LIBATTR /** * virFileGetXAttrQuiet; * @path: a filename @@ -4409,7 +4409,7 @@ virFileRemoveXAttr(const char *path, return 0; } =20 -#else /* !HAVE_LIBATTR */ +#else /* !WITH_LIBATTR */ =20 int virFileGetXAttrQuiet(const char *path G_GNUC_UNUSED, @@ -4443,7 +4443,7 @@ virFileRemoveXAttr(const char *path, return -1; } =20 -#endif /* HAVE_LIBATTR */ +#endif /* WITH_LIBATTR */ =20 /** * virFileGetXAttr; diff --git a/src/util/virgettext.c b/src/util/virgettext.c index 8de8edb239..35dfba07fc 100644 --- a/src/util/virgettext.c +++ b/src/util/virgettext.c @@ -21,7 +21,7 @@ #include =20 #include -#ifdef HAVE_XLOCALE_H +#ifdef WITH_XLOCALE_H # include #endif =20 @@ -39,7 +39,7 @@ int virGettextInitialize(void) { -#if HAVE_LIBINTL_H +#if WITH_LIBINTL_H if (!setlocale(LC_ALL, "")) { perror("setlocale"); /* failure to setup locale is not fatal */ @@ -54,6 +54,6 @@ virGettextInitialize(void) perror("textdomain"); return -1; } -#endif /* HAVE_LIBINTL_H */ +#endif /* WITH_LIBINTL_H */ return 0; } diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index ebb91ebb54..f7e92cd924 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -28,7 +28,7 @@ #endif #include =20 -#if HAVE_LINUX_KVM_H +#if WITH_LINUX_KVM_H # include #endif =20 @@ -1129,7 +1129,7 @@ virHostCPUGetAvailableCPUsBitmap(void) } =20 =20 -#if HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) +#if WITH_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) =20 /* Get the number of threads per subcore. * @@ -1188,9 +1188,9 @@ virHostCPUGetThreadsPerSubcore(virArch arch G_GNUC_UN= USED) return 0; } =20 -#endif /* HAVE_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) */ +#endif /* WITH_LINUX_KVM_H && defined(KVM_CAP_PPC_SMT) */ =20 -#if HAVE_LINUX_KVM_H +#if WITH_LINUX_KVM_H int virHostCPUGetKVMMaxVCPUs(void) { @@ -1229,7 +1229,7 @@ virHostCPUGetKVMMaxVCPUs(void) _("KVM is not supported on this platform")); return -1; } -#endif /* HAVE_LINUX_KVM_H */ +#endif /* WITH_LINUX_KVM_H */ =20 =20 #ifdef __linux__ @@ -1279,7 +1279,7 @@ virHostCPUGetMicrocodeVersion(virArch hostArch G_GNUC= _UNUSED) #endif /* __linux__ */ =20 =20 -#if HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) && \ +#if WITH_LINUX_KVM_H && defined(KVM_GET_MSRS) && \ (defined(__i386__) || defined(__x86_64__)) && \ (defined(__linux__) || defined(__FreeBSD__)) static int @@ -1427,7 +1427,7 @@ virHostCPUGetTscInfo(void) return NULL; } =20 -#endif /* HAVE_LINUX_KVM_H && defined(KVM_GET_MSRS) && \ +#endif /* WITH_LINUX_KVM_H && defined(KVM_GET_MSRS) && \ (defined(__i386__) || defined(__x86_64__)) && \ (defined(__linux__) || defined(__FreeBSD__)) */ =20 diff --git a/src/util/virhostmem.c b/src/util/virhostmem.c index 27f192dc24..ae42978ed2 100644 --- a/src/util/virhostmem.c +++ b/src/util/virhostmem.c @@ -615,7 +615,7 @@ typedef WINBOOL(WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*); static unsigned long long virHostMemGetTotal(void) { -#if defined HAVE_SYSCTLBYNAME +#if defined WITH_SYSCTLBYNAME /* This works on freebsd & macOS. */ unsigned long long physmem =3D 0; size_t len =3D sizeof(physmem); @@ -676,7 +676,7 @@ virHostMemGetTotal(void) static unsigned long long virHostMemGetAvailable(void) { -#if defined HAVE_SYSCTLBYNAME +#if defined WITH_SYSCTLBYNAME /* This works on freebsd and macOS */ unsigned long long usermem =3D 0; size_t len =3D sizeof(usermem); diff --git a/src/util/virhostuptime.c b/src/util/virhostuptime.c index 661ed588cd..696a38fbb5 100644 --- a/src/util/virhostuptime.c +++ b/src/util/virhostuptime.c @@ -20,7 +20,7 @@ =20 #include =20 -#ifdef HAVE_GETUTXID +#ifdef WITH_GETUTXID # include #endif =20 @@ -82,11 +82,11 @@ virHostGetBootTimeProcfs(unsigned long long *btime) } #endif /* defined(__linux__) */ =20 -#if defined(HAVE_GETUTXID) || defined(__linux__) +#if defined(WITH_GETUTXID) || defined(__linux__) static void virHostGetBootTimeOnceInit(void) { -# ifdef HAVE_GETUTXID +# ifdef WITH_GETUTXID struct utmpx id =3D {.ut_type =3D BOOT_TIME}; struct utmpx *res =3D NULL; =20 @@ -97,7 +97,7 @@ virHostGetBootTimeOnceInit(void) } =20 endutxent(); -# endif /* HAVE_GETUTXID */ +# endif /* WITH_GETUTXID */ =20 # ifdef __linux__ if (bootTimeErrno !=3D 0 || bootTime =3D=3D 0) @@ -105,14 +105,14 @@ virHostGetBootTimeOnceInit(void) # endif /* __linux__ */ } =20 -#else /* !defined(HAVE_GETUTXID) && !defined(__linux__) */ +#else /* !defined(WITH_GETUTXID) && !defined(__linux__) */ =20 static void virHostGetBootTimeOnceInit(void) { bootTimeErrno =3D ENOSYS; } -#endif /* !defined(HAVE_GETUTXID) && !defined(__linux__) */ +#endif /* !defined(WITH_GETUTXID) && !defined(__linux__) */ =20 /** * virHostGetBootTime: diff --git a/src/util/virlog.c b/src/util/virlog.c index 3217e5eb73..f6d0c6c050 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -27,7 +27,7 @@ #include #include #include -#if HAVE_SYSLOG_H +#if WITH_SYSLOG_H # include #endif =20 @@ -45,7 +45,7 @@ =20 /* Journald output is only supported on Linux new enough to expose * htole64. */ -#if HAVE_SYSLOG_H && defined(__linux__) && HAVE_DECL_HTOLE64 +#if WITH_SYSLOG_H && defined(__linux__) && WITH_DECL_HTOLE64 # define USE_JOURNALD 1 # include #endif @@ -705,7 +705,7 @@ virLogNewOutputToFile(virLogPriority priority, } =20 =20 -#if HAVE_SYSLOG_H || USE_JOURNALD +#if WITH_SYSLOG_H || USE_JOURNALD =20 /* Compat in case we build with journald, but no syslog */ # ifndef LOG_DEBUG @@ -737,10 +737,10 @@ virLogPrioritySyslog(virLogPriority priority) return LOG_ERR; } } -#endif /* HAVE_SYSLOG_H || USE_JOURNALD */ +#endif /* WITH_SYSLOG_H || USE_JOURNALD */ =20 =20 -#if HAVE_SYSLOG_H +#if WITH_SYSLOG_H static void virLogOutputToSyslog(virLogSourcePtr source G_GNUC_UNUSED, virLogPriority priority, @@ -1042,12 +1042,12 @@ int virLogPriorityFromSyslog(int priority) return VIR_LOG_ERROR; } =20 -#else /* HAVE_SYSLOG_H */ +#else /* WITH_SYSLOG_H */ int virLogPriorityFromSyslog(int priority G_GNUC_UNUSED) { return VIR_LOG_ERROR; } -#endif /* HAVE_SYSLOG_H */ +#endif /* WITH_SYSLOG_H */ =20 =20 /** @@ -1383,10 +1383,10 @@ virLogFindOutput(virLogOutputPtr *outputs, size_t n= outputs, int virLogDefineOutputs(virLogOutputPtr *outputs, size_t noutputs) { -#if HAVE_SYSLOG_H +#if WITH_SYSLOG_H int id; char *tmp =3D NULL; -#endif /* HAVE_SYSLOG_H */ +#endif /* WITH_SYSLOG_H */ =20 if (virLogInitialize() < 0) return -1; @@ -1394,7 +1394,7 @@ virLogDefineOutputs(virLogOutputPtr *outputs, size_t = noutputs) virLogLock(); virLogResetOutputs(); =20 -#if HAVE_SYSLOG_H +#if WITH_SYSLOG_H /* syslog needs to be special-cased, since it keeps the fd in private = */ if ((id =3D virLogFindOutput(outputs, noutputs, VIR_LOG_TO_SYSLOG, current_ident)) !=3D -1) { @@ -1407,7 +1407,7 @@ virLogDefineOutputs(virLogOutputPtr *outputs, size_t = noutputs) current_ident =3D tmp; openlog(current_ident, 0, 0); } -#endif /* HAVE_SYSLOG_H */ +#endif /* WITH_SYSLOG_H */ =20 virLogOutputs =3D outputs; virLogNbOutputs =3D noutputs; @@ -1519,7 +1519,7 @@ virLogParseOutput(const char *src) ret =3D virLogNewOutputToStderr(prio); break; case VIR_LOG_TO_SYSLOG: -#if HAVE_SYSLOG_H +#if WITH_SYSLOG_H ret =3D virLogNewOutputToSyslog(prio, tokens[2]); #endif break; diff --git a/src/util/virmodule.c b/src/util/virmodule.c index bc05fc6f4d..36cf77ac46 100644 --- a/src/util/virmodule.c +++ b/src/util/virmodule.c @@ -32,7 +32,7 @@ =20 VIR_LOG_INIT("util.module"); =20 -#ifdef HAVE_DLFCN_H +#ifdef WITH_DLFCN_H # include =20 static void * @@ -141,7 +141,7 @@ virModuleLoad(const char *path, return ret; } =20 -#else /* ! HAVE_DLFCN_H */ +#else /* ! WITH_DLFCN_H */ int virModuleLoad(const char *path, const char *regfunc G_GNUC_UNUSED, @@ -160,4 +160,4 @@ virModuleLoad(const char *path, return 1; } } -#endif /* ! HAVE_DLFCN_H */ +#endif /* ! WITH_DLFCN_H */ diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index b42fa86672..3040f129d1 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -40,23 +40,23 @@ # include # include # define VIR_NETDEV_FAMILY AF_UNIX -#elif defined(HAVE_STRUCT_IFREQ) && defined(AF_LOCAL) +#elif defined(WITH_STRUCT_IFREQ) && defined(AF_LOCAL) # define VIR_NETDEV_FAMILY AF_LOCAL #else -# undef HAVE_STRUCT_IFREQ +# undef WITH_STRUCT_IFREQ #endif =20 -#if defined(SIOCETHTOOL) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCETHTOOL) && defined(WITH_STRUCT_IFREQ) # include # include #endif =20 -#if HAVE_DECL_LINK_ADDR +#if WITH_DECL_LINK_ADDR # include # include #endif =20 -#if HAVE_LINUX_DEVLINK_H +#if WITH_LINUX_DEVLINK_H # include #endif =20 @@ -73,7 +73,7 @@ VIR_LOG_INIT("util.netdev"); #define VIR_MCAST_NAME_LEN (IFNAMSIZ + 1) #define VIR_MCAST_TOKEN_DELIMS " \n" =20 -#if defined(SIOCSIFFLAGS) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCSIFFLAGS) && defined(WITH_STRUCT_IFREQ) # define VIR_IFF_UP IFF_UP # define VIR_IFF_PROMISC IFF_PROMISC # define VIR_IFF_MULTICAST IFF_MULTICAST @@ -86,7 +86,7 @@ VIR_LOG_INIT("util.netdev"); #endif =20 #define RESOURCE_FILE_LEN 4096 -#if HAVE_DECL_ETHTOOL_GFEATURES +#if WITH_DECL_ETHTOOL_GFEATURES # define TX_UDP_TNL 25 # define GFEATURES_SIZE 2 # define FEATURE_WORD(blocks, index, field) ((blocks)[(index) / 32U].fiel= d) @@ -130,7 +130,7 @@ struct _virNetDevMcastList { virNetDevMcastEntryPtr *entries; }; =20 -#if defined(HAVE_STRUCT_IFREQ) +#if defined(WITH_STRUCT_IFREQ) static int virNetDevSetupControlFull(const char *ifname, struct ifreq *ifr, int domain, @@ -172,7 +172,7 @@ virNetDevSetupControl(const char *ifname, { return virNetDevSetupControlFull(ifname, ifr, VIR_NETDEV_FAMILY, SOCK_= DGRAM); } -#else /* !HAVE_STRUCT_IFREQ */ +#else /* !WITH_STRUCT_IFREQ */ int virNetDevSetupControl(const char *ifname G_GNUC_UNUSED, void *ifr G_GNUC_UNUSED) @@ -182,10 +182,10 @@ virNetDevSetupControl(const char *ifname G_GNUC_UNUSE= D, "on this platform")); return -1; } -#endif /* HAVE_STRUCT_IFREQ */ +#endif /* WITH_STRUCT_IFREQ */ =20 =20 -#if defined(SIOCGIFFLAGS) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCGIFFLAGS) && defined(WITH_STRUCT_IFREQ) /** * virNetDevExists: * @ifname @@ -224,7 +224,7 @@ int virNetDevExists(const char *ifname) =20 =20 #if defined(SIOCGIFHWADDR) && defined(SIOCSIFHWADDR) && \ - defined(HAVE_STRUCT_IFREQ) + defined(WITH_STRUCT_IFREQ) /** * virNetDevSetMACInternal: * @ifname: interface name to set MTU for @@ -282,8 +282,8 @@ virNetDevSetMACInternal(const char *ifname, } =20 =20 -#elif defined(SIOCSIFLLADDR) && defined(HAVE_STRUCT_IFREQ) && \ - HAVE_DECL_LINK_ADDR +#elif defined(SIOCSIFLLADDR) && defined(WITH_STRUCT_IFREQ) && \ + WITH_DECL_LINK_ADDR =20 =20 static int @@ -350,7 +350,7 @@ virNetDevSetMAC(const char *ifname, } =20 =20 -#if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCGIFHWADDR) && defined(WITH_STRUCT_IFREQ) /** * virNetDevGetMAC: * @ifname: interface name to set MTU for @@ -392,7 +392,7 @@ int virNetDevGetMAC(const char *ifname, #endif =20 =20 -#if defined(SIOCGIFMTU) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCGIFMTU) && defined(WITH_STRUCT_IFREQ) /** * virNetDevGetMTU: * @ifname: interface name get MTU for @@ -429,7 +429,7 @@ int virNetDevGetMTU(const char *ifname) #endif =20 =20 -#if defined(SIOCSIFMTU) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCSIFMTU) && defined(WITH_STRUCT_IFREQ) /** * virNetDevSetMTU: * @ifname: interface name to set MTU for @@ -534,7 +534,7 @@ int virNetDevSetNamespace(const char *ifname, pid_t pid= InNs) return 0; } =20 -#if defined(SIOCSIFNAME) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCSIFNAME) && defined(WITH_STRUCT_IFREQ) /** * virNetDevSetName: * @ifname: name of device @@ -552,7 +552,7 @@ int virNetDevSetName(const char* ifname, const char *ne= wifname) if ((fd =3D virNetDevSetupControl(ifname, &ifr)) < 0) return -1; =20 -# ifdef HAVE_STRUCT_IFREQ_IFR_NEWNAME +# ifdef WITH_STRUCT_IFREQ_IFR_NEWNAME if (virStrcpyStatic(ifr.ifr_newname, newifname) < 0) { virReportSystemError(ERANGE, _("Network interface name '%s' is too long"), @@ -583,7 +583,7 @@ int virNetDevSetName(const char* ifname, const char *ne= wifname) #endif =20 =20 -#if defined(SIOCSIFFLAGS) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCSIFFLAGS) && defined(WITH_STRUCT_IFREQ) static int virNetDevSetIFFlag(const char *ifname, int flag, bool val) { @@ -704,7 +704,7 @@ virNetDevSetRcvAllMulti(const char *ifname, } =20 =20 -#if defined(SIOCGIFFLAGS) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCGIFFLAGS) && defined(WITH_STRUCT_IFREQ) static int virNetDevGetIFFlag(const char *ifname, int flag, bool *val) { @@ -805,7 +805,7 @@ virNetDevGetRcvAllMulti(const char *ifname, return virNetDevGetIFFlag(ifname, VIR_IFF_ALLMULTI, receive); } =20 -#if defined(HAVE_IF_INDEXTONAME) +#if defined(WITH_IF_INDEXTONAME) char *virNetDevGetName(int ifindex) { char name[IFNAMSIZ]; @@ -840,7 +840,7 @@ char *virNetDevGetName(int ifindex) * * Returns 0 on success, -1 on failure */ -#if defined(SIOCGIFINDEX) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCGIFINDEX) && defined(WITH_STRUCT_IFREQ) int virNetDevGetIndex(const char *ifname, int *ifindex) { struct ifreq ifreq; @@ -867,7 +867,7 @@ int virNetDevGetIndex(const char *ifname, int *ifindex) return -1; } =20 -# ifdef HAVE_STRUCT_IFREQ_IFR_INDEX +# ifdef WITH_STRUCT_IFREQ_IFR_INDEX *ifindex =3D ifreq.ifr_index; # else *ifindex =3D ifreq.ifr_ifindex; @@ -885,7 +885,7 @@ int virNetDevGetIndex(const char *ifname G_GNUC_UNUSED, #endif /* ! SIOCGIFINDEX */ =20 =20 -#if defined(__linux__) && defined(HAVE_LIBNL) +#if defined(__linux__) && defined(WITH_LIBNL) /** * virNetDevGetMaster: * @ifname: name of interface we're interested in @@ -929,10 +929,10 @@ virNetDevGetMaster(const char *ifname G_GNUC_UNUSED, } =20 =20 -#endif /* defined(__linux__) && defined(HAVE_LIBNL) */ +#endif /* defined(__linux__) && defined(WITH_LIBNL) */ =20 =20 -#if defined(SIOCGIFVLAN) && defined(HAVE_STRUCT_IFREQ) && HAVE_DECL_GET_VL= AN_VID_CMD +#if defined(SIOCGIFVLAN) && defined(WITH_STRUCT_IFREQ) && WITH_DECL_GET_VL= AN_VID_CMD int virNetDevGetVLanID(const char *ifname, int *vlanid) { struct vlan_ioctl_args vlanargs =3D { @@ -985,7 +985,7 @@ int virNetDevGetVLanID(const char *ifname G_GNUC_UNUSED, * * Returns 1 if the config matches, 0 if the config does not match, or int= erface does not exist, -1 on error */ -#if defined(SIOCGIFHWADDR) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCGIFHWADDR) && defined(WITH_STRUCT_IFREQ) int virNetDevValidateConfig(const char *ifname, const virMacAddr *macaddr, int ifindex) { @@ -1473,7 +1473,7 @@ virNetDevSysfsFile(char **pf_sysfs_device_link G_GNUC= _UNUSED, =20 =20 #endif /* !__linux__ */ -#if defined(__linux__) && defined(HAVE_LIBNL) && defined(IFLA_VF_MAX) +#if defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX) =20 =20 static virMacAddr zeroMAC =3D { .addr =3D { 0, 0, 0, 0, 0, 0 } }; @@ -2266,7 +2266,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, } =20 =20 -#else /* defined(__linux__) && defined(HAVE_LIBNL) && defined(IFLA_VF_MAX= ) */ +#else /* defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX= ) */ =20 =20 int @@ -2309,7 +2309,7 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUS= ED, } =20 =20 -#endif /* defined(__linux__) && defined(HAVE_LIBNL) && defined(IFLA_VF_MAX= ) */ +#endif /* defined(__linux__) && defined(WITH_LIBNL) && defined(IFLA_VF_MAX= ) */ =20 VIR_ENUM_IMPL(virNetDevIfState, VIR_NETDEV_IF_STATE_LAST, @@ -2442,8 +2442,8 @@ virNetDevGetLinkInfo(const char *ifname, #endif /* defined(__linux__) */ =20 =20 -#if defined(SIOCADDMULTI) && defined(HAVE_STRUCT_IFREQ) && \ - defined(HAVE_STRUCT_IFREQ_IFR_HWADDR) +#if defined(SIOCADDMULTI) && defined(WITH_STRUCT_IFREQ) && \ + defined(WITH_STRUCT_IFREQ_IFR_HWADDR) /** * virNetDevAddMulti: * @ifname: interface name to which to add multicast MAC address @@ -2487,8 +2487,8 @@ int virNetDevAddMulti(const char *ifname G_GNUC_UNUSE= D, } #endif =20 -#if defined(SIOCDELMULTI) && defined(HAVE_STRUCT_IFREQ) && \ - defined(HAVE_STRUCT_IFREQ_IFR_HWADDR) +#if defined(SIOCDELMULTI) && defined(WITH_STRUCT_IFREQ) && \ + defined(WITH_STRUCT_IFREQ_IFR_HWADDR) /** * virNetDevDelMulti: * @ifname: interface name from which to delete the multicast MAC address @@ -2780,7 +2780,7 @@ int virNetDevGetRxFilter(const char *ifname, return ret; } =20 -#if defined(SIOCETHTOOL) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCETHTOOL) && defined(WITH_STRUCT_IFREQ) =20 /** * virNetDevRDMAFeature @@ -2912,28 +2912,28 @@ virNetDevGetEthtoolFeatures(virBitmapPtr bitmap, {ETHTOOL_GTXCSUM, VIR_NET_DEV_FEAT_GTXCSUM}, {ETHTOOL_GSG, VIR_NET_DEV_FEAT_GSG}, {ETHTOOL_GTSO, VIR_NET_DEV_FEAT_GTSO}, -# if HAVE_DECL_ETHTOOL_GGSO +# if WITH_DECL_ETHTOOL_GGSO {ETHTOOL_GGSO, VIR_NET_DEV_FEAT_GGSO}, # endif -# if HAVE_DECL_ETHTOOL_GGRO +# if WITH_DECL_ETHTOOL_GGRO {ETHTOOL_GGRO, VIR_NET_DEV_FEAT_GGRO}, # endif }; =20 -# if HAVE_DECL_ETHTOOL_GFLAGS +# if WITH_DECL_ETHTOOL_GFLAGS /* ethtool masks */ struct virNetDevEthtoolFeatureCmd flags[] =3D { -# if HAVE_DECL_ETH_FLAG_LRO +# if WITH_DECL_ETH_FLAG_LRO {ETH_FLAG_LRO, VIR_NET_DEV_FEAT_LRO}, # endif -# if HAVE_DECL_ETH_FLAG_TXVLAN +# if WITH_DECL_ETH_FLAG_TXVLAN {ETH_FLAG_RXVLAN, VIR_NET_DEV_FEAT_RXVLAN}, {ETH_FLAG_TXVLAN, VIR_NET_DEV_FEAT_TXVLAN}, # endif -# if HAVE_DECL_ETH_FLAG_NTUBLE +# if WITH_DECL_ETH_FLAG_NTUBLE {ETH_FLAG_NTUPLE, VIR_NET_DEV_FEAT_NTUPLE}, # endif -# if HAVE_DECL_ETH_FLAG_RXHASH +# if WITH_DECL_ETH_FLAG_RXHASH {ETH_FLAG_RXHASH, VIR_NET_DEV_FEAT_RXHASH}, # endif }; @@ -2945,7 +2945,7 @@ virNetDevGetEthtoolFeatures(virBitmapPtr bitmap, ignore_value(virBitmapSetBit(bitmap, ethtool_cmds[i].feat)); } =20 -# if HAVE_DECL_ETHTOOL_GFLAGS +# if WITH_DECL_ETHTOOL_GFLAGS cmd.cmd =3D ETHTOOL_GFLAGS; if (virNetDevFeatureAvailable(fd, ifr, &cmd)) { for (i =3D 0; i < G_N_ELEMENTS(flags); i++) { @@ -2957,7 +2957,7 @@ virNetDevGetEthtoolFeatures(virBitmapPtr bitmap, } =20 =20 -# if HAVE_DECL_DEVLINK_CMD_ESWITCH_GET +# if WITH_DECL_DEVLINK_CMD_ESWITCH_GET =20 /** * virNetDevGetFamilyId: @@ -3121,7 +3121,7 @@ virNetDevSwitchdevFeature(const char *ifname G_GNUC_U= NUSED, # endif =20 =20 -# if HAVE_DECL_ETHTOOL_GFEATURES +# if WITH_DECL_ETHTOOL_GFEATURES /** * virNetDevGFeatureAvailable * This function checks for the availability of a network device gfeature @@ -3172,7 +3172,7 @@ virNetDevGetEthtoolGFeatures(virBitmapPtr bitmap G_GN= UC_UNUSED, # endif =20 =20 -# if HAVE_DECL_ETHTOOL_SCOALESCE && HAVE_DECL_ETHTOOL_GCOALESCE +# if WITH_DECL_ETHTOOL_SCOALESCE && WITH_DECL_ETHTOOL_GCOALESCE /** * virNetDevSetCoalesce: * @ifname: interface name to modify diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 55e3948afd..5f581323ed 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -25,11 +25,11 @@ #include "virnetdevvlan.h" #include "virenum.h" =20 -#ifdef HAVE_NET_IF_H +#ifdef WITH_NET_IF_H # include #endif =20 -#ifdef HAVE_STRUCT_IFREQ +#ifdef WITH_STRUCT_IFREQ typedef struct ifreq virIfreq; #else typedef void virIfreq; diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index ccac97e8d0..9fec770fb6 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -27,12 +27,12 @@ #include "virstring.h" #include "virsocket.h" =20 -#ifdef HAVE_NET_IF_H +#ifdef WITH_NET_IF_H # include #endif =20 #ifdef __linux__ -# if defined(HAVE_LIBNL) +# if defined(WITH_LIBNL) # include "virnetlink.h" # endif # include @@ -62,7 +62,7 @@ # define MS_TO_JIFFIES(ms) (((ms)*HZ)/1000) #endif =20 -#if defined(HAVE_BSD_BRIDGE_MGMT) +#if defined(WITH_BSD_BRIDGE_MGMT) # include # include #endif @@ -71,7 +71,7 @@ =20 VIR_LOG_INIT("util.netdevbridge"); =20 -#if defined(HAVE_BSD_BRIDGE_MGMT) +#if defined(WITH_BSD_BRIDGE_MGMT) static int virNetDevBridgeCmd(const char *brname, u_long op, void *arg, @@ -103,7 +103,7 @@ static int virNetDevBridgeCmd(const char *brname, } #endif =20 -#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__) +#if defined(WITH_STRUCT_IFREQ) && defined(__linux__) /* * Bridge parameters can be set via sysfs on newish kernels, * or by ioctl on older kernels. Perhaps we could just use @@ -412,7 +412,7 @@ virNetDevBridgePortSetIsolated(const char *brname G_GNU= C_UNUSED, * * Returns 0 in case of success or -1 on failure */ -#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDBR) +#if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDBR) static int virNetDevBridgeCreateWithIoctl(const char *brname, const virMacAddr *mac) @@ -441,7 +441,7 @@ virNetDevBridgeCreateWithIoctl(const char *brname, } #endif =20 -#if defined(__linux__) && defined(HAVE_LIBNL) +#if defined(__linux__) && defined(WITH_LIBNL) int virNetDevBridgeCreate(const char *brname, const virMacAddr *mac) @@ -454,7 +454,7 @@ virNetDevBridgeCreate(const char *brname, =20 =20 if (virNetlinkNewLink(brname, "bridge", &data, &error) < 0) { -# if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDBR) +# if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDBR) if (error =3D=3D -EOPNOTSUPP) { /* fallback to ioctl if netlink doesn't support creating bridg= es */ return virNetDevBridgeCreateWithIoctl(brname, mac); @@ -471,7 +471,7 @@ virNetDevBridgeCreate(const char *brname, } =20 =20 -#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDBR) +#elif defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDBR) int virNetDevBridgeCreate(const char *brname, const virMacAddr *mac) @@ -480,7 +480,7 @@ virNetDevBridgeCreate(const char *brname, } =20 =20 -#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCIFCREATE2) +#elif defined(WITH_STRUCT_IFREQ) && defined(SIOCIFCREATE2) int virNetDevBridgeCreate(const char *brname, const virMacAddr *mac) @@ -530,7 +530,7 @@ virNetDevBridgeCreate(const char *brname, * * Returns 0 in case of success or an errno code in case of failure. */ -#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELBR) +#if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRDELBR) static int virNetDevBridgeDeleteWithIoctl(const char *brname) { @@ -552,7 +552,7 @@ virNetDevBridgeDeleteWithIoctl(const char *brname) #endif =20 =20 -#if defined(__linux__) && defined(HAVE_LIBNL) +#if defined(__linux__) && defined(WITH_LIBNL) int virNetDevBridgeDelete(const char *brname) { @@ -560,7 +560,7 @@ virNetDevBridgeDelete(const char *brname) * deleting a bridge even if it is currently IFF_UP. fallback to * using ioctl(SIOCBRDELBR) if netlink fails with EOPNOTSUPP. */ -# if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELBR) +# if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRDELBR) return virNetlinkDelLink(brname, virNetDevBridgeDeleteWithIoctl); # else return virNetlinkDelLink(brname, NULL); @@ -568,7 +568,7 @@ virNetDevBridgeDelete(const char *brname) } =20 =20 -#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELBR) +#elif defined(WITH_STRUCT_IFREQ) && defined(SIOCBRDELBR) int virNetDevBridgeDelete(const char *brname) { @@ -576,7 +576,7 @@ virNetDevBridgeDelete(const char *brname) } =20 =20 -#elif defined(HAVE_STRUCT_IFREQ) && defined(SIOCIFDESTROY) +#elif defined(WITH_STRUCT_IFREQ) && defined(SIOCIFDESTROY) int virNetDevBridgeDelete(const char *brname) { @@ -613,7 +613,7 @@ int virNetDevBridgeDelete(const char *brname G_GNUC_UNU= SED) * * Returns 0 in case of success or an errno code in case of failure. */ -#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRADDIF) +#if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRADDIF) int virNetDevBridgeAddPort(const char *brname, const char *ifname) { @@ -637,7 +637,7 @@ int virNetDevBridgeAddPort(const char *brname, =20 return 0; } -#elif defined(HAVE_BSD_BRIDGE_MGMT) +#elif defined(WITH_BSD_BRIDGE_MGMT) int virNetDevBridgeAddPort(const char *brname, const char *ifname) { @@ -678,7 +678,7 @@ int virNetDevBridgeAddPort(const char *brname, * * Returns 0 in case of success or an errno code in case of failure. */ -#if defined(HAVE_STRUCT_IFREQ) && defined(SIOCBRDELIF) +#if defined(WITH_STRUCT_IFREQ) && defined(SIOCBRDELIF) int virNetDevBridgeRemovePort(const char *brname, const char *ifname) { @@ -703,7 +703,7 @@ int virNetDevBridgeRemovePort(const char *brname, =20 return 0; } -#elif defined(HAVE_BSD_BRIDGE_MGMT) +#elif defined(WITH_BSD_BRIDGE_MGMT) int virNetDevBridgeRemovePort(const char *brname, const char *ifname) { @@ -736,7 +736,7 @@ int virNetDevBridgeRemovePort(const char *brname, #endif =20 =20 -#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__) +#if defined(WITH_STRUCT_IFREQ) && defined(__linux__) /** * virNetDevBridgeSetSTPDelay: * @brname: the bridge name @@ -830,7 +830,7 @@ int virNetDevBridgeGetSTP(const char *brname, =20 return ret; } -#elif defined(HAVE_BSD_BRIDGE_MGMT) +#elif defined(WITH_BSD_BRIDGE_MGMT) int virNetDevBridgeSetSTPDelay(const char *brname, int delay) { @@ -911,7 +911,7 @@ int virNetDevBridgeGetSTP(const char *brname, } #endif =20 -#if defined(HAVE_STRUCT_IFREQ) && defined(__linux__) +#if defined(WITH_STRUCT_IFREQ) && defined(__linux__) /** * virNetDevBridgeGetVlanFiltering: * @brname: the bridge device name @@ -976,7 +976,7 @@ virNetDevBridgeSetVlanFiltering(const char *brname G_GN= UC_UNUSED, #endif =20 =20 -#if defined(__linux__) && defined(HAVE_LIBNL) +#if defined(__linux__) && defined(WITH_LIBNL) =20 # ifndef NTF_SELF # define NTF_SELF 0x02 diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index 8c66baa884..1e7e64f8f3 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -28,14 +28,14 @@ #include "vircommand.h" #include "viralloc.h" =20 -#if HAVE_GETIFADDRS +#if WITH_GETIFADDRS # include #endif =20 #ifndef WIN32 # include #endif -#ifdef HAVE_NET_IF_H +#ifdef WITH_NET_IF_H # include #endif #include @@ -51,7 +51,7 @@ =20 VIR_LOG_INIT("util.netdevip"); =20 -#if defined(__linux__) && defined(HAVE_LIBNL) +#if defined(__linux__) && defined(WITH_LIBNL) =20 static int virNetDevGetIPAddressBinary(virSocketAddr *addr, void **data, size_t *len) @@ -676,7 +676,7 @@ virNetDevIPCheckIPv6Forwarding(void) return valid; } =20 -#else /* defined(__linux__) && defined(HAVE_LIBNL) */ +#else /* defined(__linux__) && defined(WITH_LIBNL) */ =20 =20 int @@ -815,7 +815,7 @@ virNetDevIPCheckIPv6Forwarding(void) return true; } =20 -#endif /* defined(__linux__) && defined(HAVE_LIBNL) */ +#endif /* defined(__linux__) && defined(WITH_LIBNL) */ =20 =20 /** @@ -828,7 +828,7 @@ virNetDevIPCheckIPv6Forwarding(void) * * Returns 0 on success, -errno on failure. */ -#if defined(SIOCGIFADDR) && defined(HAVE_STRUCT_IFREQ) +#if defined(SIOCGIFADDR) && defined(WITH_STRUCT_IFREQ) static int virNetDevGetIPv4AddressIoctl(const char *ifname, virSocketAddrPtr addr) @@ -878,7 +878,7 @@ virNetDevGetIPv4AddressIoctl(const char *ifname G_GNUC_= UNUSED, * * Returns 0 on success, -1 on failure, -2 on unsupported. */ -#if HAVE_GETIFADDRS +#if WITH_GETIFADDRS static int virNetDevGetifaddrsAddress(const char *ifname, virSocketAddrPtr addr) @@ -925,7 +925,7 @@ virNetDevGetifaddrsAddress(const char *ifname, return ret; } =20 -#else /* ! HAVE_GETIFADDRS */ +#else /* ! WITH_GETIFADDRS */ =20 static int virNetDevGetifaddrsAddress(const char *ifname G_GNUC_UNUSED, diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index dcea93a5fe..47c4f5120c 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -47,7 +47,7 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, # include =20 /* Older kernels lacked this enum value. */ -# if !HAVE_DECL_MACVLAN_MODE_PASSTHRU +# if !WITH_DECL_MACVLAN_MODE_PASSTHRU # define MACVLAN_MODE_PASSTHRU 8 # endif =20 diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 931be9e36d..7dd7599747 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -36,7 +36,7 @@ #ifndef WIN32 # include #endif -#ifdef HAVE_NET_IF_H +#ifdef WITH_NET_IF_H # include #endif #include @@ -46,7 +46,7 @@ # include # include #endif -#if defined(HAVE_GETIFADDRS) && defined(AF_LINK) +#if defined(WITH_GETIFADDRS) && defined(AF_LINK) # include #endif =20 @@ -831,7 +831,7 @@ virNetDevTapInterfaceStats(const char *ifname, _("/proc/net/dev: Interface not found")); return -1; } -#elif defined(HAVE_GETIFADDRS) && defined(AF_LINK) +#elif defined(WITH_GETIFADDRS) && defined(AF_LINK) int virNetDevTapInterfaceStats(const char *ifname, virDomainInterfaceStatsPtr stats, diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index 652ed2c1c6..be444baa56 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -40,7 +40,7 @@ VIR_LOG_INIT("util.netlink"); =20 #define NETLINK_ACK_TIMEOUT_S (2*1000) =20 -#if defined(__linux__) && defined(HAVE_LIBNL) +#if defined(__linux__) && defined(WITH_LIBNL) /* State for a single netlink event handle */ struct virNetlinkEventHandle { int watch; diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index e888857601..40f27524f6 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -22,7 +22,7 @@ #include "internal.h" #include "virmacaddr.h" =20 -#if defined(__linux__) && defined(HAVE_LIBNL) +#if defined(__linux__) && defined(WITH_LIBNL) =20 # include =20 diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 75d5628cff..ba1e4363d6 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -53,7 +53,7 @@ VIR_LOG_INIT("util.numa"); =20 =20 -#if HAVE_NUMAD +#if WITH_NUMAD char * virNumaGetAutoPlacementAdvice(unsigned short vcpus, unsigned long long balloon) @@ -76,7 +76,7 @@ virNumaGetAutoPlacementAdvice(unsigned short vcpus, =20 return output; } -#else /* !HAVE_NUMAD */ +#else /* !WITH_NUMAD */ char * virNumaGetAutoPlacementAdvice(unsigned short vcpus G_GNUC_UNUSED, unsigned long long balloon G_GNUC_UNUSED) @@ -85,7 +85,7 @@ virNumaGetAutoPlacementAdvice(unsigned short vcpus G_GNUC= _UNUSED, _("numad is not available on this host")); return NULL; } -#endif /* !HAVE_NUMAD */ +#endif /* !WITH_NUMAD */ =20 #if WITH_NUMACTL int @@ -414,7 +414,7 @@ virNumaGetMaxCPUs(void) } =20 =20 -#if WITH_NUMACTL && HAVE_NUMA_BITMASK_ISBITSET +#if WITH_NUMACTL && WITH_NUMA_BITMASK_ISBITSET /** * virNumaNodeIsAvailable: * @node: node to check @@ -484,7 +484,7 @@ virNumaGetDistances(int node, return 0; } =20 -#else /* !(WITH_NUMACTL && HAVE_NUMA_BITMASK_ISBITSET) */ +#else /* !(WITH_NUMACTL && WITH_NUMA_BITMASK_ISBITSET) */ =20 bool virNumaNodeIsAvailable(int node) @@ -509,7 +509,7 @@ virNumaGetDistances(int node G_GNUC_UNUSED, VIR_DEBUG("NUMA distance information isn't available on this host"); return 0; } -#endif /* !(WITH_NUMACTL && HAVE_NUMA_BITMASK_ISBITSET) */ +#endif /* !(WITH_NUMACTL && WITH_NUMA_BITMASK_ISBITSET) */ =20 =20 /* currently all the huge page stuff below is linux only */ diff --git a/src/util/virperf.c b/src/util/virperf.c index 90d60c04fb..2e95509caf 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -21,7 +21,7 @@ #ifndef WIN32 # include #endif -#if defined HAVE_SYS_SYSCALL_H +#if defined WITH_SYS_SYSCALL_H # include #endif =20 @@ -67,7 +67,7 @@ struct _virPerf { struct virPerfEvent events[VIR_PERF_EVENT_LAST]; }; =20 -#if defined(__linux__) && defined(HAVE_SYS_SYSCALL_H) +#if defined(__linux__) && defined(WITH_SYS_SYSCALL_H) =20 # include =20 diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 6f03627c42..ea9d3a35ef 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -28,18 +28,18 @@ # include #endif #include -#if HAVE_SYS_MOUNT_H +#if WITH_SYS_MOUNT_H # include #endif -#if HAVE_SETRLIMIT +#if WITH_SETRLIMIT # include # include #endif -#if HAVE_SCHED_SETSCHEDULER +#if WITH_SCHED_SETSCHEDULER # include #endif =20 -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || HAVE_BSD_CPU_AF= FINITY +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || WITH_BSD_CPU_AF= FINITY # include #endif =20 @@ -48,7 +48,7 @@ # include #endif =20 -#if HAVE_BSD_CPU_AFFINITY +#if WITH_BSD_CPU_AFFINITY # include #endif =20 @@ -92,7 +92,7 @@ VIR_LOG_INIT("util.process"); # endif # endif =20 -# ifndef HAVE_SETNS +# ifndef WITH_SETNS # if defined(__NR_setns) # include =20 @@ -439,7 +439,7 @@ int virProcessKillPainfully(pid_t pid, bool force) return virProcessKillPainfullyDelay(pid, force, 0); } =20 -#if HAVE_SCHED_GETAFFINITY +#if WITH_SCHED_GETAFFINITY =20 int virProcessSetAffinity(pid_t pid, virBitmapPtr map) { @@ -530,7 +530,7 @@ virProcessGetAffinity(pid_t pid) return ret; } =20 -#elif defined(HAVE_BSD_CPU_AFFINITY) +#elif defined(WITH_BSD_CPU_AFFINITY) =20 int virProcessSetAffinity(pid_t pid, virBitmapPtr map) @@ -579,7 +579,7 @@ virProcessGetAffinity(pid_t pid) return ret; } =20 -#else /* HAVE_SCHED_GETAFFINITY */ +#else /* WITH_SCHED_GETAFFINITY */ =20 int virProcessSetAffinity(pid_t pid G_GNUC_UNUSED, virBitmapPtr map G_GNUC_UNUSED) @@ -596,7 +596,7 @@ virProcessGetAffinity(pid_t pid G_GNUC_UNUSED) _("Process CPU affinity is not supported on this = platform")); return NULL; } -#endif /* HAVE_SCHED_GETAFFINITY */ +#endif /* WITH_SCHED_GETAFFINITY */ =20 =20 int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids) @@ -708,7 +708,7 @@ int virProcessSetNamespaces(size_t nfdlist, return 0; } =20 -#if HAVE_PRLIMIT +#if WITH_PRLIMIT static int virProcessPrLimit(pid_t pid, int resource, @@ -717,7 +717,7 @@ virProcessPrLimit(pid_t pid, { return prlimit(pid, resource, new_limit, old_limit); } -#elif HAVE_SETRLIMIT +#elif WITH_SETRLIMIT static int virProcessPrLimit(pid_t pid G_GNUC_UNUSED, int resource G_GNUC_UNUSED, @@ -729,7 +729,7 @@ virProcessPrLimit(pid_t pid G_GNUC_UNUSED, } #endif =20 -#if HAVE_SETRLIMIT && defined(RLIMIT_MEMLOCK) +#if WITH_SETRLIMIT && defined(RLIMIT_MEMLOCK) int virProcessSetMaxMemLock(pid_t pid, unsigned long long bytes) { @@ -769,7 +769,7 @@ virProcessSetMaxMemLock(pid_t pid, unsigned long long b= ytes) =20 return 0; } -#else /* ! (HAVE_SETRLIMIT && defined(RLIMIT_MEMLOCK)) */ +#else /* ! (WITH_SETRLIMIT && defined(RLIMIT_MEMLOCK)) */ int virProcessSetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsigned long long bytes) { @@ -779,9 +779,9 @@ virProcessSetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsign= ed long long bytes) virReportSystemError(ENOSYS, "%s", _("Not supported on this platform")= ); return -1; } -#endif /* ! (HAVE_SETRLIMIT && defined(RLIMIT_MEMLOCK)) */ +#endif /* ! (WITH_SETRLIMIT && defined(RLIMIT_MEMLOCK)) */ =20 -#if HAVE_GETRLIMIT && defined(RLIMIT_MEMLOCK) +#if WITH_GETRLIMIT && defined(RLIMIT_MEMLOCK) int virProcessGetMaxMemLock(pid_t pid, unsigned long long *bytes) @@ -820,7 +820,7 @@ virProcessGetMaxMemLock(pid_t pid, =20 return 0; } -#else /* ! (HAVE_GETRLIMIT && defined(RLIMIT_MEMLOCK)) */ +#else /* ! (WITH_GETRLIMIT && defined(RLIMIT_MEMLOCK)) */ int virProcessGetMaxMemLock(pid_t pid G_GNUC_UNUSED, unsigned long long *bytes) @@ -831,9 +831,9 @@ virProcessGetMaxMemLock(pid_t pid G_GNUC_UNUSED, virReportSystemError(ENOSYS, "%s", _("Not supported on this platform")= ); return -1; } -#endif /* ! (HAVE_GETRLIMIT && defined(RLIMIT_MEMLOCK)) */ +#endif /* ! (WITH_GETRLIMIT && defined(RLIMIT_MEMLOCK)) */ =20 -#if HAVE_SETRLIMIT && defined(RLIMIT_NPROC) +#if WITH_SETRLIMIT && defined(RLIMIT_NPROC) int virProcessSetMaxProcesses(pid_t pid, unsigned int procs) { @@ -861,7 +861,7 @@ virProcessSetMaxProcesses(pid_t pid, unsigned int procs) } return 0; } -#else /* ! (HAVE_SETRLIMIT && defined(RLIMIT_NPROC)) */ +#else /* ! (WITH_SETRLIMIT && defined(RLIMIT_NPROC)) */ int virProcessSetMaxProcesses(pid_t pid G_GNUC_UNUSED, unsigned int procs) { @@ -871,9 +871,9 @@ virProcessSetMaxProcesses(pid_t pid G_GNUC_UNUSED, unsi= gned int procs) virReportSystemError(ENOSYS, "%s", _("Not supported on this platform")= ); return -1; } -#endif /* ! (HAVE_SETRLIMIT && defined(RLIMIT_NPROC)) */ +#endif /* ! (WITH_SETRLIMIT && defined(RLIMIT_NPROC)) */ =20 -#if HAVE_SETRLIMIT && defined(RLIMIT_NOFILE) +#if WITH_SETRLIMIT && defined(RLIMIT_NOFILE) int virProcessSetMaxFiles(pid_t pid, unsigned int files) { @@ -909,7 +909,7 @@ virProcessSetMaxFiles(pid_t pid, unsigned int files) } return 0; } -#else /* ! (HAVE_SETRLIMIT && defined(RLIMIT_NOFILE)) */ +#else /* ! (WITH_SETRLIMIT && defined(RLIMIT_NOFILE)) */ int virProcessSetMaxFiles(pid_t pid G_GNUC_UNUSED, unsigned int files) { @@ -919,9 +919,9 @@ virProcessSetMaxFiles(pid_t pid G_GNUC_UNUSED, unsigned= int files) virReportSystemError(ENOSYS, "%s", _("Not supported on this platform")= ); return -1; } -#endif /* ! (HAVE_SETRLIMIT && defined(RLIMIT_NOFILE)) */ +#endif /* ! (WITH_SETRLIMIT && defined(RLIMIT_NOFILE)) */ =20 -#if HAVE_SETRLIMIT && defined(RLIMIT_CORE) +#if WITH_SETRLIMIT && defined(RLIMIT_CORE) int virProcessSetMaxCoreSize(pid_t pid, unsigned long long bytes) { @@ -946,7 +946,7 @@ virProcessSetMaxCoreSize(pid_t pid, unsigned long long = bytes) } return 0; } -#else /* ! (HAVE_SETRLIMIT && defined(RLIMIT_CORE)) */ +#else /* ! (WITH_SETRLIMIT && defined(RLIMIT_CORE)) */ int virProcessSetMaxCoreSize(pid_t pid G_GNUC_UNUSED, unsigned long long bytes) @@ -957,7 +957,7 @@ virProcessSetMaxCoreSize(pid_t pid G_GNUC_UNUSED, virReportSystemError(ENOSYS, "%s", _("Not supported on this platform")= ); return -1; } -#endif /* ! (HAVE_SETRLIMIT && defined(RLIMIT_CORE)) */ +#endif /* ! (WITH_SETRLIMIT && defined(RLIMIT_CORE)) */ =20 =20 #ifdef __linux__ @@ -1419,7 +1419,7 @@ virProcessExitWithStatus(int status) exit(value); } =20 -#if HAVE_SCHED_SETSCHEDULER +#if WITH_SCHED_SETSCHEDULER =20 static int virProcessSchedTranslatePolicy(virProcessSchedPolicy policy) @@ -1515,7 +1515,7 @@ virProcessSetScheduler(pid_t pid, return 0; } =20 -#else /* ! HAVE_SCHED_SETSCHEDULER */ +#else /* ! WITH_SCHED_SETSCHEDULER */ =20 int virProcessSetScheduler(pid_t pid G_GNUC_UNUSED, @@ -1531,4 +1531,4 @@ virProcessSetScheduler(pid_t pid G_GNUC_UNUSED, return -1; } =20 -#endif /* !HAVE_SCHED_SETSCHEDULER */ +#endif /* !WITH_SCHED_SETSCHEDULER */ diff --git a/src/util/virstring.c b/src/util/virstring.c index c31f2ede8f..de2ef964f4 100644 --- a/src/util/virstring.c +++ b/src/util/virstring.c @@ -20,7 +20,7 @@ =20 #include #include -#ifdef HAVE_XLOCALE_H +#ifdef WITH_XLOCALE_H # include #endif =20 @@ -531,7 +531,7 @@ virStrToLong_ullp(char const *s, char **end_ptr, int ba= se, } =20 /* In case thread-safe locales are available */ -#if HAVE_NEWLOCALE +#if WITH_NEWLOCALE =20 typedef locale_t virLocale; static virLocale virLocaleRaw; @@ -575,7 +575,7 @@ virLocaleFixupRadix(char **strp G_GNUC_UNUSED) { } =20 -#else /* !HAVE_NEWLOCALE */ +#else /* !WITH_NEWLOCALE */ =20 typedef int virLocale; =20 @@ -606,7 +606,7 @@ virLocaleFixupRadix(char **strp) } } =20 -#endif /* !HAVE_NEWLOCALE */ +#endif /* !WITH_NEWLOCALE */ =20 =20 /** diff --git a/src/util/virthread.c b/src/util/virthread.c index 64013b575c..7f23399835 100644 --- a/src/util/virthread.c +++ b/src/util/virthread.c @@ -29,7 +29,7 @@ =20 #include #include -#if HAVE_SYS_SYSCALL_H +#if WITH_SYS_SYSCALL_H # include #endif =20 @@ -297,7 +297,7 @@ bool virThreadIsSelf(virThreadPtr thread) * the pthread_self() id on Linux. */ unsigned long long virThreadSelfID(void) { -#if defined(HAVE_SYS_SYSCALL_H) && defined(SYS_gettid) && defined(__linux_= _) +#if defined(WITH_SYS_SYSCALL_H) && defined(SYS_gettid) && defined(__linux_= _) pid_t tid =3D syscall(SYS_gettid); return tid; #else diff --git a/src/util/virutil.c b/src/util/virutil.c index 8639176fdc..df76821670 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -37,7 +37,7 @@ =20 #include =20 -#ifdef HAVE_GETPWUID_R +#ifdef WITH_GETPWUID_R # include # include #endif @@ -592,7 +592,7 @@ char *virGetUserRuntimeDirectory(void) } =20 =20 -#ifdef HAVE_GETPWUID_R +#ifdef WITH_GETPWUID_R /* Look up fields from the user database for the given user. On * error, set errno, report the error if not instructed otherwise via @qui= et, * and return -1. */ @@ -1027,7 +1027,7 @@ virSetUIDGID(uid_t uid, gid_t gid, gid_t *groups G_GN= UC_UNUSED, return -1; } =20 -# if HAVE_SETGROUPS +# if WITH_SETGROUPS if (gid !=3D (gid_t)-1 && setgroups(ngroups, groups) < 0) { virReportSystemError(errno, "%s", _("cannot set supplemental groups")); @@ -1045,7 +1045,7 @@ virSetUIDGID(uid_t uid, gid_t gid, gid_t *groups G_GN= UC_UNUSED, return 0; } =20 -#else /* ! HAVE_GETPWUID_R */ +#else /* ! WITH_GETPWUID_R */ =20 int virGetGroupList(uid_t uid G_GNUC_UNUSED, gid_t gid G_GNUC_UNUSED, @@ -1087,7 +1087,7 @@ virGetUserShell(uid_t uid G_GNUC_UNUSED) return NULL; } =20 -# else /* !HAVE_GETPWUID_R && !WIN32 */ +# else /* !WITH_GETPWUID_R && !WIN32 */ char * virGetUserDirectoryByUID(uid_t uid G_GNUC_UNUSED) { @@ -1105,7 +1105,7 @@ virGetUserShell(uid_t uid G_GNUC_UNUSED) =20 return NULL; } -# endif /* ! HAVE_GETPWUID_R && ! WIN32 */ +# endif /* ! WITH_GETPWUID_R && ! WIN32 */ =20 char * virGetUserName(uid_t uid G_GNUC_UNUSED) @@ -1154,7 +1154,7 @@ virGetGroupName(gid_t gid G_GNUC_UNUSED) =20 return NULL; } -#endif /* HAVE_GETPWUID_R */ +#endif /* WITH_GETPWUID_R */ =20 #if WITH_CAPNG /* Set the real and effective uid and gid to the given values, while @@ -1911,19 +1911,19 @@ char *virGetPassword(void) static int virPipeImpl(int fds[2], bool nonblock, bool errreport) { -#ifdef HAVE_PIPE2 +#ifdef WITH_PIPE2 int rv; int flags =3D O_CLOEXEC; if (nonblock) flags |=3D O_NONBLOCK; rv =3D pipe2(fds, flags); -#else /* !HAVE_PIPE2 */ +#else /* !WITH_PIPE2 */ # ifdef WIN32 int rv =3D _pipe(fds, 4096, _O_BINARY); # else /* !WIN32 */ int rv =3D pipe(fds); # endif /* !WIN32 */ -#endif /* !HAVE_PIPE2 */ +#endif /* !WITH_PIPE2 */ =20 if (rv < 0) { if (errreport) @@ -1932,7 +1932,7 @@ virPipeImpl(int fds[2], bool nonblock, bool errreport) return rv; } =20 -#ifndef HAVE_PIPE2 +#ifndef WITH_PIPE2 if (nonblock) { if (virSetNonBlock(fds[0]) < 0 || virSetNonBlock(fds[1]) < 0) { @@ -1946,7 +1946,7 @@ virPipeImpl(int fds[2], bool nonblock, bool errreport) return -1; } } -#endif /* !HAVE_PIPE2 */ +#endif /* !WITH_PIPE2 */ =20 return 0; } diff --git a/src/util/virutil.h b/src/util/virutil.h index f3a2e2b80d..8b0e38e335 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -59,22 +59,22 @@ int virDiskNameToIndex(const char* str); char *virIndexToDiskName(int idx, const char *prefix); =20 /* No-op workarounds for functionality missing in mingw. */ -#ifndef HAVE_GETUID +#ifndef WITH_GETUID static inline int getuid(void) { return 0; } #endif =20 -#ifndef HAVE_GETEUID +#ifndef WITH_GETEUID static inline int geteuid(void) { return 0; } #endif =20 -#ifndef HAVE_GETGID +#ifndef WITH_GETGID static inline int getgid(void) { return 0; } #endif =20 -#ifndef HAVE_GETEGID +#ifndef WITH_GETEGID static inline int getegid(void) { return 0; } #endif diff --git a/src/util/virvsock.c b/src/util/virvsock.c index 2638c5095a..4bbbf78167 100644 --- a/src/util/virvsock.c +++ b/src/util/virvsock.c @@ -17,11 +17,11 @@ =20 #include =20 -#ifdef HAVE_SYS_IOCTL_H +#ifdef WITH_SYS_IOCTL_H # include #endif =20 -#if HAVE_DECL_VHOST_VSOCK_SET_GUEST_CID +#if WITH_DECL_VHOST_VSOCK_SET_GUEST_CID # include #endif =20 @@ -35,7 +35,7 @@ =20 VIR_LOG_INIT("util.vsock"); =20 -#if HAVE_DECL_VHOST_VSOCK_SET_GUEST_CID +#if WITH_DECL_VHOST_VSOCK_SET_GUEST_CID static int virVsockSetGuestCidQuiet(int fd, unsigned int guest_cid) diff --git a/tests/eventtest.c b/tests/eventtest.c index 4a23bd6e62..7a9c87b8cf 100644 --- a/tests/eventtest.c +++ b/tests/eventtest.c @@ -23,7 +23,7 @@ #include #include =20 -#if HAVE_MACH_CLOCK_ROUTINES +#if WITH_MACH_CLOCK_ROUTINES # include # include #endif diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c index a2ef9bed0b..c4d5db9a7b 100644 --- a/tests/libxlxml2domconfigtest.c +++ b/tests/libxlxml2domconfigtest.c @@ -180,7 +180,7 @@ mymain(void) =20 DO_TEST("basic-pv"); DO_TEST("basic-hvm"); -# ifdef HAVE_XEN_PVH +# ifdef WITH_XEN_PVH DO_TEST("basic-pvh"); # endif DO_TEST("cpu-shares-hvm"); diff --git a/tests/meson.build b/tests/meson.build index b5f6e2267a..8e0c3a428a 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -470,7 +470,7 @@ if conf.has('WITH_REMOTE') ] =20 nettls_sources =3D [ 'virnettlshelpers.c' ] - if conf.has('HAVE_LIBTASN1_H') + if conf.has('WITH_LIBTASN1_H') nettls_sources +=3D 'pkix_asn1_tab.c' endif =20 diff --git a/tests/securityselinuxhelper.c b/tests/securityselinuxhelper.c index 64d2b75740..14355d2166 100644 --- a/tests/securityselinuxhelper.c +++ b/tests/securityselinuxhelper.c @@ -23,7 +23,7 @@ * detected. */ =20 #include "virmock.h" -#if HAVE_LINUX_MAGIC_H +#if WITH_LINUX_MAGIC_H # include #endif #include diff --git a/tests/virfilemock.c b/tests/virfilemock.c index 802ee9b5f9..7c9174bdd9 100644 --- a/tests/virfilemock.c +++ b/tests/virfilemock.c @@ -21,7 +21,7 @@ #include #include #include -#if HAVE_LINUX_MAGIC_H +#if WITH_LINUX_MAGIC_H # include #endif #include diff --git a/tests/virfiletest.c b/tests/virfiletest.c index 1392536b74..3c1f2ce54e 100644 --- a/tests/virfiletest.c +++ b/tests/virfiletest.c @@ -31,7 +31,7 @@ =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 -#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R +#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R static int testFileCheckMounts(const char *prefix, char **gotmounts, size_t gotnmounts, @@ -91,7 +91,7 @@ static int testFileGetMountSubtree(const void *opaque) g_strfreev(gotmounts); return ret; } -#endif /* ! defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */ +#endif /* ! defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */ =20 struct testFileSanitizePathData { @@ -122,7 +122,7 @@ testFileSanitizePath(const void *opaque) } =20 =20 -#if HAVE_DECL_SEEK_HOLE && defined(__linux__) +#if WITH_DECL_SEEK_HOLE && defined(__linux__) =20 /* Create a sparse file. @offsets in KiB. */ static int @@ -234,7 +234,7 @@ holesSupported(void) return ret; } =20 -#else /* !HAVE_DECL_SEEK_HOLE || !defined(__linux__)*/ +#else /* !WITH_DECL_SEEK_HOLE || !defined(__linux__)*/ =20 static int makeSparseFile(const off_t offsets[] G_GNUC_UNUSED, @@ -250,7 +250,7 @@ holesSupported(void) return false; } =20 -#endif /* !HAVE_DECL_SEEK_HOLE || !defined(__linux__)*/ +#endif /* !WITH_DECL_SEEK_HOLE || !defined(__linux__)*/ =20 struct testFileInData { bool startData; /* whether the list of offsets starts with data se= ction */ @@ -356,7 +356,7 @@ mymain(void) int ret =3D 0; struct testFileSanitizePathData data1; =20 -#if defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R +#if defined WITH_MNTENT_H && defined WITH_GETMNTENT_R # define MTAB_PATH1 abs_srcdir "/virfiledata/mounts1.txt" # define MTAB_PATH2 abs_srcdir "/virfiledata/mounts2.txt" =20 @@ -386,7 +386,7 @@ mymain(void) DO_TEST_MOUNT_SUBTREE("/proc reverse", MTAB_PATH1, "/proc", wantmounts= 1rev, true); DO_TEST_MOUNT_SUBTREE("/etc/aliases", MTAB_PATH2, "/etc/aliases", want= mounts2a, false); DO_TEST_MOUNT_SUBTREE("/etc/aliases.db", MTAB_PATH2, "/etc/aliases.db"= , wantmounts2b, false); -#endif /* ! defined HAVE_MNTENT_H && defined HAVE_GETMNTENT_R */ +#endif /* ! defined WITH_MNTENT_H && defined WITH_GETMNTENT_R */ =20 #define DO_TEST_SANITIZE_PATH(PATH, EXPECT) \ do { \ diff --git a/tests/virmock.h b/tests/virmock.h index 95feeb0d92..a812cfe08b 100644 --- a/tests/virmock.h +++ b/tests/virmock.h @@ -21,7 +21,7 @@ =20 #pragma once =20 -#if HAVE_DLFCN_H +#if WITH_DLFCN_H # include #endif =20 diff --git a/tests/virmockstathelpers.c b/tests/virmockstathelpers.c index 2c3715ae0c..1a58025a0a 100644 --- a/tests/virmockstathelpers.c +++ b/tests/virmockstathelpers.c @@ -68,28 +68,28 @@ =20 =20 =20 -#if defined(HAVE_STAT) && !defined(HAVE___XSTAT) && !defined(HAVE_STAT64) +#if defined(WITH_STAT) && !defined(WITH___XSTAT) && !defined(WITH_STAT64) # define MOCK_STAT #endif -#if defined(HAVE_STAT64) && !defined(HAVE___XSTAT64) +#if defined(WITH_STAT64) && !defined(WITH___XSTAT64) # define MOCK_STAT64 #endif -#if defined(HAVE___XSTAT) && !defined(HAVE___XSTAT64) +#if defined(WITH___XSTAT) && !defined(WITH___XSTAT64) # define MOCK___XSTAT #endif -#if defined(HAVE___XSTAT64) +#if defined(WITH___XSTAT64) # define MOCK___XSTAT64 #endif -#if defined(HAVE_LSTAT) && !defined(HAVE___LXSTAT) && !defined(HAVE_LSTAT6= 4) +#if defined(WITH_LSTAT) && !defined(WITH___LXSTAT) && !defined(WITH_LSTAT6= 4) # define MOCK_LSTAT #endif -#if defined(HAVE_LSTAT64) && !defined(HAVE___LXSTAT64) +#if defined(WITH_LSTAT64) && !defined(WITH___LXSTAT64) # define MOCK_LSTAT64 #endif -#if defined(HAVE___LXSTAT) && !defined(HAVE___LXSTAT64) +#if defined(WITH___LXSTAT) && !defined(WITH___LXSTAT64) # define MOCK___LXSTAT #endif -#if defined(HAVE___LXSTAT64) +#if defined(WITH___LXSTAT64) # define MOCK___LXSTAT64 #endif =20 diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 7d2ad36aae..b8baca0c23 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -20,7 +20,7 @@ =20 #include #include -#ifdef HAVE_IFADDRS_H +#ifdef WITH_IFADDRS_H # include #endif =20 @@ -37,7 +37,7 @@ =20 VIR_LOG_INIT("tests.netsockettest"); =20 -#if HAVE_IFADDRS_H +#if WITH_IFADDRS_H # define BASE_PORT 5672 =20 static int @@ -522,7 +522,7 @@ static int mymain(void) { int ret =3D 0; -#ifdef HAVE_IFADDRS_H +#ifdef WITH_IFADDRS_H bool hasIPv4, hasIPv6; int freePort; #endif @@ -533,7 +533,7 @@ mymain(void) =20 virEventRegisterDefaultImpl(); =20 -#ifdef HAVE_IFADDRS_H +#ifdef WITH_IFADDRS_H if (checkProtocols(&hasIPv4, &hasIPv6, &freePort) < 0) { fprintf(stderr, "Cannot identify IPv4/6 availability\n"); return EXIT_FAILURE; diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index 9860e0ec3e..26793545c1 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -30,7 +30,7 @@ #include "vircommand.h" #include "virsocket.h" =20 -#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 +#if !defined WIN32 && WITH_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 =20 # include "rpc/virnettlscontext.h" =20 diff --git a/tests/virnettlshelpers.c b/tests/virnettlshelpers.c index 979afed307..e0a4771894 100644 --- a/tests/virnettlshelpers.c +++ b/tests/virnettlshelpers.c @@ -27,7 +27,7 @@ #include "virsocketaddr.h" #include "virutil.h" =20 -#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 +#if !defined WIN32 && WITH_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 =20 # define VIR_FROM_THIS VIR_FROM_RPC =20 diff --git a/tests/virnettlshelpers.h b/tests/virnettlshelpers.h index 4c6f5e8c31..cdc92a17f8 100644 --- a/tests/virnettlshelpers.h +++ b/tests/virnettlshelpers.h @@ -21,7 +21,7 @@ #include #include =20 -#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 +#if !defined WIN32 && WITH_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 =20 # include =20 diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c index ebb90ad5a2..ccb5cad198 100644 --- a/tests/virnettlssessiontest.c +++ b/tests/virnettlssessiontest.c @@ -30,7 +30,7 @@ #include "vircommand.h" #include "virsocket.h" =20 -#if !defined WIN32 && HAVE_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 +#if !defined WIN32 && WITH_LIBTASN1_H && LIBGNUTLS_VERSION_NUMBER >=3D 0x0= 20600 =20 # define VIR_FROM_THIS VIR_FROM_RPC =20 diff --git a/tests/virportallocatormock.c b/tests/virportallocatormock.c index 28fe89200e..964f475944 100644 --- a/tests/virportallocatormock.c +++ b/tests/virportallocatormock.c @@ -18,7 +18,7 @@ =20 #include =20 -#if HAVE_DLFCN_H +#if WITH_DLFCN_H # include #endif =20 diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 0a938f6410..691d3f22f1 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -20,7 +20,7 @@ #include "virfile.h" #include "testutils.h" =20 -#if HAVE_DLFCN_H +#if WITH_DLFCN_H # include #endif =20 diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 179ae5e5e7..e0f8b6d621 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -198,7 +198,7 @@ testPrepImages(void) if (virCommandRun(cmd, NULL) < 0) goto skip; =20 -#ifdef HAVE_SYMLINK +#ifdef WITH_SYMLINK /* Create some symlinks in a sub-directory. */ if (symlink("../qcow2", datadir "/sub/link1") < 0 || symlink("../wrap", datadir "/sub/link2") < 0) { @@ -859,7 +859,7 @@ mymain(void) TEST_CHAIN(absdir, VIR_STORAGE_FILE_NONE, (&dir), EXP_PASS); TEST_CHAIN(absdir, VIR_STORAGE_FILE_DIR, (&dir), EXP_PASS); =20 -#ifdef HAVE_SYMLINK +#ifdef WITH_SYMLINK /* Rewrite qcow2 and wrap file to use backing names relative to a * symlink from a different directory */ virCommandFree(cmd); diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c index 15369d8eb2..7e5ac01c6c 100644 --- a/tests/vshtabletest.c +++ b/tests/vshtabletest.c @@ -19,7 +19,7 @@ #include =20 #include -#ifdef HAVE_XLOCALE_H +#ifdef WITH_XLOCALE_H # include #endif #include diff --git a/tools/nss/libvirt_nss.c b/tools/nss/libvirt_nss.c index 6331c65131..b021efc3c9 100644 --- a/tools/nss/libvirt_nss.c +++ b/tools/nss/libvirt_nss.c @@ -356,7 +356,7 @@ NSS_NAME(gethostbyname3)(const char *name, int af, stru= ct hostent *result, return ret; } =20 -#ifdef HAVE_STRUCT_GAIH_ADDRTUPLE +#ifdef WITH_STRUCT_GAIH_ADDRTUPLE enum nss_status NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat, char *buffer, size_t buflen, int *errnop, @@ -449,7 +449,7 @@ NSS_NAME(gethostbyname4)(const char *name, struct gaih_= addrtuple **pat, free(addr); return ret; } -#endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */ +#endif /* WITH_STRUCT_GAIH_ADDRTUPLE */ =20 #if defined(WITH_BSD_NSS) NSS_METHOD_PROTOTYPE(_nss_compat_getaddrinfo); diff --git a/tools/nss/libvirt_nss.h b/tools/nss/libvirt_nss.h index 121b9e8722..2bb313f329 100644 --- a/tools/nss/libvirt_nss.h +++ b/tools/nss/libvirt_nss.h @@ -77,12 +77,12 @@ NSS_NAME(gethostbyname3)(const char *name, int af, stru= ct hostent *result, char *buffer, size_t buflen, int *errnop, int *herrnop, int32_t *ttlp, char **canonp); =20 -#ifdef HAVE_STRUCT_GAIH_ADDRTUPLE +#ifdef WITH_STRUCT_GAIH_ADDRTUPLE enum nss_status NSS_NAME(gethostbyname4)(const char *name, struct gaih_addrtuple **pat, char *buffer, size_t buflen, int *errnop, int *herrnop, int32_t *ttlp); -#endif /* HAVE_STRUCT_GAIH_ADDRTUPLE */ +#endif /* WITH_STRUCT_GAIH_ADDRTUPLE */ =20 #if defined(WITH_BSD_NSS) ns_mtab* diff --git a/tools/virt-host-validate.c b/tools/virt-host-validate.c index e797e63475..c119d649ce 100644 --- a/tools/virt-host-validate.c +++ b/tools/virt-host-validate.c @@ -21,9 +21,9 @@ =20 #include =20 -#ifdef HAVE_LIBINTL_H +#ifdef WITH_LIBINTL_H # include -#endif /* HAVE_LIBINTL_H */ +#endif /* WITH_LIBINTL_H */ #include =20 #include "internal.h" --=20 2.26.2