From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se0Ro-0005oh-Qv for qemu-devel@nongnu.org; Mon, 11 Jun 2012 04:58:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Se0Rk-0003d0-1h for qemu-devel@nongnu.org; Mon, 11 Jun 2012 04:58:04 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:43285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se0Rj-0003cG-PD for qemu-devel@nongnu.org; Mon, 11 Jun 2012 04:57:59 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Jun 2012 09:57:52 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5B8vnLg2781242 for ; Mon, 11 Jun 2012 09:57:49 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q5B8vlkl010667 for ; Mon, 11 Jun 2012 02:57:48 -0600 Date: Mon, 11 Jun 2012 09:57:47 +0100 From: Stefan Hajnoczi Message-ID: <20120611085747.GA998@stefanha-thinkpad.localdomain> References: <1338787767-3443-1-git-send-email-zwu.kernel@gmail.com> <1338787767-3443-7-git-send-email-zwu.kernel@gmail.com> <4FD59029.5040204@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FD59029.5040204@redhat.com> 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: Paolo Bonzini Cc: aliguori@us.ibm.com, Stefan Hajnoczi , qemu-devel@nongnu.org, Zhi Yong Wu , Zhi Yong Wu , luowenj@cn.ibm.com, jan.kiszka@siemens.com On Mon, Jun 11, 2012 at 08:28:57AM +0200, Paolo Bonzini wrote: > Il 09/06/2012 05:04, Zhi Yong Wu ha scritto: > >>>> 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=1 -device virtio-net-pci,vlan=1 > >>>> > >>>> 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= 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 :(. > >>>> > > To be honest, i am concerned if anyone uses this syntax. Since the > > feature will finally be discarded, i suggest that we don't support > > this now. If someone complains this later, we can fix it. If nobody > > complains, that is what we hope. > > I think you're missing the big picture of this series, which is exactly > _not_ to discard the VLAN feature, but just to rewrite it in a better way. > > That said, I agree that this is a somewhat fringe usage; most people > will use -net nic,model=virtio,vlan=1 rather than "-device". We may get > by with dropping it. I have no strong opinion either way. Either we keep backwards compatibility or we don't. Taking a middle path where we preserve only some of the "VLAN" syntax is confusing and inconsistent. Like Paolo said, the point here is not to drop "VLAN" support. We're simply moving this feature into a regular net client (the hub) so that the special case "VLAN" code in net.c can be removed. Stefan