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.
Description of problem:
Boot up guest with no network related parameters, then guest would have a default rtl8139 nic with default macaddress(52:54:00:12:34:56).
And try to hotplug a new nic to guest by monitor, but qemu also allocate (52:54:00:12:34:56) to the new nic.
Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.162.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
1. boot up guest with no network related parameters
# qemu-kvm -boot n -monitor stdio
(qemu) info network
VLAN 0 devices:
user.0: net=10.0.2.0, restricted=n
rtl8139.0: model=rtl8139,macaddr=52:54:00:12:34:56
Devices not on any VLAN:
2. hotplug a new nic to guest
(qemu) netdev_add tap,id=h1
(qemu) device_add virtio-net-pci,netdev=h1
3. check the network info by monitor
(qemu) info network
VLAN 0 devices:
user.0: net=10.0.2.0, restricted=n
rtl8139.0: model=rtl8139,macaddr=52:54:00:12:34:56
Devices not on any VLAN:
h1: ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown peer=virtio-net-pci.0
virtio-net-pci.0: model=virtio-net-pci,macaddr=52:54:00:12:34:56 peer=h1
4. login guest and check the nic info
guest)# ifconfig
Actual results:
The second nic got a same macaddress as 1th nic.
Expected results:
The second nic got a different macaddress.
Additional info:
default nic has a default mac address:
net.c:
798 static int net_init_nic(QemuOpts *opts,
799 Monitor *mon,
800 const char *name,
801 VLANState *vlan)
802 {
.....
837 nd->macaddr[0] = 0x52;
838 nd->macaddr[1] = 0x54;
839 nd->macaddr[2] = 0x00;
840 nd->macaddr[3] = 0x12;
841 nd->macaddr[4] = 0x34;
842 nd->macaddr[5] = 0x56 + idx;
^ idx=0
hotpluged nic got mac from this function:
net.c:
176 void qemu_macaddr_default_if_unset(MACAddr *macaddr)
177 {
178 static int index = 0;
179 static const MACAddr zero = { .a = { 0,0,0,0,0,0 } };
180
181 if (memcmp(macaddr, &zero, sizeof(zero)) != 0)
182 return;
183 macaddr->a[0] = 0x52;
184 macaddr->a[1] = 0x54;
185 macaddr->a[2] = 0x00;
186 macaddr->a[3] = 0x12;
187 macaddr->a[4] = 0x34;
188 macaddr->a[5] = 0x56 + index++;
^ index=0
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHSA-2011-1531.html
Description of problem: Boot up guest with no network related parameters, then guest would have a default rtl8139 nic with default macaddress(52:54:00:12:34:56). And try to hotplug a new nic to guest by monitor, but qemu also allocate (52:54:00:12:34:56) to the new nic. Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.162.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. boot up guest with no network related parameters # qemu-kvm -boot n -monitor stdio (qemu) info network VLAN 0 devices: user.0: net=10.0.2.0, restricted=n rtl8139.0: model=rtl8139,macaddr=52:54:00:12:34:56 Devices not on any VLAN: 2. hotplug a new nic to guest (qemu) netdev_add tap,id=h1 (qemu) device_add virtio-net-pci,netdev=h1 3. check the network info by monitor (qemu) info network VLAN 0 devices: user.0: net=10.0.2.0, restricted=n rtl8139.0: model=rtl8139,macaddr=52:54:00:12:34:56 Devices not on any VLAN: h1: ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown peer=virtio-net-pci.0 virtio-net-pci.0: model=virtio-net-pci,macaddr=52:54:00:12:34:56 peer=h1 4. login guest and check the nic info guest)# ifconfig Actual results: The second nic got a same macaddress as 1th nic. Expected results: The second nic got a different macaddress. Additional info: default nic has a default mac address: net.c: 798 static int net_init_nic(QemuOpts *opts, 799 Monitor *mon, 800 const char *name, 801 VLANState *vlan) 802 { ..... 837 nd->macaddr[0] = 0x52; 838 nd->macaddr[1] = 0x54; 839 nd->macaddr[2] = 0x00; 840 nd->macaddr[3] = 0x12; 841 nd->macaddr[4] = 0x34; 842 nd->macaddr[5] = 0x56 + idx; ^ idx=0 hotpluged nic got mac from this function: net.c: 176 void qemu_macaddr_default_if_unset(MACAddr *macaddr) 177 { 178 static int index = 0; 179 static const MACAddr zero = { .a = { 0,0,0,0,0,0 } }; 180 181 if (memcmp(macaddr, &zero, sizeof(zero)) != 0) 182 return; 183 macaddr->a[0] = 0x52; 184 macaddr->a[1] = 0x54; 185 macaddr->a[2] = 0x00; 186 macaddr->a[3] = 0x12; 187 macaddr->a[4] = 0x34; 188 macaddr->a[5] = 0x56 + index++; ^ index=0