qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 00/16] introduce OptsVisitor, rebase -net/-netde


From: Michael Roth
Subject: Re: [Qemu-devel] [PATCH 00/16] introduce OptsVisitor, rebase -net/-netdev parsing
Date: Wed, 6 Jun 2012 10:31:57 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Jun 06, 2012 at 10:16:40AM -0500, Michael Roth wrote:
> On Wed, Jun 06, 2012 at 04:10:44PM +0200, Paolo Bonzini wrote:
> > Il 06/06/2012 15:31, Andreas Färber ha scritto:
> > >> > 
> > >> > (a) add < 0 checks to <http://patchwork.ozlabs.org/patch/150427/> and
> > >> >     include it in the series,
> > >> > (b) make all Netdev integer types as strict as possible, remove
> > >> >     superfluous checks,
> > >> > (c) render NetLegacy::name optional.
> > >> > 
> > >> > How do I lay out (a)? Should I include the patch verbatim first (with
> > >> > proper From: and Signed-off-by: lines) and then modify it in a small
> > >> > followup, or squash those two and... what? :)
> > > I am missing context here. The referenced patch is on qom-next already
> > > and will thus be in my upcoming PULL (today or tomorrow) unless someone
> > > comments on that patch, cc'ing me, that there's an error. Feel free to
> > > cherry-pick from there but do not squash into random series please.
> > > 
> > > I don't understand what < 0 checks you are talking about, lacking time
> > > to go through this QIDL patch series ATM.
> > 
> > The uintXX visitors do not fail if you pass a negative value.  I'm fine
> > with including the patch with the small bug and fixing it as a
> > follow-up, there's plenty of time before 1.2.
> 
> How would we implement such a check?
> 
> In the case of uint64_t, the field we're visiting is passed in as a
> uint64_t*, so -1 is indistinguishable from the unsigned interpretation
> of the field, which is within the valid range. 
> 
> For uintXX_t where XX < 64, a negative value would exceed the UINTXX_MAX
> check, so those cases are already handled.

Argh, scratch that, same faulty logic that caused me to miss this the
first time around. We're storing to an intermediate int64_t rather than
a uint64_t, so a negative value would still pass the check, so a < 0
check is warranted.

Agreed this should be a seperate patch though.

> 
> Or am I missing something?


> 
> > 
> > Paolo
> > 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]