Bug 638619

Summary: [RHEL6-Beta] 'virsh attach-interface' succeeds even if a duplicate MAC address is specified.
Product: Red Hat Enterprise Linux 6 Reporter: Sadique Puthen <sputhenp>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.0CC: dallan, dyuan, eblake, gsun, jwest, skito, xen-maint, ydu
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: 2011-06-17 18:02:54 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:
Bug Depends On:    
Bug Blocks: 658636    

Description Sadique Puthen 2010-09-29 14:10:00 UTC
Description of problem:

Description of Problem:

"virsh attach-interface" succeeds as follows even if a duplicate MAC address is specified.

# virsh attach-interface vm1 bridge br0 --mac 02:17:42:2F:99:01
Interface attached successfully

# virsh attach-interface vm1 bridge br0 --mac 02:17:42:2F:99:01
Interface attached successfully

It should report an error message like "MAC address already attached"

Version-Release number of selected component:

Red Hat Enterprise Linux Version Number: 6
Release Number: snapshot13
Architecture: x86_64
Kernel Version: kernel-2.6.32-70.el6.x86_64
Related Package Version: libvirt-client-0.8.1-27.el6.x86_64


How reproducible:
Always

Steps to Reproduce:

# virsh attach-interface rhel6 bridge br0 --mac 02:17:42:2F:99:01
Interface attached successfully

# virsh attach-interface rhel6 bridge br0 --mac 02:17:42:2F:99:01
Interface attached successfully

Both command created vnet1 and vnet2 on the Host and a eth1 and eth2 on the guest with a mac address of 00:00:00:00:00:00 (which could be another bug). virsh dumpxml shows the duplicate macs are accepted.

    <interface type='bridge'>
      <mac address='02:17:42:2f:99:01'/>
      <source bridge='br0'/>
      <target dev='vnet1'/>
      <alias name='net1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </interface>
    <interface type='bridge'>
      <mac address='02:17:42:2f:99:01'/>
      <source bridge='br0'/>
      <target dev='vnet2'/>
      <alias name='net2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>  

Actual results:

libvirt allows to specify duplicate macs

Expected results:

libvirt should allow to specify duplicate macs

Additional info: