virtio-net: introduce a new macaddr control

In virtio-net guest driver, currently we write MAC address to
pci config space byte by byte, this means that we have an
intermediate step where mac is wrong. This patch introduced
a new control command to set MAC address, it's atomic.

VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature bit for compatibility.

"mac" field will be set to read-only when VIRTIO_NET_F_CTRL_MAC_ADDR
is acked.

Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Amos Kong 2013-01-22 23:44:45 +08:00 committed by Michael S. Tsirkin
parent 921ac5d0f3
commit c1943a3f37
3 changed files with 26 additions and 3 deletions

View file

@ -309,6 +309,10 @@ static QEMUMachine pc_i440fx_machine_v1_4 = {
.driver = "usb-tablet",\
.property = "usb_version",\
.value = stringify(1),\
},{\
.driver = "virtio-net-pci",\
.property = "ctrl_mac_addr",\
.value = "off", \
}
static QEMUMachine pc_machine_v1_3 = {