Bug 503481

Summary: Errors reported after setting network bridge autostart for second time.
Product: Red Hat Enterprise Linux 5 Reporter: Edward Wang <edwang>
Component: libvirtAssignee: Daniel Berrangé <berrange>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.4CC: berrange, llim, nzhang, veillard, virt-maint, xen-maint, yshao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-02 09:21:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Edward Wang 2009-06-01 09:50:48 UTC
Description of problem:
I created(not define) a new network bridge, and set the autostart to the "yes", then use the command "virsh net-destroy <the bridge>" to destroy the bridge directly, I created the bridge using the same xml file and set the autostart to "yes" again, error reported as follows:  
------
error: failed to mark network virnet1 as autostarted
error: Failed to create symlink '/etc/libvirt/qemu/networks/autostart/virnet1.xml' to '/etc/libvirt/qemu/networks/virnet1.xml': File exists
------

Version-Release number of selected component (if applicable):
- libvirt: 0.6.3-3el5


How reproducible:
100%, every time

Steps to Reproduce:
1. virsh net-create network.xml
2. virsh net-autostart virnet1
3. virsh net-destroy virnet1
=== 2nd time ===
4. virsh net-create network.xml 
5. virsh net-autostart virnet1
  
Actual results:
error message is threw out when execute step 5:
------
error: failed to mark network virnet1 as autostarted
error: Failed to create symlink '/etc/libvirt/qemu/networks/autostart/virnet1.xml' to '/etc/libvirt/qemu/networks/virnet1.xml': File exists
------

Expected results:
no error occurred.

Additional info:
1. System information is as below:
   [root@localhost perlsysvirt]# uname -a
   Linux localhost.localdomain 2.6.18-128.1.10.el5xen #1 SMP Wed Apr 29 14:24:51 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

Comment 1 Daniel Berrangé 2009-06-01 10:12:08 UTC
Hmm, 'net-create' creates a transient guest, so libvirt should never have let you set the autostart flag in the first place. Sounds like a missing check in the autostart method impl.

Comment 4 Lawrence Lim 2009-06-02 00:35:30 UTC
Since libvirt ald has a slot, proposed to 5.4 for now. Please feel to move to 5.5 if you feel its not appropriate.

Comment 5 Daniel Veillard 2009-06-03 16:02:46 UTC
libvirt-0.6.3-4.el5 has been built in dist-5E-qu-candidate with the
patch,

Daniel

Comment 7 Nan Zhang 2009-06-04 12:25:16 UTC
[root@dhcp-66-70-85 ~]# virsh net-list
Name                 State      Autostart
-----------------------------------------
default              active     yes       

[root@dhcp-66-70-85 ~]# virsh net-edit default
Network default XML configuration not changed.

[root@dhcp-66-70-85 ~]# virsh net-create network.xml 
Network virnet1 created from network.xml

[root@dhcp-66-70-85 ~]# virsh net-list
Name                 State      Autostart
-----------------------------------------
default              active     yes       
virnet1              active     no        

[root@dhcp-66-70-85 ~]# virsh net-autostart virnet1
error: failed to mark network virnet1 as autostarted
error: internal error cannot set autostart for transient network

[root@dhcp-66-70-85 ~]# rpm -q libvirt
libvirt-0.6.3-4.el5


This bug has been verified with libvirt 0.6.3-4 on RHEL-5.4. Already added check in the autostart method. Fixed.

Comment 10 errata-xmlrpc 2009-09-02 09:21:28 UTC
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/RHEA-2009-1269.html