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

2012-06-11 Thread Paolo Bonzini
Il 09/06/2012 17:30, Laszlo Ersek ha scritto: > The net init functions all depend on integer optarg values being > non-negative. Originally this is (or should be...) ensured by > parse_option_number() [qemu-option.c] calling strtoull(), and "more > recently" by opts_type_int() in this series. > >

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

2012-06-09 Thread Laszlo Ersek
On 06/06/12 15:03, Laszlo Ersek wrote: > (b) make all Netdev integer types as strict as possible, remove > superfluous checks, The net init functions all depend on integer optarg values being non-negative. Originally this is (or should be...) ensured by parse_option_number() [qemu-option.c] c

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

2012-06-09 Thread Laszlo Ersek
On 06/07/12 17:46, Paolo Bonzini wrote: > Il 07/06/2012 17:29, Michael Roth ha scritto: >> For QEMU <-> X serialization/deserialization, such as a visitor which >> implements a wire encoding (QMP being the only example currently), we need to >> take care that the wire encoding is compatible with th

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

2012-06-07 Thread Paolo Bonzini
Il 07/06/2012 17:29, Michael Roth ha scritto: > For QEMU <-> X serialization/deserialization, such as a visitor which > implements a wire encoding (QMP being the only example currently), we need to > take care that the wire encoding is compatible with the representation > expected by the other end

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

2012-06-07 Thread Michael Roth
On Thu, Jun 07, 2012 at 01:29:54PM +0200, Laszlo Ersek wrote: > On 06/06/12 22:09, Michael Roth wrote: > > On Wed, Jun 06, 2012 at 06:49:19PM +0200, Laszlo Ersek wrote: > > >> The fallback (*v->type_int)() call stores an int64_t, according to its > >> prototype ("interface contract"). IMHO it shou

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

2012-06-07 Thread Andreas Färber
Am 07.06.2012 13:32, schrieb Laszlo Ersek: > On 06/06/12 22:59, Andreas Färber wrote: > >> I've squashed the first three hunks on my qom-next-1 branch and am >> listening what comes out of the discussion for the fourth one. > > I'm OK with dropping the fourth hunk, and thanks for squashing the fi

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

2012-06-07 Thread Laszlo Ersek
On 06/06/12 22:59, Andreas Färber wrote: > I've squashed the first three hunks on my qom-next-1 branch and am > listening what comes out of the discussion for the fourth one. I'm OK with dropping the fourth hunk, and thanks for squashing the first three already, because now I don't have to repost

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

2012-06-07 Thread Laszlo Ersek
On 06/06/12 22:09, Michael Roth wrote: > On Wed, Jun 06, 2012 at 06:49:19PM +0200, Laszlo Ersek wrote: >> The fallback (*v->type_int)() call stores an int64_t, according to its >> prototype ("interface contract"). IMHO it shouldn't try to communicate a >> mathematical value outside of [INT64_MIN,

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

2012-06-06 Thread Andreas Färber
Am 06.06.2012 22:09, schrieb Michael Roth: > On Wed, Jun 06, 2012 at 06:49:19PM +0200, Laszlo Ersek wrote: >> On 06/06/12 18:14, Michael Roth wrote: >>> On Wed, Jun 06, 2012 at 05:30:03PM +0200, Laszlo Ersek wrote: >> value < 0 >>> >>> I think this last one will cause problems though, since

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

2012-06-06 Thread Michael Roth
On Wed, Jun 06, 2012 at 06:49:19PM +0200, Laszlo Ersek wrote: > On 06/06/12 18:14, Michael Roth wrote: > > On Wed, Jun 06, 2012 at 05:30:03PM +0200, Laszlo Ersek wrote: > > >> value < 0 > > > > I think this last one will cause problems though, since uint64_t's > > within the valid range for vis

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

2012-06-06 Thread Laszlo Ersek
On 06/06/12 18:14, Michael Roth wrote: > On Wed, Jun 06, 2012 at 05:30:03PM +0200, Laszlo Ersek wrote: >> value < 0 > > I think this last one will cause problems though, since uint64_t's > within the valid range for visit_type_uint64() will fail due to being > interpreted as < 0 when cast to in

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

2012-06-06 Thread Laszlo Ersek
On 06/06/12 18:49, Laszlo Ersek wrote: > The fallback (*v->type_int)() call stores an int64_t, according to its > prototype ("interface contract"). IMHO it shouldn't try to communicate a > mathematical value outside of [INT64_MIN, INT64_MAX]; it should report > an error in this case. Suppose the

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

