Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 670431

Summary: iface-dumpxml displays old information after iface-edit operation
Product: Red Hat Enterprise Linux 6 Reporter: zhanghaiyan <yoyzhang>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: dallan, dyuan, eblake, llim, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-21 22:49:13 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 zhanghaiyan 2011-01-18 09:39:04 UTC
Description of problem:
Use 'virsh iface-edit eth0' command to modify eth0 mac address successfully, but 'virsh iface-dumpxml eth0' still display the old mac address while /etc/sysconfig/network-scripts/ifcfg-eth0, augtool, ncftool all display new mac address

Version-Release number of selected component (if applicable):
- netcf-0.1.7-1.el6.x86_64
- netcf-libs-0.1.7-1.el6.x86_64
- libvirt-0.8.7-2.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. # virsh iface-dumpxml eth0
<interface type='ethernet' name='eth0'>
  <mac address='00:21:9b:7d:f9:71'/>
  <protocol family='ipv4'>
    <ip address='10.66.93.146' prefix='23'/>
  </protocol>
  <protocol family='ipv6'>
    <ip address='fe80::221:9bff:fe7d:f971' prefix='64'/>
  </protocol>
</interface>
2. Change eth0 mac address 
# virsh iface-edit eth0
<interface type='ethernet' name='eth0'>
  <start mode='none'/>
  <mac address='00:25:64:a7:1f:4d'/>
  <protocol family='ipv4'>
    <dhcp/>
  </protocol>
</interface>
3. # virsh iface-dumpxml eth0
<interface type='ethernet' name='eth0'>
  <mac address='00:21:9b:7d:f9:71'/>
  <protocol family='ipv4'>
    <ip address='10.66.93.146' prefix='23'/>
  </protocol>
  <protocol family='ipv6'>
    <ip address='fe80::221:9bff:fe7d:f971' prefix='64'/>
  </protocol>
</interface>
4. Double check the modify is really updated by # virsh iface-edit eth0 
5. # cat /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0
HWADDR=00:25:64:a7:1f:4d
ONBOOT=no
BOOTPROTO=dhcp
6. # augtool 
augtool> print /files/etc/sysconfig/network-scripts/ifcfg-eth0/
/files/etc/sysconfig/network-scripts/ifcfg-eth0
/files/etc/sysconfig/network-scripts/ifcfg-eth0/DEVICE = "eth0"
/files/etc/sysconfig/network-scripts/ifcfg-eth0/HWADDR = "00:25:64:a7:1f:4d"
/files/etc/sysconfig/network-scripts/ifcfg-eth0/ONBOOT = "no"
/files/etc/sysconfig/network-scripts/ifcfg-eth0/BOOTPROTO = "dhcp"
augtool> 
7. # ncftool 
ncftool> dumpxml eth0
<?xml version="1.0"?>
<interface type="ethernet" name="eth0">
  <start mode="none"/>
  <mac address="00:25:64:a7:1f:4d"/>
  <protocol family="ipv4">
    <dhcp/>
  </protocol>
</interface>

ncftool> 
8. # service network restart
Shutting down interface eth0:  Device eth0 has MAC address 00:21:9b:7d:f9:71, instead of configured address 00:25:64:a7:1f:4d. Ignoring.
                                                           [FAILED]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Device eth0 has different MAC address than expected, ignoring.
                                                           [FAILED]

Actual results:
step3, virsh iface-dumpxml eth0 still display the old mac address

Expected results:
step3, virsh iface-dumpxml eth0 should display the new mac address
step8, in fact, I think it better forbidden modify eth0 mac address. 

Additional info:
So IMHO
1) if it allows to modify eth0 mac address, then virsh iface-dumpxml eth0 should display the new address 
2) or it should not allow to modify eth0 mac address. when it detects the mac address is modified, then fail the edit operation.

Comment 2 Laine Stump 2011-01-21 22:49:13 UTC
The command "virsh iface-dumpxml eth0" displays an XML encoding of the current running state of eth0. When you update an interface's config with iface-edit, you are modifying the config files; the actual running state of the interface will not change until you do an iface-down command followed by iface-up for that interface.

If you want to see the current contents of the interface's config files, the proper command is:

   virsh iface-dumpxml --inactive