[libvirt] uses of /etc/libvirt/<driver>/

Jim Fehlig jfehlig at suse.com
Tue Mar 18 14:26:32 UTC 2014


Michal Privoznik wrote:
> On 18.03.2014 02:20, Eric Blake wrote:
>> On 03/17/2014 05:46 PM, Jim Fehlig wrote:
>>> I received a report about an odd use case of /etc/libvirt/<driver>/
>>> config files, and would like to hear some opinions about it.  The user
>>> "preps" a host by mounting a remote fs containing VM images and config,
>>> creates links in /etc/libvirt/<driver>/dom.xml to
>>> /mnt-point/whatever/dom.xml, and starts libvirtd.  All is well until
>>> there is a need to modify the VM config (e.g. virsh setmaxmem ...
>>> --config), at which point libvirt replaces the link with a file
>>> containing the new config, instead of updating the contents of the
>>> linked file.
>>
>> Not a valid use case.  Instead, the user should 'virsh define' (or
>> otherwise use the libvirt APIs).
>>
>>>
>>> I suppose I've always considered the contents of /etc/libvirt/<driver>/
>>> private to libvirt, with a "modify at your own risk" warning, ignoring
>>> that it is user configuration in /etc.  What are the guidelines for
>>> modifying the contents of these directories?  Would the above be
>>> considered valid use?
>>
>> Point your user to:
>> http://wiki.libvirt.org/page/FAQ#Where_are_VM_config_files_stored.3F_How_do_I_edit_a_VM.27s_XML_config.3F
>>
>>
>> and hopefully they will quit abusing files under /etc, as that usage is
>> explicitly unsupported.  We only support modifications made through
>> libvirt APIs.
>
> But they are modifying XML through libvirt APIs (virsh setmaxmem ...).
> However, if they are sharing XML over several hosts, it won't work
> (this really is unsupported). You don't want libvirtd to be polling
> for XML definition file changes made from outside and then re-parsing
> the file.

Yes, I would *not* want that behavior :).

>
> What they could do, is to symlink the <driver> directory instead of
> individual XML files there.

Or mount the <driver> directory with their config, or virDomainDefineXML
as Eric suggests.  I guess the question was more about what users are
allowed to do with files in this directory.  I've always claimed "not
much".  Thanks to all for confirming that.

Regards,
Jim




More information about the libvir-list mailing list