From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StOta-0004KT-Ga for qemu-devel@nongnu.org; Mon, 23 Jul 2012 16:06:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StOtZ-0006OX-Ji for qemu-devel@nongnu.org; Mon, 23 Jul 2012 16:06:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StOtZ-0006ON-93 for qemu-devel@nongnu.org; Mon, 23 Jul 2012 16:06:21 -0400 Message-ID: <500DAEFF.7060708@redhat.com> Date: Mon, 23 Jul 2012 22:07:27 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1342785709-3152-1-git-send-email-stefanha@linux.vnet.ibm.com> <1342785709-3152-7-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1342785709-3152-7-git-send-email-stefanha@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/16] net: Convert qdev_prop_vlan to peer with hub List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Paolo Bonzini , Zhi Yong Wu , qemu-devel@nongnu.org, Zhi Yong Wu On 07/20/12 14:01, Stefan Hajnoczi wrote: > @@ -638,11 +642,17 @@ static void get_vlan(Object *obj, Visitor *v, void *opaque, > { > DeviceState *dev = DEVICE(obj); > Property *prop = opaque; > - VLANState **ptr = qdev_get_prop_ptr(dev, prop); > - int64_t id; > + VLANClientState **ptr = qdev_get_prop_ptr(dev, prop); > + int64_t id = -1; > > - id = *ptr ? (*ptr)->id : -1; > - visit_type_int64(v, &id, name, errp); > + if (*ptr) { > + unsigned int hub_id; > + if (!net_hub_id_for_client(*ptr, &hub_id)) { > + id = (int64_t)hub_id; > + } > + } > + > + visit_type_int(v, &id, name, errp); > } Should we use uint32 here? (No particular reason, just for "cleanliness" or whatever.) Thanks, Laszlo