From nobody Sun Feb 8 10:50:10 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1564671698; cv=none; d=zoho.com; s=zohoarc; b=k/BTBLuuZEi3t8ZQgm/H7UpEuBV00RTJ3IFlQI6LWL1kS9uykXFLwnpFmQnLx5DqOqp4REqoY1HtgH+lK7pEG6bP3KOi50SfJMBHE/c1DXUwjAZ+jlZ9pHRR8uuTszeP5RHvCAsV6nKQTcs5mfeBWry4x9B3frDz2UX/WUajUc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564671698; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=sqzL+r1u0ivaUvFrcrD/Nxgmas3+7hwt/d8ZLBQy9RA=; b=eihMcfk4Z16rOsyefNIN1S3hQ9uSrSPqL64crJ6B8uW/UOeACYyt2q8ZlhsVsjdEJ8si/VI2TJgRkr7yV9XauF/d5yZQG5FIb+yHsKiWngCmcAPvNKt0TKIGM+lbBWtWklsHcnruFe0Rr1ehTmQziM/SGPUrNRo2YBg5vkha0RA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1564671698581618.4484294707598; Thu, 1 Aug 2019 08:01:38 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id DAFF03073832; Thu, 1 Aug 2019 15:01:35 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5FFB614DD; Thu, 1 Aug 2019 15:01:35 +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 57C4D149E6; Thu, 1 Aug 2019 15:01:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x71F1ODc032293 for ; Thu, 1 Aug 2019 11:01:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id DA71C19697; Thu, 1 Aug 2019 15:01:24 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (dhcp-94.gsslab.fab.redhat.com [10.33.9.94]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B6D0196FE; Thu, 1 Aug 2019 15:01:24 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Thu, 1 Aug 2019 16:00:19 +0100 Message-Id: <20190801150019.10519-18-berrange@redhat.com> In-Reply-To: <20190801150019.10519-1-berrange@redhat.com> References: <20190801150019.10519-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 17/17] nss: only link to yajl library and nothing else X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 01 Aug 2019 15:01:36 +0000 (UTC) Now that the code does not refer to any libvirt headers, except internal.h macros, it does not need to link to any libvirt code, nor gnulib either. The only thing it needs is yajl. Signed-off-by: Daniel P. Berrang=C3=A9 --- config-post.h | 30 ------------------- src/Makefile.am | 73 ---------------------------------------------- src/util/virfile.c | 3 +- tools/Makefile.am | 8 ++--- 4 files changed, 5 insertions(+), 109 deletions(-) diff --git a/config-post.h b/config-post.h index a11f9c83d6..38baeefdff 100644 --- a/config-post.h +++ b/config-post.h @@ -16,36 +16,6 @@ * . */ =20 -/* - * The NSS module can be loaded into any binary and thus we want - * to minimize what code is liable to be run. Especiall we need - * to minimize use of any 3rd party libraries which have - * __attribute__((constructor)) functions. - * - * The only way to avoid such deps is to re-compile the - * functions with the code in question disabled, and for that we - * must override the main config.h rules. Hence this file :-( - */ -#ifdef LIBVIRT_NSS -# undef HAVE_LIBNL -# undef HAVE_LIBNL3 -# undef HAVE_LIBSASL2 -# undef HAVE_SYS_ACL_H -# undef WITH_CAPNG -# undef WITH_CURL -# undef WITH_DEVMAPPER -# undef WITH_DTRACE_PROBES -# undef WITH_GNUTLS -# undef WITH_LIBSSH -# undef WITH_MACVTAP -# undef WITH_NUMACTL -# undef WITH_SASL -# undef WITH_SSH2 -# undef WITH_VIRTUALPORT -# undef WITH_SECDRIVER_SELINUX -# undef WITH_SECDRIVER_APPARMOR -#endif /* LIBVIRT_NSS */ - #ifndef __GNUC__ # error "Libvirt requires GCC >=3D 4.4, or CLang" #endif diff --git a/src/Makefile.am b/src/Makefile.am index 8ca714dd34..f111b2a1b4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -767,79 +767,6 @@ libvirt_iohelper_CFLAGS =3D \ endif WITH_LIBVIRTD =20 =20 - -if WITH_NSS -noinst_LTLIBRARIES +=3D libvirt-nss.la - -libvirt_nss_la_SOURCES =3D \ - util/viralloc.c \ - util/viralloc.h \ - util/viratomic.c \ - util/viratomic.h \ - util/virautoclean.h \ - util/virbitmap.c \ - util/virbitmap.h \ - util/virbuffer.c \ - util/virbuffer.h \ - util/vircommand.c \ - util/vircommand.h \ - util/virenum.c \ - util/virenum.h \ - util/virerror.c \ - util/virerror.h \ - util/virfile.c \ - util/virfile.h \ - util/virhash.c \ - util/virhash.h \ - util/virhashcode.c \ - util/virhashcode.h \ - util/virjson.c \ - util/virjson.h \ - util/virkmod.c \ - util/virkmod.h \ - util/virlease.c \ - util/virlease.h \ - util/virlog.c \ - util/virlog.h \ - util/virmacmap.c \ - util/virmacmap.h \ - util/virobject.c \ - util/virobject.h \ - util/virpidfile.c \ - util/virpidfile.h \ - util/virprocess.c \ - util/virprocess.h \ - util/virrandom.c \ - util/virrandom.h \ - util/virsocketaddr.c \ - util/virsocketaddr.h \ - util/virstring.c \ - util/virstring.h \ - util/virthread.c \ - util/virthread.h \ - util/virthreadjob.c \ - util/virthreadjob.h \ - util/virtime.c \ - util/virtime.h \ - util/virutil.c \ - util/virutil.h \ - $(NULL) - -libvirt_nss_la_CFLAGS =3D \ - -DLIBVIRT_NSS \ - $(AM_CFLAGS) \ - $(YAJL_CFLAGS) \ - $(NULL) -libvirt_nss_la_LDFLAGS =3D \ - $(AM_LDFLAGS) \ - $(NULL) - -libvirt_nss_la_LIBADD =3D \ - $(YAJL_LIBS) \ - $(NULL) -endif WITH_NSS - - install-data-local: $(INSTALL_DATA_LOCAL) \ $(INSTALL_DATA_DIRS:%=3Dinstall-data-%) $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt" diff --git a/src/util/virfile.c b/src/util/virfile.c index 7667c16d27..81a3c096eb 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -631,8 +631,7 @@ int virFileUpdatePerm(const char *path, } =20 =20 -#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR && \ - !defined(LIBVIRT_NSS) +#if defined(__linux__) && HAVE_DECL_LO_FLAGS_AUTOCLEAR =20 # if HAVE_DECL_LOOP_CTL_GET_FREE =20 diff --git a/tools/Makefile.am b/tools/Makefile.am index 61812a2cb1..09cada949b 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -493,8 +493,8 @@ nss_libnss_libvirt_impl_la_CFLAGS =3D \ $(NULL) =20 nss_libnss_libvirt_impl_la_LIBADD =3D \ - ../gnulib/lib/libgnu.la \ - ../src/libvirt-nss.la + $(YAJL_LIBS) \ + $(NULL) =20 nss_libnss_libvirt_la_SOURCES =3D nss_libnss_libvirt_la_LDFLAGS =3D \ @@ -524,8 +524,8 @@ nss_libnss_libvirt_guest_impl_la_CFLAGS =3D \ $(NULL) =20 nss_libnss_libvirt_guest_impl_la_LIBADD =3D \ - ../gnulib/lib/libgnu.la \ - ../src/libvirt-nss.la + $(YAJL_LIBS) \ + $(NULL) =20 nss_libnss_libvirt_guest_la_SOURCES =3D nss_libnss_libvirt_guest_la_LDFLAGS =3D \ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list