From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Hajnoczi Subject: Re: [QEMU PATCH v3] virtio-net: introduce a new macaddr control Date: Thu, 17 Jan 2013 13:40:18 +0100 Message-ID: <20130117124018.GA6830@stefanha-thinkpad.redhat.com> References: <1358418646-29626-1-git-send-email-akong@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: mst@redhat.com, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org, rusty@rustcorp.com.au, kvm@vger.kernel.org To: akong@redhat.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:31920 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755668Ab3AQMlM (ORCPT ); Thu, 17 Jan 2013 07:41:12 -0500 Content-Disposition: inline In-Reply-To: <1358418646-29626-1-git-send-email-akong@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jan 17, 2013 at 06:30:46PM +0800, akong@redhat.com wrote: > 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 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 > --- > V2: check guest's iov_len > V3: fix of migration compatibility > make mac field in config space read-only when new feature is acked > --- > hw/pc_piix.c | 4 ++++ > hw/virtio-net.c | 10 +++++++++- > hw/virtio-net.h | 12 ++++++++++-- > 3 files changed, 23 insertions(+), 3 deletions(-) Reviewed-by: Stefan Hajnoczi