From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1vmT-0004uT-Fj for qemu-devel@nongnu.org; Fri, 19 Dec 2014 06:31:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1vmP-0007NS-0u for qemu-devel@nongnu.org; Fri, 19 Dec 2014 06:31:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1vmO-0007NO-QD for qemu-devel@nongnu.org; Fri, 19 Dec 2014 06:31:32 -0500 Date: Fri, 19 Dec 2014 11:31:25 +0000 From: Stefan Hajnoczi Message-ID: <20141219113125.GA17683@stefanha-thinkpad.redhat.com> References: <1413177397-30734-1-git-send-email-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x+6KMIRAuhnl3hBn" Content-Disposition: inline In-Reply-To: <1413177397-30734-1-git-send-email-jasowang@redhat.com> Subject: Re: [Qemu-devel] [PATCH V3] net: don't use set/get_pointer() in set/get_netdev() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang Cc: Peter Maydell , Markus Armbruster , qemu-devel@nongnu.org, mst@redhat.com --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 13, 2014 at 01:16:37PM +0800, Jason Wang wrote: > Commit 1ceef9f27359cbe92ef124bf74de6f792e71f6fb (net: multiqueue > support) tries to use set_pointer() and get_pointer() to set and get > NICPeers which is not a pointer defined in DEFINE_PROP_NETDEV. This > trick works but result a unclean and fragile implementation (e.g > print_netdev and parse_netdev). >=20 > This patch solves this issue by not using set/get_pinter() and set and > get netdev directly in set_netdev() and get_netdev(). After this the > parse_netdev() and print_netdev() were no longer used and dropped from > the source. >=20 > Cc: Markus Armbruster > Cc: Stefan Hajnoczi > Cc: Peter Maydell > Signed-off-by: Jason Wang > --- > Changes from V2: > - Use error_setg() instead of error_set_from_qdev_prop_error() for E2BIG = error. > - Clean the return part of the set_netdev() since > eror_set_from_qdev_prop_error() does nothing when err is 0. > Changes from V1: > - validate ncs pointer before accessing them, this fixes the qtest failure > on arm. > --- > hw/core/qdev-properties-system.c | 70 ++++++++++++++++++++++------------= ------ > 1 file changed, 38 insertions(+), 32 deletions(-) Renamed 'err' label to 'out' as suggested by Markus. Thanks, applied to my net tree: https://github.com/stefanha/qemu/commits/net Stefan --x+6KMIRAuhnl3hBn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUlAyNAAoJEJykq7OBq3PINuIH/iNYMbNp8+9m1jmeZY790EIw 8El0rxRhr0TV67NIFyqZiN9HDxw7GF9B9dd2uPw4KGfoqO//m4N7Md8lhSYFiGcD p2caKrKfia++1XdOwLOdu2T0wN04ItC0G+OK9cHmsKqZ5q5DZ0cQuePrBlTX6uyP jTceBZMLc+X/Rdwu0TOcLdNzP1nhxM7ZN/d7QA0OQonFlDa5SmtAnheb9faVUH8T Z/Xh6sa2bfNon0TuZV94S0XGEpjeUVS6stAUB0xiixt/DQAK63lZMbQLZnFcsb/3 k3BYM/d5B/jXioH65hiY3jjunzK3C4mVC06JKwhuhxij0Gg5dcWgaEi+nB6vF10= =J6mq -----END PGP SIGNATURE----- --x+6KMIRAuhnl3hBn--