/etc/profile.d/libvirt-uri.sh (LIBVIRT_DEFAULT_URI setting) overrides configured default

Bug #2027838 reported by Daniel Richard G.
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
In Progress
Wishlist
Lena Voytek
Jammy
In Progress
Undecided
Lena Voytek
Lunar
Won't Fix
Undecided
Lena Voytek
Mantic
In Progress
Undecided
Lena Voytek

Bug Description

This concerns libvirt-clients 8.0.0-1ubuntu7.5 in Ubuntu 22.04/jammy.

The /etc/profile.d/libvirt-uri.sh profile script sets LIBVIRT_DEFAULT_URI to a value of "qemu:///system" or "xen:///". This setting occurs irrespective of any previous value (so this cannot be overridden by an earlier profile script or environment setting) or setting for uri_default in /etc/libvirt/libvirt.conf .

I wanted the default connection URI to be "qemu:///session", and was wondering why virsh(1) insisted on connecting to the system session despite my having set uri_default in libvirt.conf.

It seems to me that the profile script may no longer be needed in light of the uri_default setting, and should thus be removed. (Notably, the Debian libvirt-clients package does not contain this script.) If there is still a need for it, then it should at least be made more admin-friendly.

Related branches

Revision history for this message
Bryce Harrington (bryce) wrote :

From the debian changelog, it appears this script was added to perform an automated switch when xen is in use. It was added prior to 2015, and does not appear to have been substantially modified since then. So, I suspect a question may be if this xen use case is still important. If not, then your suggested course of action could make sense.

OTOH, if the automatic behavior with xen is important, then it sounds like what is needed would be either a way to ensure user settings in /etc/libvirt/libvirt.conf take precedence, or to provide administrators with a straightforward way to disable the automated behavior.

Changed in libvirt (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
tags: added: server-triage-discuss
Revision history for this message
Daniel Richard G. (skunk) wrote :

Wouldn't it make sense to have a libvirt-clients package script set the appropriate value (Xen or no Xen) in libvirt.conf, perhaps with an associated debconf question? The current approach doesn't seem consistent with normal Debian/Ubuntu practice.

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Daniel, thanks for the quick reply. I am not personally familiar enough with libvirt to say, but offhand I do agree with you that the current approach feels like it could be done more cleanly. I've tagged the bug as 'server-triage-discuss' which adds it to a list of review items for the server team's Wednesday meeting.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I think we need to keep qemu:system as the default.
But you are right
- we do no more need xen nowadays
- we want users to be able to override it in non-weird ways

We'll have a look at this when merging a recent libvirt for 23.10

tags: added: libvirt-23.10 server-todo
removed: server-triage-discuss
Revision history for this message
Lena Voytek (lvoytek) wrote :

I'll add this as part of the libvirt merge

Changed in libvirt (Ubuntu):
assignee: nobody → Lena Voytek (lvoytek)
Lena Voytek (lvoytek)
Changed in libvirt (Ubuntu):
status: Triaged → In Progress
Changed in libvirt (Ubuntu Jammy):
assignee: nobody → Lena Voytek (lvoytek)
Changed in libvirt (Ubuntu Lunar):
assignee: nobody → Lena Voytek (lvoytek)
Revision history for this message
Lena Voytek (lvoytek) wrote :

Fixed in mantic merge, I'll start the SRUs soon

Changed in libvirt (Ubuntu):
status: In Progress → Fix Released
Lena Voytek (lvoytek)
Changed in libvirt (Ubuntu Jammy):
status: New → In Progress
Changed in libvirt (Ubuntu Lunar):
status: New → In Progress
Revision history for this message
Lena Voytek (lvoytek) wrote :

Going to update the fix with a full removal of the script while making sure qemu:///system remains as the default uri_default, setting back to in progress and adding mantic

Changed in libvirt (Ubuntu Mantic):
status: New → In Progress
Changed in libvirt (Ubuntu):
status: Fix Released → In Progress
Changed in libvirt (Ubuntu Mantic):
assignee: nobody → Lena Voytek (lvoytek)
Bryce Harrington (bryce)
tags: removed: server-todo
Revision history for this message
Brian Murray (brian-murray) wrote :

Ubuntu 23.04 (Lunar Lobster) has reached end of life, so this bug will not be fixed for that specific release.

Changed in libvirt (Ubuntu Lunar):
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.