From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scz9k-0006Z5-Ly for qemu-devel@nongnu.org; Fri, 08 Jun 2012 09:23:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Scz9f-0007ww-Oz for qemu-devel@nongnu.org; Fri, 08 Jun 2012 09:23:12 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:45418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scz9f-0007we-EV for qemu-devel@nongnu.org; Fri, 08 Jun 2012 09:23:07 -0400 Received: by lbok6 with SMTP id k6so1531822lbo.4 for ; Fri, 08 Jun 2012 06:23:05 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1338787767-3443-7-git-send-email-zwu.kernel@gmail.com> References: <1338787767-3443-1-git-send-email-zwu.kernel@gmail.com> <1338787767-3443-7-git-send-email-zwu.kernel@gmail.com> Date: Fri, 8 Jun 2012 14:23:04 +0100 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v4 06/16] net: Remove vlan qdev property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zwu.kernel@gmail.com Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org, Zhi Yong Wu , luowenj@cn.ibm.com, pbonzini@redhat.com On Mon, Jun 4, 2012 at 6:29 AM, wrote: > From: Stefan Hajnoczi > > The vlan feature is implemented using hubs and no longer uses > special-purpose VLANState structs that are accessible as qdev > properties. > > Signed-off-by: Stefan Hajnoczi > Signed-off-by: Zhi Yong Wu > --- > =A0hw/qdev-properties.c | =A0 72 ----------------------------------------= ---------- > =A0hw/qdev.c =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A02 - > =A0hw/qdev.h =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A04 --- > =A0net.h =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 =A03 -- > =A04 files changed, 0 insertions(+), 81 deletions(-) This commit looks suspicious because it removes a user-visible qdev property but we're trying to preserve backward compatibility. This command-line will break: x86_64-softmmu/qemu-system-x86_64 -net user,vlan=3D1 -device virtio-net-pci= ,vlan=3D1 Instead of dropping the qdev_prop_vlan completely the hw/qdev-properties.c code needs to call net/hub.h external functions to implement equivalent functionality: 1. Setting the vlan=3D property looks up the hub port and assigns the NICConf->peer field. 2. Getting the vlan property looks up the hub id (i.e. vlan id) given the peer. If the peer is not a hub port the result is -1. When I wrote this patch I missed the big picture and forgot about backwards compatibility :(. Do you feel comfortable rewriting this commit? Stefan