Bug 815584 - Use XDG dirs instead of $HOME
Use XDG dirs instead of $HOME
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libvirt (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Libvirt Maintainers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-23 21:24 EDT by jmccann
Modified: 2015-01-14 18:26 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-14 10:26:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
untested patch (25.44 KB, patch)
2012-04-27 21:29 EDT, jmccann
no flags Details | Diff

  None (edit)
Description jmccann 2012-04-23 21:24:14 EDT
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.
Comment 1 Daniel Berrange 2012-04-24 05:15:03 EDT
While this might be nice, we could not do any such change without figuring out a way to ensure back compatibility on upgrade.
Comment 2 jmccann 2012-04-27 21:29:19 EDT
Created attachment 580899 [details]
untested patch
Comment 3 Laszlo Ersek 2012-04-30 03:39:56 EDT
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.
Comment 4 Daniel Berrange 2012-04-30 04:01:05 EDT
@jon since this proposal looks like it'll generate some debate, could you send your patch directly to libvir-list@redhat.com 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.
Comment 5 Laszlo Ersek 2012-04-30 05:19:18 EDT
(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@redhat.com 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.
Comment 6 Daniel Berrange 2012-05-14 10:26:49 EDT
commit 32a9aac2e04c991340b66c855a1095e4e6445e54
Author: William Jon McCann <william.jon.mccann@gmail.com>
Date:   Thu May 3 12:36:27 2012 -0400

    Use XDG Base Directories instead of storing in home directory

Note You need to log in before you can comment on or make changes to this bug.