From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc0yt-0007ta-Jq for qemu-devel@nongnu.org; Tue, 05 Jun 2012 17:08:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sc0ys-0004Fk-2Q for qemu-devel@nongnu.org; Tue, 05 Jun 2012 17:07:59 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:63914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc0yr-0004Ff-PU for qemu-devel@nongnu.org; Tue, 05 Jun 2012 17:07:57 -0400 Received: by pbbro12 with SMTP id ro12so8656234pbb.4 for ; Tue, 05 Jun 2012 14:07:55 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4FCE7526.7070207@redhat.com> Date: Tue, 05 Jun 2012 23:07:50 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1337683555-13301-1-git-send-email-lersek@redhat.com> <1337683555-13301-9-git-send-email-lersek@redhat.com> <4FCE701D.40208@redhat.com> In-Reply-To: <4FCE701D.40208@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/16] convert net_client_init() to OptsVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laszlo Ersek , qemu-devel@nongnu.org Il 05/06/2012 22:46, Paolo Bonzini ha scritto: >> > (1) since both Netdev::id and NetLegacy::name are mandatory now, getting the >> > name for the init functions is cleaner; > But they shouldn't be mandatory, should they? ("-net nic -net user" > should work, and also "-net nic,netdev=foo -netdev user,id=foo"). > > Nevertheless it should be as simple as doing > > - name = u.netdev->id; > + name = u.netdev->has_id ? u.netdev->id : NULL; Oops, id *is* mandatory. > - name = u.net->name; > + name = u.net->has_name ? u.net->name : NULL; Still, name is not. Paolo