Bug 1817776 - virt-qemu-run doesn't look at user or system config (by default)
Summary: virt-qemu-run doesn't look at user or system config (by default)
Keywords:
Status: NEW
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: 2020-03-26 23:57 UTC by Marc-Andre Lureau
Modified: 2020-05-05 21:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Marc-Andre Lureau 2020-03-26 23:57:44 UTC
I am testing virt-qemu-run from master, not sure where to report/discuss this.

I would expect virt-qemu-run to use my user or system configuration by default.

That is, load or copy $HOME/.config/libvirt or /etc/libvirt configuration files.

Comment 1 Daniel Berrangé 2020-03-27 10:17:04 UTC
I think you're mis-understanding what  virt-qemu-run is for. We introduced a concept of an embedded libvirt QEMU driver, which is completely independent of / isolated from the existing system/session drivers. The virt-qemu-run tool is a command for running a QEMU guest using the embedded QEMU driver and thus completely isolated from any other QEMU on the host. As such it will never load $HOME/.config/libvirt nor /etc/libvirt.  If not args are used, it will create a temporary directory to storing all files, or you can give an explicit path to a virtual root.

Comment 2 Marc-Andre Lureau 2020-03-27 11:12:17 UTC
(In reply to Daniel Berrangé from comment #1)
> I think you're mis-understanding what  virt-qemu-run is for. We introduced a
> concept of an embedded libvirt QEMU driver, which is completely independent
> of / isolated from the existing system/session drivers. The virt-qemu-run
> tool is a command for running a QEMU guest using the embedded QEMU driver
> and thus completely isolated from any other QEMU on the host. As such it
> will never load $HOME/.config/libvirt nor /etc/libvirt.  If not args are
> used, it will create a temporary directory to storing all files, or you can
> give an explicit path to a virtual root.

But can it have some libvirtd.conf/qemu.conf ?

Comment 3 Daniel Berrangé 2020-03-27 11:15:59 UTC
It uses a virtual root directory this the layout described here:

   https://libvirt.org/drvqemu.html#uriembedded

There is not concept of a libvirtd.conf as there is no daemon involved. You can give a qemu.conf but you'll need to explicitly tell it what directory to use instead of having it create a throwaway temp dir.  The general intention is that we should never need to use qemu.conf for any aspect related to guest config - we want anything commonly used to be configurable via the domain XML, but we do have some gaps in this area right now.

Comment 4 Marc-Andre Lureau 2020-03-27 15:58:36 UTC
(In reply to Daniel Berrangé from comment #3)
> It uses a virtual root directory this the layout described here:
> 
>    https://libvirt.org/drvqemu.html#uriembedded
> 
> There is not concept of a libvirtd.conf as there is no daemon involved. You
> can give a qemu.conf but you'll need to explicitly tell it what directory to
> use instead of having it create a throwaway temp dir.  The general intention
> is that we should never need to use qemu.conf for any aspect related to
> guest config - we want anything commonly used to be configurable via the
> domain XML, but we do have some gaps in this area right now.

The intent is sensible, but I think a lot of qemu.conf is still nice to have, and having another mechanism, such as more options or environment variables, or having to be explicit in the XML, all have drawbacks.

Could we have system/user qemu.conf loaded/copied by default, and have a --no-config option or similar?

Comment 5 Daniel Berrangé 2020-03-27 16:11:59 UTC
(In reply to Marc-Andre Lureau from comment #4)
> (In reply to Daniel Berrangé from comment #3)
> The intent is sensible, but I think a lot of qemu.conf is still nice to
> have, and having another mechanism, such as more options or environment
> variables, or having to be explicit in the XML, all have drawbacks.

You can still use qemu.conf, but you'll need to set it up ahead of time.

> Could we have system/user qemu.conf loaded/copied by default, and have a
> --no-config option or similar?

Definitely not - there could be completely arbitrarily settings in qemu.conf that will negatively impact with the embedded driver. Being completely separated from the session/system drivers is a core goal.

Comment 6 Marc-Andre Lureau 2020-03-27 16:19:14 UTC
(In reply to Daniel Berrangé from comment #5)
> > Could we have system/user qemu.conf loaded/copied by default, and have a
> > --no-config option or similar?
> 
> Definitely not - there could be completely arbitrarily settings in qemu.conf
> that will negatively impact with the embedded driver. Being completely
> separated from the session/system drivers is a core goal.

I don't get what's wrong with having qemu.conf loaded. I mean, virt-qemu-run behaves as if there was a common qemu.conf with default values already.

Comment 7 Daniel Berrangé 2020-03-27 16:21:30 UTC
(In reply to Marc-Andre Lureau from comment #6)
> (In reply to Daniel Berrangé from comment #5)
> > > Could we have system/user qemu.conf loaded/copied by default, and have a
> > > --no-config option or similar?
> > 
> > Definitely not - there could be completely arbitrarily settings in qemu.conf
> > that will negatively impact with the embedded driver. Being completely
> > separated from the session/system drivers is a core goal.
> 
> I don't get what's wrong with having qemu.conf loaded. I mean, virt-qemu-run
> behaves as if there was a common qemu.conf with default values already.

Again, the embedded driver is intended to be completely independent of the system/session drivers. Changes to configuration of the those drivers, must NEVER affect operation of applications using the embedded driver.

Comment 8 Marc-Andre Lureau 2020-03-27 16:27:54 UTC
(In reply to Daniel Berrangé from comment #7)
> (In reply to Marc-Andre Lureau from comment #6)
> > I don't get what's wrong with having qemu.conf loaded. I mean, virt-qemu-run
> > behaves as if there was a common qemu.conf with default values already.
> 
> Again, the embedded driver is intended to be completely independent of the
> system/session drivers. Changes to configuration of the those drivers, must
> NEVER affect operation of applications using the embedded driver.

We could make virt-qemu-run more sensible and user friendly, without touching the embedded driver behaviour.


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