From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScEwy-0004Vo-Ez for qemu-devel@nongnu.org; Wed, 06 Jun 2012 08:03:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScEws-0000hx-5Q for qemu-devel@nongnu.org; Wed, 06 Jun 2012 08:02:56 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:41361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScEwr-0000hn-S8 for qemu-devel@nongnu.org; Wed, 06 Jun 2012 08:02:50 -0400 Received: by dadv2 with SMTP id v2so9435884dad.4 for ; Wed, 06 Jun 2012 05:02:47 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4FCF46E2.1060004@redhat.com> Date: Wed, 06 Jun 2012 14:02:42 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1337683555-13301-1-git-send-email-lersek@redhat.com> <1337683555-13301-5-git-send-email-lersek@redhat.com> <4FCE7636.6090500@redhat.com> <4FCF3B10.10102@redhat.com> In-Reply-To: <4FCF3B10.10102@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 04/16] qapi: introduce OptsVisitor List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: qemu-devel@nongnu.org, =?ISO-8859-15?Q?Andreas_F=E4rber?= , Michael Roth Il 06/06/2012 13:12, Laszlo Ersek ha scritto: > The unsigned functions don't check if the int64_t value to be assigned is > negative. What happens in such a case is fully defined, but did Michael > really intend the wraparound to unsigned? I think that's a bug. Please coordinate with Michael and Andreas (since the patch is currently lying in his tree) as to who fixes what. > I thought it was a silent requirement for the int parser to return a > non-negative int (which is something I also implemented in > opts_type_int() [*]), but the signed visit_type_XXX() functions do check > for the negative limit. I'm confused. It's not a requirement for the int parser, but I remember now: it was a requirement for the opts visitor, because qemu_opt_get_number returns uint64_t rather than int64_t. However, net_init_* shouldn't assume anything about their struct argument, so the check needs to be added there as if they weren't in the OptsVisitor. Unless you make the types stricter, of course. > If you want I can go through all the integer fields I introduced in [v1 > 06/16] "qapi schema: add Netdev types" and classify each as strictly as > possible (and then remove the checks being obviated). Yes, that would be very nice. Paolo