From nobody Tue Apr 30 18:40:37 2024 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=1566388411; cv=none; d=zoho.com; s=zohoarc; b=Qn5Wtaeft+nrNhTBFVd3Y7xjQlAKX7bWFkGuEL7cCqj/LzDAjU8kuzbiiSdhaARp/sBgB88yI9EI4f6wJj+tN57bOM/x9IJzZF3PatAx618MAMEg7EnchQWTuRqe8Bg7z/QPgGLkzh4i6zVF66/tZArTAByyrRNtvDL5QePdNrM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566388411; 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=GVnzCL2+U5hh3UsqiwRg3hsBuw2UGwRJfFtkOdfiQ7c=; b=ZCAedOV82kz9nNflQV5BK00ymbJ6Qe0SVJ1cW4OcRUjVpHjdhNlBIb81xaO+d20i4QYNOKsDc0U4CplrOhET1rSg2kdPtkcH/DyGCZO1GqJ3OZSeM0nMjZAltNC/mekAo4DiVlBUUoeWOxQdRXl1Tc/SE/CHsgQZMRvrSQQzDqk= 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 1566388411657916.8986427072686; Wed, 21 Aug 2019 04:53:31 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 8818F2A09D4; Wed, 21 Aug 2019 11:53:30 +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 648895C231; Wed, 21 Aug 2019 11:53:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 228B1E203; Wed, 21 Aug 2019 11:53:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LBoIJY003456 for ; Wed, 21 Aug 2019 07:50:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 994935C25B; Wed, 21 Aug 2019 11:50:18 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id B26C95C231; Wed, 21 Aug 2019 11:50:17 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 12:50:06 +0100 Message-Id: <20190821115011.11240-2-berrange@redhat.com> In-Reply-To: <20190821115011.11240-1-berrange@redhat.com> References: <20190821115011.11240-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/6] build: use $(COMMON_UNIT_VARS) for logging/locking systemd units 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 21 Aug 2019 11:53:31 +0000 (UTC) Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/locking/Makefile.inc.am | 16 +++------------- src/logging/Makefile.inc.am | 16 +++------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 37d0e79f40..68cd10013e 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -259,24 +259,14 @@ locking/lock_daemon_dispatch_stubs.h: $(LOCK_PROTOCOL= ) \ =20 =20 virtlockd.service: locking/virtlockd.service.in $(top_builddir)/config.sta= tus - $(AM_V_GEN)sed \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ - < $< > $@-t && \ - mv $@-t $@ + $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ =20 virtlockd.socket: locking/virtlockd.socket.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - < $< > $@-t && \ - mv $@-t $@ + $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ =20 virtlockd-admin.socket: locking/virtlockd-admin.socket.in \ $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - < $< > $@-t && \ - mv $@-t $@ + $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ =20 virtlockd.8.in: locking/virtlockd.pod $(AM_V_GEN)$(POD2MAN) --section=3D8 $< $@-t1 && \ diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am index b952021d00..7e441dbffb 100644 --- a/src/logging/Makefile.inc.am +++ b/src/logging/Makefile.inc.am @@ -123,21 +123,11 @@ virtlogd.8.in: logging/virtlogd.pod mv $@-t2 $@ =20 virtlogd.service: logging/virtlogd.service.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's|[@]sbindir[@]|$(sbindir)|g' \ - -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ - < $< > $@-t && \ - mv $@-t $@ + $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ =20 virtlogd.socket: logging/virtlogd.socket.in $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - < $< > $@-t && \ - mv $@-t $@ + $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ =20 virtlogd-admin.socket: logging/virtlogd-admin.socket.in \ $(top_builddir)/config.status - $(AM_V_GEN)sed \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ - < $< > $@-t && \ - mv $@-t $@ + $(AM_V_GEN)sed $(COMMON_UNIT_VARS) $< > $@-t && mv $@-t $@ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 18:40:37 2024 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=1566388230; cv=none; d=zoho.com; s=zohoarc; b=Dhi4WISHRGmNqAZ6LYf89k19q8iTslG3/bIYCkFRHKaURoskksdGKc6rqGeku2r19zY1uvjYnpliR2yHpxo8rPvI/QnJ/vUTp2/HsnfKkniKIKvSPyBwC82j9umTnG2AwBojnAN67yQFlEmkD5jwlmymx5Gv0graaKXzQixUZLk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566388230; 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=rje2nk36dH0MQa/EKd9T1nVG5fTu3u455COCBZypEcg=; b=fc+E0KIl87c3AaMHlWxxh77AAqsz048+lFU7Xa6Mjwyw9rNPRwW263t9/v0QA8GWu25XpBFpa87488P9H1PdY1xUIUWR51rgckuJ6aZHIj1z9Gu/SgQyjrdPWhpN+AVhJmhbDWF6fxdGw3pl1ROLbI/D2Nfn0sgKKda06zsAapw= 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 1566388230097581.0443009236726; Wed, 21 Aug 2019 04:50:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BE0501801581; Wed, 21 Aug 2019 11:50:28 +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 EA93B1001959; Wed, 21 Aug 2019 11:50:26 +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 7131B180B536; Wed, 21 Aug 2019 11:50:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LBoJ88003464 for ; Wed, 21 Aug 2019 07:50:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id D20845C290; Wed, 21 Aug 2019 11:50:19 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14A2F5C231; Wed, 21 Aug 2019 11:50:18 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 12:50:07 +0100 Message-Id: <20190821115011.11240-3-berrange@redhat.com> In-Reply-To: <20190821115011.11240-1-berrange@redhat.com> References: <20190821115011.11240-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/6] systemd: honour $runstatedir in socket unit files 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.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.63]); Wed, 21 Aug 2019 11:50:29 +0000 (UTC) If a systemd socket uses /var/run in its path, systemd prints a warning at runtime [ 15.139976] systemd[1]: /usr/lib/systemd/system/virtlockd.socket:5: ListenStream=3D references a path below legacy directory /var/run/, updating /var/run/libvirt/virtlockd-sock =E2=86=92 /run/libvirt/virtlockd= -sock; please update the unit file accordingly. This minimal change updates the socket unit files to honour the $runstatedir path. There's no functional change by default yet since both expressions expand to the same value. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/Makefile.am | 2 +- src/locking/virtlockd-admin.socket.in | 2 +- src/locking/virtlockd.socket.in | 2 +- src/logging/virtlogd-admin.socket.in | 2 +- src/logging/virtlogd.socket.in | 2 +- src/remote/Makefile.inc.am | 4 ++++ src/remote/libvirtd-admin.socket.in | 2 +- src/remote/libvirtd-ro.socket.in | 2 +- src/remote/libvirtd.conf.in | 2 +- src/remote/libvirtd.socket.in | 2 +- src/remote/test_libvirtd.aug.in | 2 +- 11 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 817a7ecf34..13b05f8440 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -93,7 +93,7 @@ DRIVER_SOURCES =3D man7_MANS =3D =20 COMMON_UNIT_VARS =3D \ - -e 's|[@]localstatedir[@]|$(localstatedir)|g' \ + -e 's|[@]runstatedir[@]|$(runstatedir)|g' \ -e 's|[@]sbindir[@]|$(sbindir)|g' \ -e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \ $(NULL) diff --git a/src/locking/virtlockd-admin.socket.in b/src/locking/virtlockd-= admin.socket.in index cd7072238c..c66e0f9693 100644 --- a/src/locking/virtlockd-admin.socket.in +++ b/src/locking/virtlockd-admin.socket.in @@ -5,7 +5,7 @@ BindsTo=3Dvirtlockd.socket After=3Dvirtlockd.socket =20 [Socket] -ListenStream=3D@localstatedir@/run/libvirt/virtlockd-admin-sock +ListenStream=3D@runstatedir@/libvirt/virtlockd-admin-sock Service=3Dvirtlockd.service SocketMode=3D0600 =20 diff --git a/src/locking/virtlockd.socket.in b/src/locking/virtlockd.socket= .in index d701b27516..52014f45ec 100644 --- a/src/locking/virtlockd.socket.in +++ b/src/locking/virtlockd.socket.in @@ -3,7 +3,7 @@ Description=3DVirtual machine lock manager socket Before=3Dlibvirtd.service =20 [Socket] -ListenStream=3D@localstatedir@/run/libvirt/virtlockd-sock +ListenStream=3D@runstatedir@/libvirt/virtlockd-sock SocketMode=3D0600 =20 [Install] diff --git a/src/logging/virtlogd-admin.socket.in b/src/logging/virtlogd-ad= min.socket.in index 672bd7470d..5c0fb1880e 100644 --- a/src/logging/virtlogd-admin.socket.in +++ b/src/logging/virtlogd-admin.socket.in @@ -5,7 +5,7 @@ BindsTo=3Dvirtlogd.socket After=3Dvirtlogd.socket =20 [Socket] -ListenStream=3D@localstatedir@/run/libvirt/virtlogd-admin-sock +ListenStream=3D@runstatedir@/libvirt/virtlogd-admin-sock Service=3Dvirtlogd.service SocketMode=3D0600 =20 diff --git a/src/logging/virtlogd.socket.in b/src/logging/virtlogd.socket.in index ae48cdab9a..9749a33197 100644 --- a/src/logging/virtlogd.socket.in +++ b/src/logging/virtlogd.socket.in @@ -3,7 +3,7 @@ Description=3DVirtual machine log manager socket Before=3Dlibvirtd.service =20 [Socket] -ListenStream=3D@localstatedir@/run/libvirt/virtlogd-sock +ListenStream=3D@runstatedir@/libvirt/virtlogd-sock SocketMode=3D0600 =20 [Install] diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index aca0b40140..abf04d998a 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -247,6 +247,7 @@ remote/libvirtd.conf: remote/libvirtd.conf.in -e '/[@]CUT_ENABLE_IP[@]/d' \ -e '/[@]END[@]/d' \ -e 's|[@]sysconfdir[@]|@sysconfdir@|' \ + -e 's|[@]runstatedir[@]|@runstatedir@|' \ -e 's|[@]DAEMON_NAME[@]|libvirtd|' \ $< > $@ =20 @@ -254,6 +255,7 @@ remote/virtproxyd.conf: remote/libvirtd.conf.in $(AM_V_GEN)sed \ -e '/[@]CUT_ENABLE_IP[@]/d' \ -e '/[@]END[@]/d' \ + -e 's|[@]runstatedir[@]|@runstatedir@|' \ -e 's/[@]DAEMON_NAME[@]/virtproxyd/' \ $< > $@ =20 @@ -290,6 +292,7 @@ remote/test_libvirtd.aug: remote/test_libvirtd.aug.in \ -e '/[@]CUT_ENABLE_IP[@]/d' \ -e '/[@]END[@]/d' \ -e 's|[@]sysconfdir[@]|@sysconfdir@|' \ + -e 's|[@]runstatedir[@]|@runstatedir@|' \ -e 's|[@]DAEMON_NAME[@]|libvirtd|' \ -e 's|[@]DAEMON_NAME_UC[@]|Libvirtd|' \ > $@ || rm -f $@ @@ -301,6 +304,7 @@ remote/test_virtproxyd.aug: remote/test_libvirtd.aug.in= \ $(SED) \ -e '/[@]CUT_ENABLE_IP[@]/d' \ -e '/[@]END[@]/d' \ + -e 's|[@]runstatedir[@]|@runstatedir@|' \ -e 's/[@]DAEMON_NAME[@]/virtproxyd/' \ -e 's/[@]DAEMON_NAME_UC[@]/Virtproxyd/' \ > $@ || rm -f $@ diff --git a/src/remote/libvirtd-admin.socket.in b/src/remote/libvirtd-admi= n.socket.in index dcce7fdc93..4129abc1ab 100644 --- a/src/remote/libvirtd-admin.socket.in +++ b/src/remote/libvirtd-admin.socket.in @@ -8,7 +8,7 @@ After=3D@service@.socket [Socket] # The directory must match the @sysconfdir@/libvirt/@service@.conf unix_so= ck_dir setting # when using systemd version < 227 -ListenStream=3D@localstatedir@/run/libvirt/@sockprefix@-admin-sock +ListenStream=3D@runstatedir@/libvirt/@sockprefix@-admin-sock Service=3D@service@.service SocketMode=3D0600 =20 diff --git a/src/remote/libvirtd-ro.socket.in b/src/remote/libvirtd-ro.sock= et.in index a287f78201..cb5e6bd60f 100644 --- a/src/remote/libvirtd-ro.socket.in +++ b/src/remote/libvirtd-ro.socket.in @@ -8,7 +8,7 @@ After=3D@service@.socket [Socket] # The directory must match the @sysconfdir@/libvirt/@service@.conf unix_so= ck_dir setting # when using systemd version < 227 -ListenStream=3D@localstatedir@/run/libvirt/@sockprefix@-sock-ro +ListenStream=3D@runstatedir@/libvirt/@sockprefix@-sock-ro Service=3D@service@.service SocketMode=3D0666 =20 diff --git a/src/remote/libvirtd.conf.in b/src/remote/libvirtd.conf.in index 6969998306..fdef97f371 100644 --- a/src/remote/libvirtd.conf.in +++ b/src/remote/libvirtd.conf.in @@ -119,7 +119,7 @@ # This setting is not required or honoured if using systemd socket # activation with systemd version >=3D 227 # -#unix_sock_dir =3D "/var/run/libvirt" +#unix_sock_dir =3D "@runstatedir@/libvirt" =20 =20 =20 diff --git a/src/remote/libvirtd.socket.in b/src/remote/libvirtd.socket.in index cb61409e23..df36df2125 100644 --- a/src/remote/libvirtd.socket.in +++ b/src/remote/libvirtd.socket.in @@ -6,7 +6,7 @@ Before=3D@service@.service [Socket] # The directory must match the @sysconfdir@/libvirt/@service@.conf unix_so= ck_dir setting # when using systemd version < 227 -ListenStream=3D@localstatedir@/run/libvirt/@sockprefix@-sock +ListenStream=3D@runstatedir@/libvirt/@sockprefix@-sock Service=3D@service@.service SocketMode=3D0666 =20 diff --git a/src/remote/test_libvirtd.aug.in b/src/remote/test_libvirtd.aug= .in index fc9fb69b67..1e17397af6 100644 --- a/src/remote/test_libvirtd.aug.in +++ b/src/remote/test_libvirtd.aug.in @@ -13,7 +13,7 @@ module Test_@DAEMON_NAME@ =3D { "unix_sock_ro_perms" =3D "0777" } { "unix_sock_rw_perms" =3D "0770" } { "unix_sock_admin_perms" =3D "0700" } - { "unix_sock_dir" =3D "/var/run/libvirt" } + { "unix_sock_dir" =3D "@runstatedir@/libvirt" } { "auth_unix_ro" =3D "none" } { "auth_unix_rw" =3D "none" } @CUT_ENABLE_IP@ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 18:40:37 2024 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=1566388242; cv=none; d=zoho.com; s=zohoarc; b=nwICRqZRWKQNsswhySYmqTUr23hSPcKQb3SKel5m1p/VeeBhmijc/gQkJQ37zpZU2hOrlQ5bZ38eU+PJYQgJv8ulNKlsTqYHNq10ui+YyhHmTv4DnUqgBIIQivop9c2XPR329Rk7b0VwC8u0dWVqIaLTOZMnavYeGFD+yQCkHmw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566388242; 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=k5Qf7CVLksNPuyRHU1rCT6rSm/fbQahlZrL8tZ9aPuI=; b=ZQi2Lp7jbpb4T3sUWkHXr5UWu/IUfX7zQNZdQQjMOoHzmqA/LZUw2jNotJT9NwhW2Cd+5hznsJie9mxDhHdQtuAlRehzjXfWfK6Dokt+8PT370CtBuWaHrf2KdeWuSjoXpwGEUxoFXioF8y7FSFFdLGOvFIln6lrrWJETIF2HWk= 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 1566388242020258.6501036940841; Wed, 21 Aug 2019 04:50:42 -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 D0C443084212; Wed, 21 Aug 2019 11:50:40 +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 A2B5F8BE3D; Wed, 21 Aug 2019 11:50:40 +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 5FF3CEEFD; Wed, 21 Aug 2019 11:50:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LBoL2G003471 for ; Wed, 21 Aug 2019 07:50:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2EF725C231; Wed, 21 Aug 2019 11:50:21 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 508115C290; Wed, 21 Aug 2019 11:50:20 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 12:50:08 +0100 Message-Id: <20190821115011.11240-4-berrange@redhat.com> In-Reply-To: <20190821115011.11240-1-berrange@redhat.com> References: <20190821115011.11240-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/6] build: honour $(runstatedir) in make rules 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]); Wed, 21 Aug 2019 11:50:41 +0000 (UTC) Creating various directories using $(runstatedir) instead of $(localstatedir)/run. There's no functional change by default yet since both expressions expand to the same value. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/libxl/Makefile.inc.am | 4 ++-- src/locking/Makefile.inc.am | 4 ++-- src/lxc/Makefile.inc.am | 4 ++-- src/network/Makefile.inc.am | 4 ++-- src/qemu/Makefile.inc.am | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libxl/Makefile.inc.am b/src/libxl/Makefile.inc.am index 1587404586..4cfb4f030b 100644 --- a/src/libxl/Makefile.inc.am +++ b/src/libxl/Makefile.inc.am @@ -140,12 +140,12 @@ INSTALL_DATA_DIRS +=3D libxl =20 install-data-libxl: $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" + $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/libxl" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" =20 uninstall-data-libxl: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/libxl" ||: - rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/libxl" ||: + rmdir "$(DESTDIR)$(runstatedir)/libvirt/libxl" ||: rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/libxl" ||: =20 endif WITH_LIBXL diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am index 68cd10013e..fae92a6e45 100644 --- a/src/locking/Makefile.inc.am +++ b/src/locking/Makefile.inc.am @@ -203,7 +203,7 @@ INSTALL_DATA_DIRS +=3D locking install-data-locking: $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" + $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/lockd" if WITH_SANLOCK $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" endif WITH_SANLOCK @@ -211,7 +211,7 @@ endif WITH_SANLOCK uninstall-data-locking: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd/files" ||: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lockd" ||: - rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lockd" ||: + rmdir "$(DESTDIR)$(runstatedir)/libvirt/lockd" ||: if WITH_SANLOCK rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||: endif WITH_SANLOCK diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am index 22c582c380..b4d560702c 100644 --- a/src/lxc/Makefile.inc.am +++ b/src/lxc/Makefile.inc.am @@ -229,12 +229,12 @@ INSTALL_DATA_DIRS +=3D lxc =20 install-data-lxc: $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" + $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/lxc" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/lxc" =20 uninstall-data-lxc: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/lxc" ||: - rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/lxc" ||: + rmdir "$(DESTDIR)$(runstatedir)/libvirt/lxc" ||: rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/lxc" ||: =20 endif WITH_LXC diff --git a/src/network/Makefile.inc.am b/src/network/Makefile.inc.am index 091b722172..9f20dad7b3 100644 --- a/src/network/Makefile.inc.am +++ b/src/network/Makefile.inc.am @@ -136,7 +136,7 @@ UUID=3D$(shell uuidgen 2>/dev/null) install-data-network: $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/network" + $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/network" $(MKDIR_P) "$(DESTDIR)$(confdir)/qemu/networks/autostart" $(INSTALL_DATA) $(srcdir)/network/default.xml \ $(DESTDIR)$(confdir)/qemu/networks/default.xml @@ -163,7 +163,7 @@ uninstall-data-network: rmdir "$(DESTDIR)$(confdir)/qemu/networks/autostart" || : rmdir "$(DESTDIR)$(confdir)/qemu/networks" || : rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/network" ||: - rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/network" ||: + rmdir "$(DESTDIR)$(runstatedir)/libvirt/network" ||: if WITH_FIREWALLD_ZONE rm -f $(DESTDIR)$(prefix)/lib/firewalld/zones/libvirt.xml endif WITH_FIREWALLD_ZONE diff --git a/src/qemu/Makefile.inc.am b/src/qemu/Makefile.inc.am index 30a9751cfd..d16b315ebc 100644 --- a/src/qemu/Makefile.inc.am +++ b/src/qemu/Makefile.inc.am @@ -187,20 +187,20 @@ INSTALL_DATA_DIRS +=3D qemu =20 install-data-qemu: $(MKDIR_P) -m 0751 "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu" + $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/qemu" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/swtpm" - $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu/swtpm" + $(MKDIR_P) "$(DESTDIR)$(runstatedir)/libvirt/qemu/swtpm" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/log/swtpm/libvirt/qemu" =20 uninstall-data-qemu: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" ||: - rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/qemu" ||: + rmdir "$(DESTDIR)$(runstatedir)/libvirt/qemu" ||: rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt/qemu" ||: rmdir "$(DESTDIR)$(localstatedir)/log/libvirt/qemu" ||: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/swtpm" - rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/qemu/swtpm" ||: + rmdir "$(DESTDIR)$(runstatedir)/libvirt/qemu/swtpm" ||: rmdir "$(DESTDIR)$(localstatedir)/log/swtpm/libvirt/qemu" ||: =20 endif WITH_QEMU --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 18:40:37 2024 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=1566388246; cv=none; d=zoho.com; s=zohoarc; b=LiKz8Flmrnm7cGN/T3RFb1jpISPFSVgdW6Fyaj9DsGrW0CGNxP8wNq6dztcKK+lCui4Khzgt9MWgtPsjbISYgFQbQ96FgBC+YTrAAyphj3My9OdUf0qyNmU6B8cwHow7lwrjSWQxoy5SjfACcRHNi+NtMuvcJ66wW2lV0LVDw0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566388246; 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=SjekXaX809sRJ2dDIA99KgiQyt/SyYd5fJN5O3UMEpg=; b=fzLrImAFDaFo27hx4pOTMZuwnzKW/GGtz7YNRrQQ8gkm9Jt8Jti/wA7JccM8dbjba92W92JSETZXQu3v2oXvj67L2U59mENBrn0vT8IpX69YXHwu11yrKLHPmmIdHI6EHrou9pFAl/nh+TGigtpyGNoNxwQpWE/X4zYWJAVdv2U= 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 1566388246075520.3258845304764; Wed, 21 Aug 2019 04:50:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F46B10F09; Wed, 21 Aug 2019 11:50:44 +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 69F8660F8C; Wed, 21 Aug 2019 11:50:44 +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 2D708E202; Wed, 21 Aug 2019 11:50:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LBoMSm003480 for ; Wed, 21 Aug 2019 07:50:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D6D85C686; Wed, 21 Aug 2019 11:50:22 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F1CD5C290; Wed, 21 Aug 2019 11:50:21 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 12:50:09 +0100 Message-Id: <20190821115011.11240-5-berrange@redhat.com> In-Reply-To: <20190821115011.11240-1-berrange@redhat.com> References: <20190821115011.11240-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 4/6] src: honour the RUNSTATEDIR variable in all code 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 21 Aug 2019 11:50:45 +0000 (UTC) All code using LOCALSTATEDIR "/run" is updated to use RUNSTATEDIR instead. The exception is the remote driver client which still uses LOCALSTATEDIR "/run". The client needs to connect to remote machines which may not be using /run, so /var/run is more portable due to the /var/run -> /run symlink. Some duplicate paths in the apparmor code are also purged. There's no functional change by default yet since both expressions expand to the same value. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- src/bhyve/bhyve_utils.h | 2 +- src/interface/interface_backend_netcf.c | 2 +- src/interface/interface_backend_udev.c | 2 +- src/libvirt-admin.c | 2 +- src/libxl/libxl_conf.h | 2 +- src/locking/lock_daemon.c | 18 +++++++------- src/locking/lock_driver_lockd.c | 2 +- src/locking/virtlockd.pod | 8 +++--- src/logging/log_daemon.c | 18 +++++++------- src/logging/log_manager.c | 2 +- src/logging/virtlogd.pod | 8 +++--- src/lxc/lxc_conf.h | 2 +- src/lxc/lxc_process.c | 2 +- src/network/bridge_driver.c | 4 +-- src/network/leaseshelper.c | 2 +- src/node_device/node_device_hal.c | 2 +- src/node_device/node_device_udev.c | 2 +- src/nwfilter/nwfilter_dhcpsnoop.c | 4 +-- src/nwfilter/nwfilter_driver.c | 4 +-- src/qemu/qemu_conf.c | 4 +-- src/remote/libvirtd.pod | 10 ++++---- src/remote/remote_daemon.c | 24 +++++++++--------- src/remote/remote_daemon_dispatch.c | 4 +-- src/remote/remote_driver.c | 6 +++++ src/secret/secret_driver.c | 2 +- src/security/virt-aa-helper.c | 20 ++++++--------- src/storage/storage_driver.c | 2 +- src/util/virhostdev.c | 2 +- src/util/virpidfile.c | 8 +++--- src/util/virsystemd.c | 33 ++++++++++++++++--------- src/vz/vz_driver.c | 2 +- 31 files changed, 109 insertions(+), 96 deletions(-) diff --git a/src/bhyve/bhyve_utils.h b/src/bhyve/bhyve_utils.h index 3d212e3ccf..8dda6062b5 100644 --- a/src/bhyve/bhyve_utils.h +++ b/src/bhyve/bhyve_utils.h @@ -31,7 +31,7 @@ =20 #define BHYVE_AUTOSTART_DIR SYSCONFDIR "/libvirt/bhyve/autostart" #define BHYVE_CONFIG_DIR SYSCONFDIR "/libvirt/bhyve" -#define BHYVE_STATE_DIR LOCALSTATEDIR "/run/libvirt/bhyve" +#define BHYVE_STATE_DIR RUNSTATEDIR "/libvirt/bhyve" #define BHYVE_LOG_DIR LOCALSTATEDIR "/log/libvirt/bhyve" =20 typedef struct _virBhyveDriverConfig virBhyveDriverConfig; diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interf= ace_backend_netcf.c index eb509ccc13..9659e9fcf1 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -102,7 +102,7 @@ netcfStateInitialize(bool privileged, =20 if (privileged) { if (virAsprintf(&driver->stateDir, - "%s/run/libvirt/interface", LOCALSTATEDIR) < 0) + "%s/libvirt/interface", RUNSTATEDIR) < 0) goto error; } else { VIR_AUTOFREE(char *) rundir =3D NULL; diff --git a/src/interface/interface_backend_udev.c b/src/interface/interfa= ce_backend_udev.c index ef748540d1..ddc3de5347 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -1181,7 +1181,7 @@ udevStateInitialize(bool privileged, =20 if (privileged) { if (virAsprintf(&driver->stateDir, - "%s/run/libvirt/interface", LOCALSTATEDIR) < 0) + "%s/libvirt/interface", RUNSTATEDIR) < 0) goto cleanup; } else { VIR_AUTOFREE(char *) rundir =3D NULL; diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c index 6ad4436bff..ba88f09824 100644 --- a/src/libvirt-admin.c +++ b/src/libvirt-admin.c @@ -149,7 +149,7 @@ getSocketPath(virURIPtr uri) } =20 if (STREQ_NULLABLE(uri->path, "/system")) { - if (virAsprintf(&sock_path, LOCALSTATEDIR "/run/libvirt/%s", + if (virAsprintf(&sock_path, RUNSTATEDIR "/libvirt/%s", sockbase) < 0) goto error; } else if (STREQ_NULLABLE(uri->path, "/session")) { diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h index 552f039d2a..27badfb292 100644 --- a/src/libxl/libxl_conf.h +++ b/src/libxl/libxl_conf.h @@ -48,7 +48,7 @@ #define LIBXL_CONFIG_BASE_DIR SYSCONFDIR "/libvirt" #define LIBXL_CONFIG_DIR SYSCONFDIR "/libvirt/libxl" #define LIBXL_AUTOSTART_DIR LIBXL_CONFIG_DIR "/autostart" -#define LIBXL_STATE_DIR LOCALSTATEDIR "/run/libvirt/libxl" +#define LIBXL_STATE_DIR RUNSTATEDIR "/libvirt/libxl" #define LIBXL_LOG_DIR LOCALSTATEDIR "/log/libvirt/libxl" #define LIBXL_LIB_DIR LOCALSTATEDIR "/lib/libvirt/libxl" #define LIBXL_SAVE_DIR LIBXL_LIB_DIR "/save" diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index 104483267f..ac242bf65c 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -447,8 +447,8 @@ virLockDaemonUnixSocketPaths(bool privileged, char **adminSockfile) { if (privileged) { - if (VIR_STRDUP(*sockfile, LOCALSTATEDIR "/run/libvirt/virtlockd-so= ck") < 0 || - VIR_STRDUP(*adminSockfile, LOCALSTATEDIR "/run/libvirt/virtloc= kd-admin-sock") < 0) + if (VIR_STRDUP(*sockfile, RUNSTATEDIR "/libvirt/virtlockd-sock") <= 0 || + VIR_STRDUP(*adminSockfile, RUNSTATEDIR "/libvirt/virtlockd-adm= in-sock") < 0) goto error; } else { char *rundir =3D NULL; @@ -831,7 +831,7 @@ virLockDaemonExecRestartStatePath(bool privileged, char **state_file) { if (privileged) { - if (VIR_STRDUP(*state_file, LOCALSTATEDIR "/run/virtlockd-restart-= exec.json") < 0) + if (VIR_STRDUP(*state_file, RUNSTATEDIR "/virtlockd-restart-exec.j= son") < 0) goto error; } else { char *rundir =3D NULL; @@ -1062,14 +1062,14 @@ virLockDaemonUsage(const char *argv0, bool privileg= ed) " %s/libvirt/virtlockd.conf\n" "\n" " Sockets:\n" - " %s/run/libvirt/virtlockd-sock\n" + " %s/libvirt/virtlockd-sock\n" "\n" " PID file (unless overridden by -p):\n" - " %s/run/virtlockd.pid\n" + " %s/virtlockd.pid\n" "\n"), SYSCONFDIR, - LOCALSTATEDIR, - LOCALSTATEDIR); + RUNSTATEDIR, + RUNSTATEDIR); } else { fprintf(stderr, "%s", _("\n" @@ -1221,7 +1221,7 @@ int main(int argc, char **argv) { =20 if (!pid_file && virPidFileConstructPath(privileged, - LOCALSTATEDIR, + RUNSTATEDIR, "virtlockd", &pid_file) < 0) { VIR_ERROR(_("Can't determine pid file path.")); @@ -1248,7 +1248,7 @@ int main(int argc, char **argv) { =20 /* Ensure the rundir exists (on tmpfs on some systems) */ if (privileged) { - if (VIR_STRDUP_QUIET(run_dir, LOCALSTATEDIR "/run/libvirt") < 0) + if (VIR_STRDUP_QUIET(run_dir, RUNSTATEDIR "/libvirt") < 0) goto no_memory; } else { if (!(run_dir =3D virGetUserRuntimeDirectory())) { diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lock= d.c index f6371f3050..164f83eb4b 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -124,7 +124,7 @@ static char *virLockManagerLockDaemonPath(bool privileg= ed) { char *path; if (privileged) { - if (VIR_STRDUP(path, LOCALSTATEDIR "/run/libvirt/virtlockd-sock") = < 0) + if (VIR_STRDUP(path, RUNSTATEDIR "/libvirt/virtlockd-sock") < 0) return NULL; } else { char *rundir =3D NULL; diff --git a/src/locking/virtlockd.pod b/src/locking/virtlockd.pod index de0eb8ac18..0b9f758e29 100644 --- a/src/locking/virtlockd.pod +++ b/src/locking/virtlockd.pod @@ -72,11 +72,11 @@ upgrades of the virtlockd service. The default configuration file used by virtlockd, unless overridden on the command line using the B<-f>|B<--config> option. =20 -=3Ditem F +=3Ditem F =20 The sockets libvirtd will use. =20 -=3Ditem F +=3Ditem F =20 The PID file to use, unless overridden by the B<-p>|B<--pid-file> option. =20 @@ -116,8 +116,8 @@ To retrieve the version of virtlockd: To start virtlockd, instructing it to daemonize and create a PID file: =20 # virtlockd -d - # ls -la LOCALSTATEDIR/run/virtlockd.pid - -rw-r--r-- 1 root root 6 Jul 9 02:40 LOCALSTATEDIR/run/virtlockd.pid + # ls -la RUNSTATEDIR/virtlockd.pid + -rw-r--r-- 1 root root 6 Jul 9 02:40 RUNSTATEDIR/virtlockd.pid # =20 =3Dhead1 BUGS diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index 4103f2cefe..f74e900aea 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -388,8 +388,8 @@ virLogDaemonUnixSocketPaths(bool privileged, char **adminSockfile) { if (privileged) { - if (VIR_STRDUP(*sockfile, LOCALSTATEDIR "/run/libvirt/virtlogd-soc= k") < 0 || - VIR_STRDUP(*adminSockfile, LOCALSTATEDIR "/run/libvirt/virtlog= d-admin-sock") < 0) + if (VIR_STRDUP(*sockfile, RUNSTATEDIR "/libvirt/virtlogd-sock") < = 0 || + VIR_STRDUP(*adminSockfile, RUNSTATEDIR "/libvirt/virtlogd-admi= n-sock") < 0) goto error; } else { char *rundir =3D NULL; @@ -623,7 +623,7 @@ virLogDaemonExecRestartStatePath(bool privileged, char **state_file) { if (privileged) { - if (VIR_STRDUP(*state_file, LOCALSTATEDIR "/run/virtlogd-restart-e= xec.json") < 0) + if (VIR_STRDUP(*state_file, RUNSTATEDIR "/virtlogd-restart-exec.js= on") < 0) goto error; } else { char *rundir =3D NULL; @@ -834,14 +834,14 @@ virLogDaemonUsage(const char *argv0, bool privileged) " %s/libvirt/virtlogd.conf\n" "\n" " Sockets:\n" - " %s/run/libvirt/virtlogd-sock\n" + " %s/libvirt/virtlogd-sock\n" "\n" " PID file (unless overridden by -p):\n" - " %s/run/virtlogd.pid\n" + " %s/virtlogd.pid\n" "\n"), SYSCONFDIR, - LOCALSTATEDIR, - LOCALSTATEDIR); + RUNSTATEDIR, + RUNSTATEDIR); } else { fprintf(stderr, "%s", _("\n" @@ -992,7 +992,7 @@ int main(int argc, char **argv) { =20 if (!pid_file && virPidFileConstructPath(privileged, - LOCALSTATEDIR, + RUNSTATEDIR, "virtlogd", &pid_file) < 0) { VIR_ERROR(_("Can't determine pid file path.")); @@ -1019,7 +1019,7 @@ int main(int argc, char **argv) { =20 /* Ensure the rundir exists (on tmpfs on some systems) */ if (privileged) { - if (VIR_STRDUP_QUIET(run_dir, LOCALSTATEDIR "/run/libvirt") < 0) + if (VIR_STRDUP_QUIET(run_dir, RUNSTATEDIR "/libvirt") < 0) goto no_memory; } else { if (!(run_dir =3D virGetUserRuntimeDirectory())) { diff --git a/src/logging/log_manager.c b/src/logging/log_manager.c index eb0a32b4b6..1613d1f8a8 100644 --- a/src/logging/log_manager.c +++ b/src/logging/log_manager.c @@ -45,7 +45,7 @@ virLogManagerDaemonPath(bool privileged) { char *path; if (privileged) { - if (VIR_STRDUP(path, LOCALSTATEDIR "/run/libvirt/virtlogd-sock") <= 0) + if (VIR_STRDUP(path, RUNSTATEDIR "/libvirt/virtlogd-sock") < 0) return NULL; } else { char *rundir =3D NULL; diff --git a/src/logging/virtlogd.pod b/src/logging/virtlogd.pod index 5e44f84a85..01dde99296 100644 --- a/src/logging/virtlogd.pod +++ b/src/logging/virtlogd.pod @@ -72,11 +72,11 @@ upgrades of the virtlogd service. The default configuration file used by virtlogd, unless overridden on the command line using the B<-f>|B<--config> option. =20 -=3Ditem F +=3Ditem F =20 The sockets libvirtd will use. =20 -=3Ditem F +=3Ditem F =20 The PID file to use, unless overridden by the B<-p>|B<--pid-file> option. =20 @@ -116,8 +116,8 @@ To retrieve the version of virtlogd: To start virtlogd, instructing it to daemonize and create a PID file: =20 # virtlogd -d - # ls -la LOCALSTATEDIR/run/virtlogd.pid - -rw-r--r-- 1 root root 6 Jul 9 02:40 LOCALSTATEDIR/run/virtlogd.pid + # ls -la RUNSTATEDIR/virtlogd.pid + -rw-r--r-- 1 root root 6 Jul 9 02:40 RUNSTATEDIR/virtlogd.pid # =20 =3Dhead1 BUGS diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h index e26ca22d3c..12a201db38 100644 --- a/src/lxc/lxc_conf.h +++ b/src/lxc/lxc_conf.h @@ -38,7 +38,7 @@ #define LXC_DRIVER_NAME "LXC" =20 #define LXC_CONFIG_DIR SYSCONFDIR "/libvirt/lxc" -#define LXC_STATE_DIR LOCALSTATEDIR "/run/libvirt/lxc" +#define LXC_STATE_DIR RUNSTATEDIR "/libvirt/lxc" #define LXC_LOG_DIR LOCALSTATEDIR "/log/libvirt/lxc" #define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart" =20 diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index 3d03086ea7..cd65e7a0c0 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -470,7 +470,7 @@ static int virLXCProcessSetupNamespaceNet(int ns_type, = const char *name) return -1; } =20 - if (virAsprintf(&path, "/var/run/netns/%s", name) < 0) + if (virAsprintf(&path, "%s/netns/%s", RUNSTATEDIR, name) < 0) return -1; fd =3D open(path, O_RDONLY); VIR_FREE(path); diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 86e2035b85..7b44184616 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -726,9 +726,9 @@ networkStateInitialize(bool privileged, VIR_STRDUP(network_driver->networkAutostartDir, SYSCONFDIR "/libvirt/qemu/networks/autostart") < 0 = || VIR_STRDUP(network_driver->stateDir, - LOCALSTATEDIR "/run/libvirt/network") < 0 || + RUNSTATEDIR "/libvirt/network") < 0 || VIR_STRDUP(network_driver->pidDir, - LOCALSTATEDIR "/run/libvirt/network") < 0 || + RUNSTATEDIR "/libvirt/network") < 0 || VIR_STRDUP(network_driver->dnsmasqStateDir, LOCALSTATEDIR "/lib/libvirt/dnsmasq") < 0 || VIR_STRDUP(network_driver->radvdStateDir, diff --git a/src/network/leaseshelper.c b/src/network/leaseshelper.c index 481f29aa59..5e04e16171 100644 --- a/src/network/leaseshelper.c +++ b/src/network/leaseshelper.c @@ -160,7 +160,7 @@ main(int argc, char **argv) interface) < 0) goto cleanup; =20 - if (VIR_STRDUP(pid_file, LOCALSTATEDIR "/run/leaseshelper.pid") < 0) + if (VIR_STRDUP(pid_file, RUNSTATEDIR "/leaseshelper.pid") < 0) goto cleanup; =20 /* Try to claim the pidfile, exiting if we can't */ diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_devic= e_hal.c index d46e4e98f3..c613ca5808 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -619,7 +619,7 @@ nodeStateInitialize(bool privileged ATTRIBUTE_UNUSED, =20 if (privileged) { if (virAsprintf(&driver->stateDir, - "%s/run/libvirt/nodedev", LOCALSTATEDIR) < 0) + "%s/libvirt/nodedev", RUNSTATEDIR) < 0) goto failure; } else { VIR_AUTOFREE(char *) rundir =3D NULL; diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_devi= ce_udev.c index adf60e4537..5550ee3a54 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1830,7 +1830,7 @@ nodeStateInitialize(bool privileged, =20 if (privileged) { if (virAsprintf(&driver->stateDir, - "%s/run/libvirt/nodedev", LOCALSTATEDIR) < 0) + "%s/libvirt/nodedev", RUNSTATEDIR) < 0) goto cleanup; } else { VIR_AUTOFREE(char *) rundir =3D NULL; diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.c index d8a1e7f8a8..2af8cfdd32 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -29,7 +29,7 @@ * while :; do kill -SIGTERM `pidof dhclient`; dhclient eth0; ifconfi= g eth0; done * * On the host check the lease file and that it's periodically shortened: - * cat /var/run/libvirt/network/nwfilter.leases; date +%s + * cat $runstatedir/libvirt/network/nwfilter.leases; date +%s * * On the host also check that the ebtables rules 'look' ok: * ebtables -t nat -L @@ -71,7 +71,7 @@ VIR_LOG_INIT("nwfilter.nwfilter_dhcpsnoop"); =20 #ifdef HAVE_LIBPCAP =20 -# define LEASEFILE_DIR LOCALSTATEDIR "/run/libvirt/network/" +# define LEASEFILE_DIR RUNSTATEDIR "/libvirt/network/" # define LEASEFILE LEASEFILE_DIR "nwfilter.leases" # define TMPLEASEFILE LEASEFILE_DIR "nwfilter.ltmp" =20 diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 6073143437..aef5bd4c7f 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -205,7 +205,7 @@ nwfilterStateInitialize(bool privileged, =20 nwfilterDriverLock(); =20 - if (VIR_STRDUP(driver->stateDir, LOCALSTATEDIR "/run/libvirt/nwfilter"= ) < 0) + if (VIR_STRDUP(driver->stateDir, RUNSTATEDIR "/libvirt/nwfilter") < 0) goto error; =20 if (virFileMakePathWithMode(driver->stateDir, S_IRWXU) < 0) { @@ -261,7 +261,7 @@ nwfilterStateInitialize(bool privileged, goto error; } =20 - if (VIR_STRDUP(driver->bindingDir, LOCALSTATEDIR "/run/libvirt/nwfilte= r-binding") < 0) + if (VIR_STRDUP(driver->bindingDir, RUNSTATEDIR "/libvirt/nwfilter-bind= ing") < 0) goto error; =20 if (virFileMakePathWithMode(driver->bindingDir, S_IRWXU) < 0) { diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 2953893337..89c183e46a 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -142,11 +142,11 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool pr= ivileged) goto error; =20 if (virAsprintf(&cfg->stateDir, - "%s/run/libvirt/qemu", LOCALSTATEDIR) < 0) + "%s/libvirt/qemu", RUNSTATEDIR) < 0) goto error; =20 if (virAsprintf(&cfg->swtpmStateDir, - "%s/run/libvirt/qemu/swtpm", LOCALSTATEDIR) < 0) + "%s/libvirt/qemu/swtpm", RUNSTATEDIR) < 0) goto error; =20 if (virAsprintf(&cfg->cacheDir, diff --git a/src/remote/libvirtd.pod b/src/remote/libvirtd.pod index 4721e0f4ec..4988f0f7fa 100644 --- a/src/remote/libvirtd.pod +++ b/src/remote/libvirtd.pod @@ -84,9 +84,9 @@ On receipt of B libvirtd will reload its configur= ation. The default configuration file used by libvirtd, unless overridden on the command line using the B<-f>|B<--config> option. =20 -=3Ditem F +=3Ditem F =20 -=3Ditem F +=3Ditem F =20 The sockets libvirtd will use. =20 @@ -102,7 +102,7 @@ The TLS B certificate libvirtd will use. =20 The TLS B private key libvirtd will use. =20 -=3Ditem F +=3Ditem F =20 The PID file to use, unless overridden by the B<-p>|B<--pid-file> option. =20 @@ -154,8 +154,8 @@ To retrieve the version of libvirtd: To start libvirtd, instructing it to daemonize and create a PID file: =20 # libvirtd -d - # ls -la LOCALSTATEDIR/run/libvirtd.pid - -rw-r--r-- 1 root root 6 Jul 9 02:40 LOCALSTATEDIR/run/libvirtd.pid + # ls -la RUNSTATEDIR/libvirtd.pid + -rw-r--r-- 1 root root 6 Jul 9 02:40 RUNSTATEDIR/libvirtd.pid # =20 =3Dhead1 BUGS diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index 1138485870..3edc357fea 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -238,12 +238,12 @@ daemonUnixSocketPaths(struct daemonConfig *config, } } else { if (privileged) { - if (virAsprintf(sockfile, "%s/run/libvirt/%s-sock", - LOCALSTATEDIR, SOCK_PREFIX) < 0 || - virAsprintf(rosockfile, "%s/run/libvirt/%s-sock-ro", - LOCALSTATEDIR, SOCK_PREFIX) < 0 || - virAsprintf(admsockfile, "%s/run/libvirt/%s-admin-sock", - LOCALSTATEDIR, SOCK_PREFIX) < 0) + if (virAsprintf(sockfile, "%s/libvirt/%s-sock", + RUNSTATEDIR, SOCK_PREFIX) < 0 || + virAsprintf(rosockfile, "%s/libvirt/%s-sock-ro", + RUNSTATEDIR, SOCK_PREFIX) < 0 || + virAsprintf(admsockfile, "%s/libvirt/%s-admin-sock", + RUNSTATEDIR, SOCK_PREFIX) < 0) goto cleanup; } else { mode_t old_umask; @@ -945,11 +945,11 @@ daemonUsage(const char *argv0, bool privileged) =20 fprintf(stderr, " %s\n", _("Sockets:")); fprintf(stderr, " %s/libvirt/%s-sock\n", - privileged ? LOCALSTATEDIR "/run" : "$XDG_RUNTIME_DIR", + privileged ? RUNSTATEDIR : "$XDG_RUNTIME_DIR", SOCK_PREFIX); if (privileged) - fprintf(stderr, " %s/run/libvirt/%s-sock-ro\n", - LOCALSTATEDIR, SOCK_PREFIX); + fprintf(stderr, " %s/libvirt/%s-sock-ro\n", + RUNSTATEDIR, SOCK_PREFIX); fprintf(stderr, "\n"); =20 #ifdef WITH_IP @@ -969,7 +969,7 @@ daemonUsage(const char *argv0, bool privileged) fprintf(stderr, " %s\n", _("PID file (unless overridden by -p):")); fprintf(stderr, " %s/%s.pid\n", - privileged ? LOCALSTATEDIR "/run" : "$XDG_RUNTIME_DIR/libvirt", + privileged ? RUNSTATEDIR : "$XDG_RUNTIME_DIR/libvirt", DAEMON_NAME); fprintf(stderr, "\n"); } @@ -1149,7 +1149,7 @@ int main(int argc, char **argv) { =20 if (!pid_file && virPidFileConstructPath(privileged, - LOCALSTATEDIR, + RUNSTATEDIR, DAEMON_NAME, &pid_file) < 0) { VIR_ERROR(_("Can't determine pid file path.")); @@ -1194,7 +1194,7 @@ int main(int argc, char **argv) { =20 /* Ensure the rundir exists (on tmpfs on some systems) */ if (privileged) { - if (VIR_STRDUP_QUIET(run_dir, LOCALSTATEDIR "/run/libvirt") < 0) { + if (VIR_STRDUP_QUIET(run_dir, RUNSTATEDIR "/libvirt") < 0) { VIR_ERROR(_("Can't allocate memory")); goto cleanup; } diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon= _dispatch.c index 1bd281dd6d..ffff90e848 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -2192,8 +2192,8 @@ remoteDispatchProbeURI(bool readonly, for (i =3D 0; i < (ssize_t) ARRAY_CARDINALITY(drivers) && !*probed= uri; i++) { VIR_AUTOFREE(char *) sockname =3D NULL; =20 - if (virAsprintf(&sockname, "%s/run/libvirt/virt%sd-%s", - LOCALSTATEDIR, drivers[i], + if (virAsprintf(&sockname, "%s/libvirt/virt%sd-%s", + RUNSTATEDIR, drivers[i], readonly ? "sock-ro" : "sock") < 0) return -1; =20 diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index daac506672..ae72fd58fd 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -789,6 +789,12 @@ remoteGetUNIXSocketHelper(remoteDriverTransport transp= ort, userdir, sock_prefix) < 0) return NULL; } else { + /* Intentionally do *NOT* use RUNSTATEDIR here. We might + * be connecting to a remote machine, and cannot assume + * the remote host has /run. The converse is ok though, + * any machine with /run will have a /var/run symlink. + * The portable option is to thus use $LOCALSTATEDIR/run + */ if (virAsprintf(&sockname, "%s/run/libvirt/%s-%s", LOCALSTATEDIR, sock_prefix, flags & VIR_DRV_OPEN_REMOTE_RO ? diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index 0d5ea05f56..7512a51c74 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -474,7 +474,7 @@ secretStateInitialize(bool privileged, "%s/libvirt/secrets", SYSCONFDIR) < 0) goto error; if (virAsprintf(&driver->stateDir, - "%s/run/libvirt/secrets", LOCALSTATEDIR) < 0) + "%s/libvirt/secrets", RUNSTATEDIR) < 0) goto error; } else { VIR_AUTOFREE(char *) rundir =3D NULL; diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 60c9b75980..deadfb7da0 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1232,8 +1232,8 @@ get_files(vahControl * ctl) =20 /* Unix socket for QEMU and swtpm to use */ virBufferAsprintf(&buf, - " \"/run/libvirt/qemu/swtpm/%s-swtpm.sock\" rw,\n", - shortName); + " \"%/libvirt/qemu/swtpm/%s-swtpm.sock\" rw,\n", + RUNSTATEDIR, shortName); /* Paths for swtpm to use: give it access to its state * directory, log, and PID files. */ @@ -1244,8 +1244,8 @@ get_files(vahControl * ctl) " \"%s/log/swtpm/libvirt/qemu/%s-swtpm.log\" a,\n", LOCALSTATEDIR, ctl->def->name); virBufferAsprintf(&buf, - " \"/run/libvirt/qemu/swtpm/%s-swtpm.pid\" rw,\n", - shortName); + " \"%s/libvirt/qemu/swtpm/%s-swtpm.pid\" rw,\n", + RUNSTATEDIR, shortName); =20 VIR_FREE(shortName); break; @@ -1486,14 +1486,10 @@ main(int argc, char **argv) LOCALSTATEDIR, ctl->def->name); virBufferAsprintf(&buf, " \"%s/lib/libvirt/qemu/domain-%d= -%.*s/*\" rw,\n", LOCALSTATEDIR, ctl->def->id, 20, ctl->de= f->name); - virBufferAsprintf(&buf, " \"%s/run/libvirt/**/%s.pid\" rw= k,\n", - LOCALSTATEDIR, ctl->def->name); - virBufferAsprintf(&buf, " \"/run/libvirt/**/%s.pid\" rwk,= \n", - ctl->def->name); - virBufferAsprintf(&buf, " \"%s/run/libvirt/**/*.tunnelmig= rate.dest.%s\" rw,\n", - LOCALSTATEDIR, ctl->def->name); - virBufferAsprintf(&buf, " \"/run/libvirt/**/*.tunnelmigra= te.dest.%s\" rw,\n", - ctl->def->name); + virBufferAsprintf(&buf, " \"%s/libvirt/**/%s.pid\" rwk,\n= ", + RUNSTATEDIR, ctl->def->name); + virBufferAsprintf(&buf, " \"%s/libvirt/**/*.tunnelmigrate= .dest.%s\" rw,\n", + RUNSTATEDIR, ctl->def->name); } if (ctl->files) virBufferAdd(&buf, ctl->files, -1); diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index dfa654178b..78f1aa9aa2 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -273,7 +273,7 @@ storageStateInitialize(bool privileged, VIR_STRDUP(driver->autostartDir, SYSCONFDIR "/libvirt/storage/autostart") < 0 || VIR_STRDUP(driver->stateDir, - LOCALSTATEDIR "/run/libvirt/storage") < 0) + RUNSTATEDIR "/libvirt/storage") < 0) goto error; } else { configdir =3D virGetUserConfigDirectory(); diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 6861b8a84e..a93c3f809f 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -41,7 +41,7 @@ =20 VIR_LOG_INIT("util.hostdev"); =20 -#define HOSTDEV_STATE_DIR LOCALSTATEDIR "/run/libvirt/hostdevmgr" +#define HOSTDEV_STATE_DIR RUNSTATEDIR "/libvirt/hostdevmgr" =20 static virHostdevManagerPtr manager; /* global hostdev manager, never free= d */ =20 diff --git a/src/util/virpidfile.c b/src/util/virpidfile.c index 999bccbee4..a600cfc662 100644 --- a/src/util/virpidfile.c +++ b/src/util/virpidfile.c @@ -479,7 +479,7 @@ int virPidFileRelease(const char *dir, =20 int virPidFileConstructPath(bool privileged, - const char *statedir, + const char *runstatedir, const char *progname, char **pidfile) { @@ -490,12 +490,12 @@ virPidFileConstructPath(bool privileged, * This is here just to allow calling this function with * statedir =3D=3D NULL; of course only when !privileged. */ - if (!statedir) { + if (!runstatedir) { virReportError(VIR_ERR_INTERNAL_ERROR, - "%s", _("No statedir specified")); + "%s", _("No runstatedir specified")); return -1; } - if (virAsprintf(pidfile, "%s/run/%s.pid", statedir, progname) < 0) + if (virAsprintf(pidfile, "%s/%s.pid", runstatedir, progname) < 0) return -1; } else { if (!(rundir =3D virGetUserRuntimeDirectory())) diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index e75c5b835a..2efc0dd72c 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -749,29 +749,40 @@ virSystemdActivationInitFromMap(virSystemdActivationP= tr act, goto error; } =20 + VIR_DEBUG("Got socket family %d for FD %d", + addr.data.sa.sa_family, nextfd); + for (i =3D 0; i < nmap && !name; i++) { if (map[i].name =3D=3D NULL) continue; =20 if (addr.data.sa.sa_family =3D=3D AF_INET) { - if (map[i].family =3D=3D AF_INET && - addr.data.inet4.sin_port =3D=3D htons(map[i].port)) - name =3D map[i].name; + if (map[i].family =3D=3D AF_INET) { + VIR_DEBUG("Expect %d got %d", + map[i].port, ntohs(addr.data.inet4.sin_port)= ); + if (addr.data.inet4.sin_port =3D=3D htons(map[i].port)) + name =3D map[i].name; + } } else if (addr.data.sa.sa_family =3D=3D AF_INET6) { /* NB use of AF_INET here is correct. The "map" struct * only refers to AF_INET. The socket may be AF_INET * or AF_INET6 */ - if (map[i].family =3D=3D AF_INET && - addr.data.inet6.sin6_port =3D=3D htons(map[i].port)) - name =3D map[i].name; + if (map[i].family =3D=3D AF_INET) { + VIR_DEBUG("Expect %d got %d", + map[i].port, ntohs(addr.data.inet6.sin6_port= )); + if (addr.data.inet6.sin6_port =3D=3D htons(map[i].port= )) + name =3D map[i].name; + } #ifndef WIN32 } else if (addr.data.sa.sa_family =3D=3D AF_UNIX) { - if (map[i].family =3D=3D AF_UNIX && - STREQLEN(map[i].path, - addr.data.un.sun_path, - sizeof(addr.data.un.sun_path))) - name =3D map[i].name; + if (map[i].family =3D=3D AF_UNIX) { + VIR_DEBUG("Expect %s got %s", map[i].path, addr.data.u= n.sun_path); + if (STREQLEN(map[i].path, + addr.data.un.sun_path, + sizeof(addr.data.un.sun_path))) + name =3D map[i].name; + } #endif } else { virReportError(VIR_ERR_INTERNAL_ERROR, diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index da72b209d1..a4f6c39cb7 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -60,7 +60,7 @@ VIR_LOG_INIT("parallels.parallels_driver"); =20 #define PRLCTL "prlctl" =20 -#define VZ_STATEDIR LOCALSTATEDIR "/run/libvirt/vz" +#define VZ_STATEDIR RUNSTATEDIR "/libvirt/vz" =20 static virClassPtr vzDriverClass; =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 18:40:37 2024 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=1566388249; cv=none; d=zoho.com; s=zohoarc; b=YVGaruAh1eHVmcCPr8PoXLtIyxe8LrPZ6HFPo4kXL3hhzbPghsan8xlql+57EGYxQ89XBsj2o2f/SahH5N4SPxdD7yi1Lz99qxPfPBykt1NSGw69/Iai60gjIWNCkQo8sZRqYuPL7Plf5Bh88hde33Da8EdGiX5iI5h1iLgfzbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566388249; 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=chc5/sc7UpUCW8Mqxd9LzB0ITROpsdjpBGbZqJH5EUY=; b=assNEp4QamTKnySPdl75eFOcndD7P2Yoevrlo/1Mx/815lomv/c7TumPl/A413c+KsMxkJIAISC6mXr0frMld0xhbo05afi6O3mmO1a985A23PpGV4f7f0MpR39IDky9XPxnFNn+uLuf8JcSAcw5VpLqDvEds/vA34bHTDNQRSk= 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 1566388249655410.33775691946096; Wed, 21 Aug 2019 04:50:49 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 4D6073086213; Wed, 21 Aug 2019 11:50:48 +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 2088D5EE1D; Wed, 21 Aug 2019 11:50:48 +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 D8FEFE205; Wed, 21 Aug 2019 11:50:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LBoNmJ003495 for ; Wed, 21 Aug 2019 07:50:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id D005C5C25B; Wed, 21 Aug 2019 11:50:23 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFAF05C21A; Wed, 21 Aug 2019 11:50:22 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 12:50:10 +0100 Message-Id: <20190821115011.11240-6-berrange@redhat.com> In-Reply-To: <20190821115011.11240-1-berrange@redhat.com> References: <20190821115011.11240-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 5/6] build: support customization of runstatedir variable with old autoconf 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Wed, 21 Aug 2019 11:50:49 +0000 (UTC) Many distros have moved /var/run to /run with the introduction of systemd. /var/run still exists as a symlink to /run, but its usage is deprecated. autoconf added a --runstatedir option back in 2013 but there's still no new release of autoconf that includes this. gnulib meanwhile added support to propagate this arg's value to configmake.h, but it falls back to $localstatedir/run for autoconf 2.69 and older, which is what every distro today has. To deal with this problem we add a --with-runstatedir arg that then sets the $runstatedir env variable that future autoconf's --runstatedir arg will also use. This finally enables $runstatedir to be pointed to /run. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- configure.ac | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/configure.ac b/configure.ac index f41c6d5d86..120312e4ca 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,29 @@ if test -d $srcdir/.git && git --version >/dev/null 2>= &1 ; then AB_VERSION=3D`cd $srcdir && git describe --match 'v[[0-9]]*' 2>/dev/null` fi =20 +dnl autoconf 2.70 adds a --runstatedir option so that downstreams +dnl can point to /run instead of the historic /var/run, but +dnl autoconf hasn't had a release since 2012. +dnl +dnl gnulib sets configmake.h to include runstatedir, but sets +dnl it to $localstatedir/run if $runstatedir env var is not set +dnl which is useless for apps that need to use /run without +dnl waiting for autoconf 2.70 +dnl +dnl we introduce --with-runstatedir and then overwrite the +dnl value of $runstatedir so gnulib's configmake.h becomes useful +AC_ARG_WITH( + [runstatedir], + [AS_HELP_STRING( + [--with-runstatedir], + [State directory for temporary sockets, pid files, etc])]) + +if test -n "$with_runstatedir" +then + runstatedir=3D$with_runstatedir +fi + + gl_EARLY gl_INIT =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 18:40:37 2024 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=1566388230; cv=none; d=zoho.com; s=zohoarc; b=nAVBWBqs8seofgKXbXyom+RFt0fy2vfYx8BJAMw2+ObpEkEi9RqZqI3idWrFogq0YFpMv7cVT1BGGVJjRyCR55d+KLaxybDeYWyK07rrhm/ufTO/hDw/5XS8xoDcMMH5DqfnvloItasR8aVwZrLACMiEGMN/o4SqAInURNrTitE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566388230; 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=iFSdqmwbCOTq5Yp+L01T/hnyKIgppHW4Fsxw9qX3n3o=; b=fl7JKrEf6T6MeGXGqy1rI0jofreOe5QBjX4CSu2+JlHyTsCOoeK65nibvcNUKVFpXN9czjFCU7XTUZOIxRhtmH6B2t0pr5v4J4R+Q859OhraPxp9FgmR8Ohoy7y0CWbf5753bXCueVKBfaM3OsJEiNt9Y8KfNyaGQryPvkclhYM= 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 1566388230366503.1443526303319; Wed, 21 Aug 2019 04:50:30 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 112573082B02; Wed, 21 Aug 2019 11:50:29 +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 A68F35D9E1; Wed, 21 Aug 2019 11:50:28 +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 962CE1802215; Wed, 21 Aug 2019 11:50:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x7LBoPGV003511 for ; Wed, 21 Aug 2019 07:50:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 780985C231; Wed, 21 Aug 2019 11:50:25 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-61.ams2.redhat.com [10.36.112.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 414E65C21A; Wed, 21 Aug 2019 11:50:24 +0000 (UTC) From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Wed, 21 Aug 2019 12:50:11 +0100 Message-Id: <20190821115011.11240-7-berrange@redhat.com> In-Reply-To: <20190821115011.11240-1-berrange@redhat.com> References: <20190821115011.11240-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 6/6] rpm: set runstatedir to /run directory 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 21 Aug 2019 11:50:29 +0000 (UTC) Use the %{_rundir} RPM variable to set the configure runstatedir variable to /run. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik --- libvirt.spec.in | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index ee4b408510..b7c6d845ef 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1155,7 +1155,8 @@ export SOURCE_DATE_EPOCH=3D$(stat --printf=3D'%Y' %{_= specdir}/%{name}.spec) %endif =20 rm -f po/stamp-po -%configure %{?arg_qemu} \ +%configure --with-runstatedir=3D%{_rundir} \ + %{?arg_qemu} \ %{?arg_openvz} \ %{?arg_lxc} \ %{?arg_vbox} \ @@ -1554,7 +1555,7 @@ exit 0 %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd %dir %{_datadir}/libvirt/ =20 -%ghost %dir %{_localstatedir}/run/libvirt/ +%ghost %dir %{_rundir}/libvirt/ =20 %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/images/ %dir %attr(0711, root, root) %{_localstatedir}/lib/libvirt/filesystems/ @@ -1632,7 +1633,7 @@ exit 0 %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/ %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart -%ghost %dir %{_localstatedir}/run/libvirt/network/ +%ghost %dir %{_rundir}/libvirt/network/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/ %dir %attr(0755, root, root) %{_localstatedir}/lib/libvirt/dnsmasq/ %attr(0755, root, root) %{_libexecdir}/libvirt_leaseshelper @@ -1663,7 +1664,7 @@ exit 0 %{_unitdir}/virtnwfilterd-admin.socket %attr(0755, root, root) %{_sbindir}/virtnwfilterd %dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/ -%ghost %dir %{_localstatedir}/run/libvirt/network/ +%ghost %dir %{_rundir}/libvirt/network/ %{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so =20 %files daemon-driver-secret @@ -1749,7 +1750,7 @@ exit 0 %config(noreplace) %{_sysconfdir}/libvirt/qemu.conf %config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu -%ghost %dir %{_localstatedir}/run/libvirt/qemu/ +%ghost %dir %{_rundir}/libvirt/qemu/ %dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvir= t/qemu/ %dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libv= irt/qemu/ %{_datadir}/augeas/lenses/libvirtd_qemu.aug @@ -1772,7 +1773,7 @@ exit 0 %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/ %config(noreplace) %{_sysconfdir}/libvirt/lxc.conf %config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc -%ghost %dir %{_localstatedir}/run/libvirt/lxc/ +%ghost %dir %{_rundir}/libvirt/lxc/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/lxc/ %{_datadir}/augeas/lenses/libvirtd_lxc.aug %{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug @@ -1796,7 +1797,7 @@ exit 0 %{_datadir}/augeas/lenses/libvirtd_libxl.aug %{_datadir}/augeas/lenses/tests/test_libvirtd_libxl.aug %dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/libxl/ -%ghost %dir %{_localstatedir}/run/libvirt/libxl/ +%ghost %dir %{_rundir}/libvirt/libxl/ %dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/ %{_libdir}/%{name}/connection-driver/libvirt_driver_libxl.so %endif --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list