Bug 192441 - devel/libvirt update to 1.2.7, switch state dir from /usr/local/var to /var
Summary: devel/libvirt update to 1.2.7, switch state dir from /usr/local/var to /var
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jason Helfman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-06 15:07 UTC by olevole
Modified: 2014-10-31 00:04 UTC (History)
4 users (show)

See Also:


Attachments
devel/libvirt update to 1.2.7, switch state dir from /usr/local/var to /var (6.39 KB, text/plain)
2014-08-06 15:07 UTC, olevole
no flags Details
update patch according to Roman advice: VARDIR is not configurable (6.39 KB, patch)
2014-08-06 19:55 UTC, olevole
no flags Details | Diff
libvirt 1.2.7 and /var (4.52 KB, patch)
2014-08-20 18:41 UTC, Jason Helfman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description olevole 2014-08-06 15:07:05 UTC
Created attachment 145421 [details]
devel/libvirt update to 1.2.7, switch state dir from /usr/local/var to /var

- update to 1.2.7

- It would be very nice to move /usr/local/var into default /var/ directory causes it problems with the interaction between FreeBSD libvirt and not-FreeBSD libvirt systems. I'm not sure that this decision ( with so many directories ) the best, but I suggest this option.

Tested on FreeBSD-HEAD/amd64 r269506.
Comment 1 Roman Bogorodskiy freebsd_committer 2014-08-06 15:30:51 UTC
Assign to maintainer.

Few comments on this:

 * I think an UPDATING entry should be provided for /usr/local/var -> /var change as libvirt stored various stuff there like hypervisor pids, VM states etc and it would be safer to copy that stuff over to the new location. 
 * I'm not sure that this path should be changeable for a port user: +LIBVIRT_RUNDIR?=	${VARDIR}/run/libvirt

If a user wants to chance paths, it'd would be better to change it in the libvirt config file. Also, this way works for both ports and packages.
Comment 2 Roman Bogorodskiy freebsd_committer 2014-08-06 15:35:14 UTC
A little more on the reasoning behind /usr/local/var -> /var path change.

When connecting using virsh or e.g. virt-manager from FreeBSD host to libvirtd running on Linux, it will look for libvird socket in /usr/local/var/run/libvirt, however, Linux systems store that in /var/run/libvirt. The connection will fail with an error that's not so easy to understand: it'll say something that the daemon is probably not running etc.

The same happens when connecting from Linux hosts to libvirtd on FreeBSD -- it'll look for socket in /var/run/libvirt, but it's on /usr/local/var/run/libvirt.
Comment 3 Jason Helfman freebsd_committer 2014-08-06 16:04:49 UTC
I agree with Roman on this. The port already breaks hierarchy, and I have wanted to change this behavior for some time. Please update the patch so /var is not configurable in the Makefile. I will have time to work on this shortly.

Thanks!
-jgh
Comment 4 olevole 2014-08-06 19:55:56 UTC
Created attachment 145424 [details]
update patch according to Roman advice: VARDIR is not configurable

update patch according to Roman advice: VARDIR is not configurable
Comment 5 Jason Helfman freebsd_committer 2014-08-07 05:40:37 UTC
Thank you very much for your time and work on this patch, however I am curious if if /var is unconfigurable, it seems that some of the complexity of the patch could be removed.

For example, instead of defining the following:

RUNDIR_NETWORK=	${LIBVIRT_RUNDIR}/network	
RUNDIR_QEMU=	${LIBVIRT_RUNDIR}/qemu
RUNDIR_LOCKD=	${LIBVIRT_RUNDIR}/lockd

I would simply define ${LIBVIRT_RUNDIR}, as you have:
LIBVIRT_RUNDIR=	${VARDIR}/run/libvirt

And then flat add the other directories. I don't see why they all need to be defined.

.for dir in network qmu lockd ...
${MKDIR} ${STAGEDIR}${LIBVIRT_RUNDIR}${dir} ...
.endfor

Thanks, and thoughts are welcome!
Comment 6 Jason Helfman freebsd_committer 2014-08-20 18:41:39 UTC
Created attachment 146081 [details]
libvirt 1.2.7 and /var
Comment 7 Jason Helfman freebsd_committer 2014-08-20 18:41:51 UTC
I worked out a patch today, that I believe should do the trick based on the original patch.

Please let me know what you think.

