Bug 969983 - should fail to use the qemu default allocated mac address to hotplug new nic
should fail to use the qemu default allocated mac address to hotplug new nic
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
high Severity medium
: rc
: ---
Assigned To: Michael S. Tsirkin
Virtualization Bugs
: Regression
Depends On: 969956
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-03 05:06 EDT by Sibiao Luo
Modified: 2013-06-18 08:45 EDT (History)
16 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 969956
Environment:
Last Closed: 2013-06-18 08:45:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 1 Sibiao Luo 2013-06-03 05:09:13 EDT
host info:
kernel-3.10.0-0.rc2.57.el7.x86_64
qemu-kvm-1.5.0-2.el7.x86_64

- test one:   <----------FAIL
# /usr/libexec/qemu-kvm -cpu SandyBridge -M pc-i440fx-1.5 -enable-kvm -vnc :1 -monitor stdio
QEMU 1.5.0 monitor - type 'help' for more information
(qemu) info network 
hub 0
 \ user.0: index=0,type=user,net=10.0.2.0,restrict=off
 \ e1000.0: index=0,type=nic,model=e1000,macaddr=52:54:00:12:34:56
(qemu) netdev_add tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup
(qemu) device_add virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,bus=pci.0,mac=52:54:00:12:34:56
(qemu) info network 
hub 0
 \ user.0: index=0,type=user,net=10.0.2.0,restrict=off
 \ e1000.0: index=0,type=nic,model=e1000,macaddr=52:54:00:12:34:56
virtio-net-pci0: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
 \ hostnet0: index=0,type=tap,ifname=tap1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
(qemu)

- test two:   <----------PASS
# /usr/libexec/qemu-kvm -cpu SandyBridge -M pc-i440fx-1.5 -enable-kvm -vnc :1 -monitor stdio
QEMU 1.5.0 monitor - type 'help' for more information
(qemu) info network 
hub 0
 \ user.0: index=0,type=user,net=10.0.2.0,restrict=off
 \ e1000.0: index=0,type=nic,model=e1000,macaddr=52:54:00:12:34:56
(qemu) netdev_add tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup
(qemu) device_add virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,bus=pci.0
(qemu) info network 
hub 0
 \ user.0: index=0,type=user,net=10.0.2.0,restrict=off
 \ e1000.0: index=0,type=nic,model=e1000,macaddr=52:54:00:12:34:56
virtio-net-pci0: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:57
 \ hostnet0: index=0,type=tap,ifname=tap1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
(qemu)
Comment 3 Sibiao Luo 2013-06-05 22:03:19 EDT
Also tried the following:
1.boot a qemu with a macaddr.
# /usr/libexec/qemu-kvm -netdev tap,id=h1 -device virtio-net-pci,netdev=h1,mac=52:54:00:12:34:56 -vnc :1 -monitor stdio
(qemu) info network 
virtio-net-pci.0: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
 \ h1: index=0,type=tap,ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
2.then hotplug a nic, it will automatically generated macaddr.
(qemu) netdev_add tap,id=h2
(qemu) device_add virtio-net-pci,netdev=h2
(qemu) info network 
virtio-net-pci.0: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
 \ h1: index=0,type=tap,ifname=tap0,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
virtio-net-pci.1: index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
 \ h2: index=0,type=tap,ifname=tap1,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown
(qemu) 

The automatically generated macaddr by QEMU is repeated with the existed macaddr.
Comment 4 Amos Kong 2013-06-17 03:34:16 EDT
QEMU doesn't check if the assigned / auto-generated macaddr is used by other nics. It caused two nics use same macaddr.

We should suggest user/management not use auto-generated & assigned mac together.
Or skip the used nics in auto-generating macaddrs.
Comment 5 Amos Kong 2013-06-18 08:45:56 EDT
Close this bug as WONTFIX according the discussion in [1]

[1] http://lists.nongnu.org/archive/html/qemu-devel/2013-06/msg02707.html

We should not encourage user to use allocated macaddr.

Note You need to log in before you can comment on or make changes to this bug.