[libvirt-users] "virsh define" modify xml configuration file

hi: I upgrade my system from rhel 7.3 to 7.4. so libvirt upgrade to 3.2. I found command "virsh define vm.xml" sometimes modify "vm.xml". I thought the command will read vm.xml, not write to it. is this kind of behavior by design? for example vm.xml with the line <cpu mode='custom' match='exact'> will be replaced with <cpu mode='custom' match='exact' check='partial'> Regards, tbskyd

On 10/18/2017 06:59 AM, d tbsky wrote:
hi: I upgrade my system from rhel 7.3 to 7.4. so libvirt upgrade to 3.2.
I found command "virsh define vm.xml" sometimes modify "vm.xml".
That command would only modify the file "vm.xml" if it was located in /etc/libvirt/qemu (or /etc/libvirt/lxc, or whatever was appropriate for the domain type) *and* the domain's <name> happened to be "vm". If that's what's happening, this email should be your warning to never directly modify or access the files in /etc/libvirt; they are files used internally by libvirt, and modifying them can lead to "unexpected" results.
I thought the command will read vm.xml, not write to it. is this kind of behavior by design?
for example vm.xml with the line
<cpu mode='custom' match='exact'>
will be replaced with
<cpu mode='custom' match='exact' check='partial'>
Regards, tbskyd
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

2017-10-19 9:48 GMT+08:00 Laine Stump <laine@laine.org>:
On 10/18/2017 06:59 AM, d tbsky wrote:
hi: I upgrade my system from rhel 7.3 to 7.4. so libvirt upgrade to 3.2.
I found command "virsh define vm.xml" sometimes modify "vm.xml".
That command would only modify the file "vm.xml" if it was located in /etc/libvirt/qemu (or /etc/libvirt/lxc, or whatever was appropriate for the domain type) *and* the domain's <name> happened to be "vm". If that's what's happening, this email should be your warning to never directly modify or access the files in /etc/libvirt; they are files used internally by libvirt, and modifying them can lead to "unexpected" results.
got it. thanks a lot for the hint! Regards, tbskyd
participants (2)
-
d tbsky
-
Laine Stump