Re: [QEMU PATCH v4 2/3] virtio-net: introduce a new macaddr control

2013-01-22 Thread Amos Kong
On Mon, Jan 21, 2013 at 05:08:26PM +0100, Stefan Hajnoczi wrote: On Sat, Jan 19, 2013 at 09:54:27AM +0800, ak...@redhat.com wrote: @@ -350,6 +351,18 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd, struct virtio_net_ctrl_mac mac_data; size_t s; +if (cmd

Re: [QEMU PATCH v4 2/3] virtio-net: introduce a new macaddr control

2013-01-21 Thread Stefan Hajnoczi
On Sat, Jan 19, 2013 at 09:54:27AM +0800, ak...@redhat.com wrote: @@ -350,6 +351,18 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd, struct virtio_net_ctrl_mac mac_data; size_t s; +if (cmd == VIRTIO_NET_CTRL_MAC_ADDR_SET) { +if (iov_size(iov, iov_cnt)

[QEMU PATCH v4 2/3] virtio-net: introduce a new macaddr control

2013-01-18 Thread akong
From: Amos Kong ak...@redhat.com 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