[CentOS] Still a kvm problem after 5.6 upgrade

Thu Apr 21 19:34:25 UTC 2011
Akemi Yagi <amyagi at gmail.com>

On Thu, Apr 21, 2011 at 12:10 PM, Johnny Hughes <johnny at centos.org> wrote:
> On 04/21/2011 11:01 AM, Kenni Lund wrote:

>> The XML-files in /etc/libvirt/qemu represent libvirt defined VMs, you
>> should never edit these files directly while the libvirtd service is
>> running. You should either use 'virsh edit [vm_name]' or alternatively
>> virsh dump followed by virsh define. If you edit the file directly
>> while some manager is running (like virt-manager in CentOS), your
>> changes will most likely conflict with, or get overwritten by,
>> virt-manager. Nothing critical should happen, but I don't see any
>> reason for encouraging doing it The Wrong Way(TM).
>
> OK ... I just turn off libvirtd and edit the file, then restart libvirtd
> and start the VM.
>
> I am an old school SysIII unix admin, so I just edit files by hand all
> the time.

I hear you :-D

> If it is wrong, then I guess doing it right is OK.

If what I have seen/read is correct, 'virsh edit' has an additional
feature. It will check for errors upon exit. So, it's much like visudo
(versus vi).

When you move kvm guests across different platforms (for example
Fedora to CentOS), editing config files using 'virsh edit' will help.
In this case, you will be running 'virsh define' which may also have a
checking mechanism (not quite sure about this though).

Akemi