Description of problem: Using 'virsh edit' a guest domain. On Xen, it's only copy a new config file but not saved to original config file. On KVM, it's not allowed. Version-Release number of selected component (if applicable): RHEL-5.4 libvirt 0.6.3-5.el5 How reproducible: Alway Steps to Reproduce: Xen: # virsh list --all Id Name State ----------------------------- 0 Domain-0 running - foo shut off # virsh edit foo (Edit domain name as 'foo1') # virsh list --all Id Name State ----------------------------- 0 Domain-0 running - foo shut off - foo1 shut off KVM: # virsh list --all Id Name State ----------------------------- - demo shut off # virsh edit demo (Edit domain name as 'demo1') error: operation failed: domain 'demo' is already defined with uuid 9cc9875a-b591-bfad-b0c1-106964cf483c Actual results: Cannot be saved. Expected results: Guest domain name will be changed to new name. Additional info:
On Xen, 'virsh edit' a guest domain, add the following in 'devices' section, also cannot be saved. <serial type='file'> <source path='/var/log/serial.log'/> <target port='1'/> </serial>
Changing the '<name>' field during 'virsh edit' is *not* intended to work. So in fact the bug is in Xen for allowing this. It should refuse it just like KVM does.
I'm fairly sure this needs to be in libvirt component. The code being impacted here is the libvirt code for writing directly into /etc/xen, since the RHEL-5 vintage XenD does not provide APIs for this.
Created attachment 369862 [details] patch to fix the issue
Also posted and ACK'ed upstream: https://www.redhat.com/archives/libvir-list/2009-November/msg00593.html Daniel
libvirt-0.6.3-22.el5 has been built in dist-5E-qu-candidate with the fixes, Daniel
Verified with libvirt 0.6.3-25.el5 on RHEL-5.4, it's already fixed. But I found an error, is it another bug? [root@dhcp-66-70-85 ~]# virsh list --all libnuma: Warning: /sys not mounted or no numa system. Assuming one node: No such file or directory Id Name State ---------------------------------- 0 Domain-0 running - demo shut off - foo shut off - rhel5u3fv shut off - test shut off - winxp shut off - xentest shut off [root@dhcp-66-70-85 ~]# virsh edit foo libnuma: Warning: /sys not mounted or no numa system. Assuming one node: No such file or directory error: operation failed: domain 'foo' is already defined with uuid aff181be-0df7-f761-66bf-c542136f3192
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2010-0205.html