[PATCH v4 2/3] net: split eth_mac_addr for better error handling

2013-01-19 Thread akong
From: Stefan Hajnoczi When we set mac address, software mac address in system and hardware mac address all need to be updated. Current eth_mac_addr() doesn't allow callers to implement error handling nicely. This patch split eth_mac_addr() to prepare part and real commit part, then we can prepar

[PATCH v4 3/3] virtio-net: introduce a new control to set macaddr

2013-01-19 Thread akong
From: Amos Kong 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. Signe

[PATCH v4 1/3] move virtnet_send_command() above virtnet_set_mac_address()

2013-01-19 Thread akong
From: Amos Kong We want to send vq command to set mac address in virtnet_set_mac_address(), so do this function moving. Fixed a little issue of coding style. Signed-off-by: Amos Kong --- drivers/net/virtio_net.c | 89 1 file changed, 44 insertio

[PATCH v4 0/3] make mac programming for virtio net more robust

2013-01-19 Thread akong
From: Amos Kong Currenly mac is programmed byte by byte. This means that we have an intermediate step where mac is wrong. Third patch introduced a new vq control command to set mac address, it's atomic. V2: check return of sending command, delay eth_mac_addr() V3: restore software address when

[QEMU PATCH v4 3/3] virtio-net: rename ctrl rx commands

2013-01-18 Thread akong
From: Amos Kong This patch makes rx commands consistent with specification. Signed-off-by: Amos Kong --- hw/virtio-net.c | 14 +++--- hw/virtio-net.h | 14 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index cf40ff2..5

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

2013-01-18 Thread akong
From: Amos Kong 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 b

[QEMU PATCH v4 1/3] virtio-net: remove layout assumptions for ctrl vq

2013-01-18 Thread akong
From: "Michael S. Tsirkin" Virtio-net code makes assumption about virtqueue descriptor layout (e.g. sg[0] is the header, sg[1] is the data buffer). This patch makes code not rely on the layout of descriptors. Signed-off-by: Michael S. Tsirkin Signed-off-by: Amos Kong --- hw/virtio-net.c | 12

[QEMU PATCH v4 0/3] virtio-net: fix of ctrl commands

2013-01-18 Thread akong
From: Amos Kong Currently virtio-net code relys on the layout of descriptor, this patchset removed the assumptions and introduced a control command to set mac address. Last patch is a trivial renaming. V2: check guest's iov_len V3: fix of migration compatibility make mac field in config spac

[PATCH v3] virtio-spec: set mac address by a new vq command

2013-01-18 Thread akong
From: Amos Kong Virtio-net driver currently programs MAC address 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 in one time, and added a new feature flag VIRTIO_NET_F_MAC_ADDR for this feature. "mac" f

[PATCH v3 0/2] make mac programming for virtio net more robust

2013-01-17 Thread akong
From: Amos Kong Currenly mac is programmed byte by byte. This means that we have an intermediate step where mac is wrong. Second patch introduced a new vq control command to set mac address, it's atomic. V2: check return of sending command, delay eth_mac_addr() V3: restore software address whe

[PATCH v3 2/2] virtio-net: introduce a new control to set macaddr

2013-01-17 Thread akong
From: Amos Kong 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. Signe

[PATCH v3 1/2] move virtnet_send_command() above virtnet_set_mac_address()

2013-01-17 Thread akong
From: Amos Kong We will send vq command to set mac address in virtnet_set_mac_address() a little fix of coding style Signed-off-by: Amos Kong --- drivers/net/virtio_net.c | 89 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/driv

[QEMU PATCH v3] virtio-net: introduce a new macaddr control

2013-01-17 Thread akong
From: Amos Kong 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 b

[PATCH v2] virtio-spec: set mac address by a new vq command

2013-01-17 Thread akong
From: Amos Kong Virtio-net driver currently programs MAC address 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 in one time, and added a new feature flag VIRTIO_NET_F_MAC_ADDR for this feature. Signed-

[PATCH] virtio-spec: set mac address by a new vq command

2013-01-15 Thread akong
From: Amos Kong Virtio-net driver currently programs MAC address 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 in one time, and added a new feature flag VIRTIO_NET_F_MAC_ADDR for this feature. Signed-

[QEMU PATCH v2] virtio-net: introduce a new macaddr control

2013-01-15 Thread akong
From: Amos Kong 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 in one time. VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature bi

[PATCH v2 0/2] make mac programming for virtio net more robust

2013-01-15 Thread akong
From: Amos Kong Currenly mac is programmed byte by byte. This means that we have an intermediate step where mac is wrong. Second patch introduced a new vq control command to set mac address in one time. V2: check return of sending command, delay eth_mac_addr() Amos Kong (2): move virtnet_se

[PATCH v2 1/2] move virtnet_send_command() above virtnet_set_mac_address()

2013-01-15 Thread akong
From: Amos Kong We will send vq command to set mac address in virtnet_set_mac_address() a little fix of coding style Signed-off-by: Amos Kong --- drivers/net/virtio_net.c | 89 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/driv

[PATCH v2 2/2] virtio-net: introduce a new control to set macaddr

2013-01-15 Thread akong
From: Amos Kong 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 in one time. VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature bit for compatibility. Signed

[RFC PATCH] virtio-net: introduce a new macaddr control

2013-01-10 Thread akong
From: Amos Kong 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 in one time. VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature bi

[RFC PATCH 2/2] virtio-net: introduce a new control to set macaddr

2013-01-10 Thread akong
From: Amos Kong 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 in one time. VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature bit for compatibility. Signed

[RFC PATCH 1/2] move virtnet_send_command() above virtnet_set_mac_address()

2013-01-10 Thread akong
From: Amos Kong We will send vq command to set mac address in virtnet_set_mac_address() a little fix of coding style Signed-off-by: Amos Kong --- drivers/net/virtio_net.c | 89 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/driv

[RFC PATCH 0/2] make mac programming for virtio net more robust

2013-01-10 Thread akong
From: Amos Kong Currenly mac is programmed byte by byte. This means that we have an intermediate step where mac is wrong. Second patch introduced a new vq control command to set mac address in one time. Amos Kong (2): move virtnet_send_command() above virtnet_set_mac_address() virtio-net:

[PATCH] virtio-spec: fix two typos

2013-01-08 Thread akong
From: Amos Kong VIRTIO_NET_F_VTRL_VQ -> VIRTIO_NET_F_CTRL_VQ VIRTIO_NET_CTRL_MQ is defined to 4 in kernel code Signed-off-by: Amos Kong --- virtio-spec.lyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virtio-spec.lyx b/virtio-spec.lyx index 78ec5d0..1ba9992 100644 --

[PATCH] virtio-spec: Fix wrong bit number of device status

2011-06-07 Thread akong
From: Amos Kong qemu-kvm/hw/virtio_config.h: #define VIRTIO_CONFIG_S_ACKNOWLEDGE 1 #define VIRTIO_CONFIG_S_DRIVER 2 #define VIRTIO_CONFIG_S_DRIVER_OK 4 #define VIRTIO_CONFIG_S_FAILED 0x80 virtio-spec: ACKNOWLEDGE(1) : DRIVER(2) : DRIVER_OK(3) : FAILED(128)

[PATCH] KVM: Remove redundant change of return value

2010-06-21 Thread akong
From: Amos Kong In the following situation, assign zero to 'r' is redundant, just remove them. r = foo(); if (r) goto out; r = 0; ... Signed-off-by: Amos Kong --- arch/x86/kvm/x86.c |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arc