I do have to wait on an infrastructure change, though, as there is an issue with OPTIONS_DEFAULT at this point.
Comment 8 Conrad Meyer 2014-10-26 21:53:17 UTC
Please apply, and update to 1.2.9 while you're at it. Thanks.
Comment 9 Conrad Meyer 2014-10-27 00:33:26 UTC
(In reply to jgh from comment #7)
> I do have to wait on an infrastructure change, though, as there is an issue
> with OPTIONS_DEFAULT at this point.

I think maybe Bryan fixed that with this commit[0]? You can't set OPTIONS_DEFAULt after including bsd.port.option.mk.

[0]: https://github.com/freebsd/freebsd-ports/commit/bbd7d7a4df48bdeef2c0052a653632bb2b1c916c

Thanks.
Comment 10 Willem Jan Withagen 2014-10-27 14:23:58 UTC
(In reply to Conrad Meyer from comment #8)
> Please apply, and update to 1.2.9 while you're at it. Thanks.

I fetched 1.2.10 from the git repo yesterday.

And was required to remove -Werror from the tools/Makefile
to keep going.

It is IMHO sort of a wierd thing to include such an amount of W-flags, but then anyways. That part is probably not up to FreeBSD.
Comment 11 Roman Bogorodskiy freebsd_committer 2014-10-27 16:15:36 UTC
It could be configured with --disable-werror, no need to edit Makefiles. Also, it's disabled by default in the release builds IIRC. However, could you please paste the errors you get with -Werror?
Comment 12 Conrad Meyer 2014-10-27 16:28:04 UTC
(In reply to Roman Bogorodskiy from comment #11)
> Also, it's disabled by default in the release builds IIRC.

1.2.10 doesn't actually exist yet, I think Willem means he fetched latest git.
Comment 13 Willem Jan Withagen 2014-10-27 17:38:32 UTC
(In reply to Conrad Meyer from comment #12)

> 1.2.10 doesn't actually exist yet, I think Willem means he fetched latest
> git.

Probably more than true...
"but" virsh version gives me 1.2.10.
FreeBSD would probably call it HEAD.

The error Roman was asking about:
In tools:
make  all-am
  CC       virsh-virsh.o
cc1: warnings being treated as errors
In file included from /usr/local/include/readline/readline.h:36,
                 from virsh.c:53:
/usr/local/include/readline/rltypedefs.h:34: warning: function declaration isn't a prototype [-Wstrict-prototypes]
/usr/local/include/readline/rltypedefs.h:35: warning: function declaration isn't a prototype [-Wstrict-prototypes]
/usr/local/include/readline/rltypedefs.h:36: warning: function declaration isn't a prototype [-Wstrict-prototypes]
/usr/local/include/readline/rltypedefs.h:37: warning: function declaration isn't a prototype [-Wstrict-prototypes]
In file included from virsh.c:53:
/usr/local/include/readline/readline.h:381: warning: function declaration isn't a prototype [-Wstrict-prototypes]

And looking at this part of the readline code is way to much for my fragile soul.
Comment 14 Jason Helfman freebsd_committer 2014-10-27 18:14:31 UTC
I finally starting making some headway on this last week after getting a proper build environment working. I should be able to update this week. Any thoughts on an UPDATING message for /var shift?
Comment 15 Roman Bogorodskiy freebsd_committer 2014-10-27 18:17:13 UTC
As for UPDATING, I think it would be enough to mention that users are advised to copy over contents of the old var directory to the new path if they want to preserve resources from the old setup.
Comment 16 Jason Helfman freebsd_committer 2014-10-27 18:25:45 UTC
Thanks, Roman!

And also....

Well, I was getting 1.2.8 to build fine, however 1.2.9 is a different story...
So far, failures to files, not sure if this is a build issue or something else. Will look later, but feel free to let me know if you see anything that jumps out.

http://meatwad.mouf.net/rubick/poudriere/data/92amd64-jgh/2014-10-27_18h15m20s/logs/errors/libvirt-1.2.9.log

pkg-static: lstat(/wrkdirs/usr/ports/devel/libvirt/work/stage/usr/local/lib/libvirt-lxc.so.0.1002.8): No such file or directory
pkg-static: lstat(/wrkdirs/usr/ports/devel/libvirt/work/stage/usr/local/lib/libvirt-qemu.so.0.1002.8): No such file or directory
pkg-static: lstat(/wrkdirs/usr/ports/devel/libvirt/work/stage/usr/local/lib/libvirt.so.0.1002.8): No such file or directory
Comment 17 Jason Helfman freebsd_committer 2014-10-27 18:32:11 UTC
Doh. Forget it :)
Comment 18 commit-hook freebsd_committer 2014-10-29 22:18:10 UTC
A commit references this bug:

Author: jgh
Date: Wed Oct 29 22:18:02 UTC 2014
New revision: 371717
URL: https://svnweb.freebsd.org/changeset/ports/371717

Log:
  - update libvirt,py-libvirt,libvirt-glib to 0.1.9
  - shift var from ${PREFIX} to /var
  - bump shared libs of dep. port

  PR:		192441 (based on)
  Submitted by:	olevole@olevole.ru

Changes:
  head/UPDATING
  head/deskutils/virt-manager/Makefile
  head/devel/libvirt/Makefile
  head/devel/libvirt/distinfo
  head/devel/libvirt/files/libvirtd.in
  head/devel/libvirt/pkg-plist
  head/devel/libvirt-glib/Makefile
  head/devel/libvirt-glib/distinfo
  head/devel/libvirt-glib/pkg-plist
  head/devel/libvirt-java/Makefile
  head/devel/p5-Sys-Virt/Makefile
  head/devel/py-libvirt/Makefile
  head/devel/py-libvirt/distinfo
  head/net-mgmt/collectd/Makefile
  head/net-mgmt/collectd5/Makefile
  head/net-mgmt/virt-viewer/Makefile
  head/net-mgmt/virtinst/Makefile
  head/sysutils/cfengine33/Makefile
  head/sysutils/cfengine34/Makefile
  head/sysutils/cfengine35/Makefile
  head/sysutils/cfengine36/Makefile
  head/sysutils/cfengine36-rc/Makefile
Comment 19 Conrad Meyer 2014-10-29 22:21:12 UTC
Thanks!
Comment 20 Jason Helfman freebsd_committer 2014-10-31 00:04:54 UTC
Thanks!