Bug 815584 - Use XDG dirs instead of $HOME
Summary: Use XDG dirs instead of $HOME
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-24 01:24 UTC by jmccann
Modified: 2015-01-14 23:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-14 14:26:49 UTC
Embargoed:


Attachments (Terms of Use)
untested patch (25.44 KB, patch)
2012-04-28 01:29 UTC, jmccann
no flags Details | Diff

Description jmccann 2012-04-24 01:24:14 UTC
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 Berrangé 2012-04-24 09:15:03 UTC
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-28 01:29:19 UTC
Created attachment 580899 [details]
untested patch

Comment 3 Laszlo Ersek 2012-04-30 07:39:56 UTC
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 Berrangé 2012-04-30 08:01:05 UTC
@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.

Comment 5 Laszlo Ersek 2012-04-30 09:19:18 UTC
(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.

Comment 6 Daniel Berrangé 2012-05-14 14:26:49 UTC
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


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