[libvirt] [PATCH] Pre-create /var/lib/libvirt/sanlock directory

From: "Daniel P. Berrange" <berrange@redhat.com> The sanlock plugin for libvirt expects the directory /var/lib/libvirt/sanlock to exist. Create this and add it to the RPM * libvirt.spec.in: Add /var/lib/libvirt/sanlock * src/Makefile.am: Create /var/lib/libvirt/sanlock --- libvirt.spec.in | 1 + src/Makefile.am | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 6cbd9ac..7c8b2ec 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1046,6 +1046,7 @@ fi %attr(0755, root, root) %{_libdir}/libvirt/lock-driver/sanlock.so %{_datadir}/augeas/lenses/libvirt_sanlock.aug %{_datadir}/augeas/lenses/tests/test_libvirt_sanlock.aug +%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/sanlock %{_sbindir}/virt-sanlock-cleanup %{_mandir}/man8/virt-sanlock-cleanup.8* %endif diff --git a/src/Makefile.am b/src/Makefile.am index 481caba..c1786cf 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1396,6 +1396,9 @@ install-data-local: $(MKDIR_P) "$(DESTDIR)$(localstatedir)/cache/libvirt" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/images" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" +if HAVE_SANLOCK + $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" +endif if WITH_QEMU $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/qemu" @@ -1438,6 +1441,9 @@ uninstall-local:: rmdir "$(DESTDIR)$(localstatedir)/cache/libvirt" ||: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/images" ||: rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/boot" ||: +if HAVE_SANLOCK + rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/sanlock" ||: +endif if WITH_QEMU rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/qemu" ||: rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/qemu" ||: -- 1.7.6

On 07/22/2011 08:15 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange@redhat.com>
The sanlock plugin for libvirt expects the directory /var/lib/libvirt/sanlock to exist. Create this and add it to the RPM
* libvirt.spec.in: Add /var/lib/libvirt/sanlock * src/Makefile.am: Create /var/lib/libvirt/sanlock --- libvirt.spec.in | 1 + src/Makefile.am | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-)
ACK. Is sanlock even feasible on mingw? Do we need any counterpart tweaks to mingw32-libvirt.spec.in? -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Fri, Jul 22, 2011 at 08:46:10AM -0600, Eric Blake wrote:
On 07/22/2011 08:15 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange"<berrange@redhat.com>
The sanlock plugin for libvirt expects the directory /var/lib/libvirt/sanlock to exist. Create this and add it to the RPM
* libvirt.spec.in: Add /var/lib/libvirt/sanlock * src/Makefile.am: Create /var/lib/libvirt/sanlock --- libvirt.spec.in | 1 + src/Makefile.am | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-)
ACK. Is sanlock even feasible on mingw? Do we need any counterpart tweaks to mingw32-libvirt.spec.in?
No, it isn't enabled for win32 builds Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
Eric Blake