From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc0e6-0000Ya-PO for qemu-devel@nongnu.org; Tue, 05 Jun 2012 16:46:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sc0e5-0008EO-3A for qemu-devel@nongnu.org; Tue, 05 Jun 2012 16:46:30 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:53929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc0e4-0008EE-Ql for qemu-devel@nongnu.org; Tue, 05 Jun 2012 16:46:29 -0400 Received: by dadv2 with SMTP id v2so8441619dad.4 for ; Tue, 05 Jun 2012 13:46:26 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4FCE701D.40208@redhat.com> Date: Tue, 05 Jun 2012 22:46:21 +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> In-Reply-To: <1337683555-13301-9-git-send-email-lersek@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: , To: Laszlo Ersek Cc: qemu-devel@nongnu.org Il 22/05/2012 12:45, Laszlo Ersek 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; - name = u.net->name; + name = u.net->has_name ? u.net->name : NULL; Paolo