2012-06-06 Thread Paolo Bonzini
Il 06/06/2012 18:14, Michael Roth ha scritto: > uint64_t's > within the valid range for visit_type_uint64() will fail due to being > interpreted as < 0 when cast to int64_t. With the others we can detect > these cases since the max unsigned value doesn't exceed the max signed > value of the interme

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

2012-06-06 Thread Michael Roth
On Wed, Jun 06, 2012 at 05:30:03PM +0200, Laszlo Ersek wrote: > On 06/06/12 17:16, Michael Roth wrote: > > On Wed, Jun 06, 2012 at 04:10:44PM +0200, Paolo Bonzini wrote: > > >> The uintXX visitors do not fail if you pass a negative value. I'm fine > >> with including the patch with the small bug

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

2012-06-06 Thread Michael Roth
On Wed, Jun 06, 2012 at 05:30:03PM +0200, Laszlo Ersek wrote: > On 06/06/12 17:16, Michael Roth wrote: > > On Wed, Jun 06, 2012 at 04:10:44PM +0200, Paolo Bonzini wrote: > > >> The uintXX visitors do not fail if you pass a negative value. I'm fine > >> with including the patch with the small bug

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

2012-06-06 Thread Michael Roth
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 and > > >> > include it in the

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

2012-06-06 Thread Laszlo Ersek
On 06/06/12 17:16, Michael Roth wrote: > On Wed, Jun 06, 2012 at 04:10:44PM +0200, Paolo Bonzini wrote: >> 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. > >

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

2012-06-06 Thread Michael Roth
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 and > >> > include it in the series, > >> > (b) make all Netdev integer types as strict as possible,

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

2012-06-06 Thread Paolo Bonzini
Il 06/06/2012 16:34, Andreas Färber ha scritto: >> > 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. > With a view to your qdev patch converting to those vi

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

2012-06-06 Thread Andreas Färber
Am 06.06.2012 16:10, schrieb Paolo Bonzini: > Il 06/06/2012 15:31, Andreas Färber ha scritto: (a) add < 0 checks to and include it in the series, (b) make all Netdev integer types as strict as possible, remove superfluous

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

2012-06-06 Thread Paolo Bonzini
Il 06/06/2012 15:31, Andreas Färber ha scritto: >> > >> > (a) add < 0 checks to and >> > include it in the series, >> > (b) make all Netdev integer types as strict as possible, remove >> > superfluous checks, >> > (c) render NetLegacy::name optio

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

2012-06-06 Thread Paolo Bonzini
Il 06/06/2012 15:03, Laszlo Ersek ha scritto: > OK so this is what I see: > > (a) add < 0 checks to and > include it in the series, > (b) make all Netdev integer types as strict as possible, remove > superfluous checks, > (c) render NetLegacy::na

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

2012-06-06 Thread Andreas Färber
Am 06.06.2012 15:03, schrieb Laszlo Ersek: > On 06/05/12 23:13, Paolo Bonzini wrote: > >> There is one small mistake that needs to be addressed in a v2, so it >> would be great if you could use the int*_t visitors to avoid >> complicating the code with range checks. > > OK so this is what I see:

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

2012-06-06 Thread Laszlo Ersek
On 06/05/12 23:13, Paolo Bonzini wrote: > There is one small mistake that needs to be addressed in a v2, so it > would be great if you could use the int*_t visitors to avoid > complicating the code with range checks. OK so this is what I see: (a) add < 0 checks to

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

2012-06-05 Thread Paolo Bonzini
Il 22/05/2012 12:45, Laszlo Ersek ha scritto: > Inspired by [1], the first half of this series attempts to implement a new > visitor that should clean up defining and processing command line options. > For a more detailed description, please see "[PATCH 04/16] qapi: introduce > OptsVisitor". > > T

[Qemu-devel] [PATCH 00/16] introduce OptsVisitor, rebase -net/-netdev parsing

2012-05-22 Thread Laszlo Ersek
Inspired by [1], the first half of this series attempts to implement a new visitor that should clean up defining and processing command line options. For a more detailed description, please see "[PATCH 04/16] qapi: introduce OptsVisitor". The second half converts -net/-netdev parsing to the new vi