Description of problem: When renaming a virtual machine using `virsh domrename`, the autostart symlink in /etc/libvirt/qemu/autostart/ breaks. Version-Release number of selected component (if applicable): 3.9.0-14.el7_5.5 How reproducible: Very Steps to Reproduce: 1. virsh autostart foo 2. virsh domrename foo bar 3. ls -l /etc/libvirt/qemu/autostart/ Actual results: Symlink in /etc/libvirt/qemu/autostart/ is broken Expected results: Symlink would presumably be re-created on domrename
Fixed upstream by: commit 359b938b8b37254e3e714a2a50e4b9a444516133 Refs: v4.5.0-190-g359b938b8b Author: Julio Faracco <jcfaracco> AuthorDate: Thu Jul 19 01:21:48 2018 -0300 Commit: Erik Skultety <eskultet> CommitDate: Thu Jul 19 11:22:28 2018 +0200 qemu: Fix broken autostart symlink after renaming domain If a domain is configured to start on boot, it has a symlink to the domain definition inside the autostart directory. If you rename this domain, the definition is renamed too. The symlink need to be pointed to this renamed file. This commit recreates the symlink after renaming the XML file. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1594985 Signed-off-by: Julio Faracco <jcfaracco> Signed-off-by: Erik Skultety <eskultet>
Reproduce this bug on rhel7.7 with: libvirt-4.5.0-23.virtcov.el7.x86_64 qemu-kvm-rhev-2.12.0-33.el7.x86_64 Steps: 1.# virsh autostart yqz-7.7 Domain yqz-7.7 marked as autostarted # virsh list --all --autostart Id Name State ---------------------------------------------------- - yqz-7.7 shut off # ls -l /etc/libvirt/qemu/autostart/ total 0 lrwxrwxrwx. 1 root root 29 Jul 9 05:34 yqz-7.7.xml -> /etc/libvirt/qemu/yqz-7.7.xml 2.# virsh domrename yqz-7.7 new-7.7 Domain successfully renamed # file /etc/libvirt/qemu/autostart/yqz-7.7.xml /etc/libvirt/qemu/autostart/yqz-7.7.xml: broken symbolic link to `/etc/libvirt/qemu/yqz-7.7.xml' 3.# systemctl restart libvirtd # virsh list --all --autostart Id Name State ---------------------------------------------------- # virsh domstate new-7.7 shut off Verify this bug on rhel-av8.0.1 with: libvirt-daemon-5.0.0-11.module+el8.0.1+3459+e357ef2f.x86_64 qemu-kvm-3.1.0-27.module+el8.0.1+3253+c5371cb3.x86_64 Steps: 1.# virsh autostart avocado-vt-vm1 Domain avocado-vt-vm1 marked as autostarted # virsh list --all --autostart Id Name State --------------------------------- - avocado-vt-vm1 shut off # ls -l /etc/libvirt/qemu/autostart/ total 0 lrwxrwxrwx. 1 root root 36 Jul 9 05:29 avocado-vt-vm1.xml -> /etc/libvirt/qemu/avocado-vt-vm1.xml 2.# virsh domrename avocado-vt-vm1 new-vm1 Domain successfully renamed # ls -l /etc/libvirt/qemu/autostart/ total 0 lrwxrwxrwx. 1 root root 29 Jul 9 05:30 new-vm1.xml -> /etc/libvirt/qemu/new-vm1.xml # file /etc/libvirt/qemu/autostart/new-vm1.xml /etc/libvirt/qemu/autostart/new-vm1.xml: symbolic link to /etc/libvirt/qemu/new-vm1.xml 3.# systemctl restart libvirtd # virsh list --all --autostart Id Name State ------------------------- 1 new-vm1 running And no error or warning in libvirtd.log Since the test result is as expected, mark this bug as verified.
This work was completed and shipped long ago. Closing the bug.