It seems that libvirt currently stores information in ~/.libvirt. It would be great if it would follow the XDG directory standard for file locations. http://standards.freedesktop.org/basedir-spec/latest/ There are nice glib convenience functions for them. See http://developer.gnome.org/glib/2.32/glib-Miscellaneous-Utility-Functions.html#g-get-user-cache-dir and others.
While this might be nice, we could not do any such change without figuring out a way to ensure back compatibility on upgrade.
Created attachment 580899 [details] untested patch
I have no say nor any direct interest in this BZ, but here's a -1 from me. (In reply to comment #0) > It seems that libvirt currently stores information in ~/.libvirt. It would be > great if it would follow the XDG directory standard for file locations. > http://standards.freedesktop.org/basedir-spec/latest/ Why would it be great? XDG is shorthand for X Desktop Group. It's a freedesktop.org "standard". I fail to see why a cross-platform server component's configuration should be affected by it. The $HOME/.config default value for XDG_CONFIG_HOME is awful. (Should $HOME/.wgetrc also be $HOME/.config/.../wgetrc by default?) From <http://en.wikipedia.org/wiki/Freedesktop.org>: "freedesktop.org (fd.o) is a project to work on interoperability and shared base technology for free software desktop environments for the X Window System (X11) on Linux and other Unix-like operating systems." From <http://www.freedesktop.org/wiki/>: "freedesktop.org is open source / open discussion software projects working on interoperability and shared technology for X Window System desktops." libvirt shouldn't have anything to do with Desktop Environments, at least not directly.
@jon since this proposal looks like it'll generate some debate, could you send your patch directly to libvir-list along with a bit of an expanded description as to why you think it is important / valuable for us to make this change @laszlo while I don't think libvirt should tie itself into desktop environments, I tend to think of the XDG directory specification as a fairly neutral standard. There's nothing in there that is strongly desktop related and not applicable to servers. As an example, SystemD follows the XDG base directory spec & I don't think we can claim that is a desktop only application.
(In reply to comment #4) > @jon since this proposal looks like it'll generate some debate, could you send > your patch directly to libvir-list along with a bit of an expanded > description as to why you think it is important / valuable for us to make this > change I'm not subscribed, but I'd honestly appreciate if you kept me CC'd. I like to think that I allow people to convince me if they have a point :) Jon, can you please CC me on your initial mail? > @laszlo while I don't think libvirt should tie itself into desktop > environments, I tend to think of the XDG directory specification as a fairly > neutral standard. There's nothing in there that is strongly desktop related > and > not applicable to servers. As an example, SystemD follows the XDG base > directory spec & I don't think we can claim that is a desktop only > application. Sorry for digressing, but systemd and the quoted XDG spec share an author. It's not that systemd's key people got independently convinced about the technical / ergonomic merits of the XDG basedir spec. (In my admittedly superficial reading, the latter fails to state its motivation, so I supposed it's in-line with the general freedesktop.org mission.) As discussed on LWN recently (<http://lwn.net/Articles/494248/> and <http://lwn.net/Articles/494082/>, see the comments and the links pointing outwards too), many people think the people around the "systemd ecosystem" have an overly over-arching, too-multi-functional vision about how a modern Linux (and Linux-only) system should be structured. Now I'll have to excuse myself for being non-constructive, but for me, systemd as an example following the XDG basedir spec is rather more a "con" than a "pro", when it comes to libvirt upstream. Independence (stuff not playing together) may be less than optimal for end-user experience, but it's invaluable for portability and traditional flexibility (ie. as old-timer sysadmins think about it). More constructively, please see XDG_RUNTIME_DIR under <http://standards.freedesktop.org/basedir-spec/latest/ar01s03.html>. I have no idea if ~/.libvirt now stores files that would fall into that category ("user-specific non-essential runtime files"), but XDG_RUNTIME_DIR does seem to be tied to interactive logins (see the next paragraph there). Anyway I wouldn't want to drag down this BZ to the flamefest that's going on everywhere else anyway. I attempted to state my case. It's perfectly possible that I didn't provide enough rational support for it. Whatever libvirt upstream is going to decide, I'm curious to hear and glad to accept.
commit 32a9aac2e04c991340b66c855a1095e4e6445e54 Author: William Jon McCann <william.jon.mccann> Date: Thu May 3 12:36:27 2012 -0400 Use XDG Base Directories instead of storing in home directory