qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qapi: Fix crash with enum dealloc when kind is


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH] qapi: Fix crash with enum dealloc when kind is invalid
Date: Thu, 11 Sep 2014 08:53:28 +0800
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, 09/10 17:32, Paolo Bonzini wrote:
> Il 10/09/2014 17:02, Fam Zheng ha scritto:
> > > A bit hackish, but I don't have any better idea.
> > > 
> > > Hmm... what about adding a new member to the visitors for "invalid enum"
> > > value?  The dealloc visitor could override it to do nothing, while the
> > > default could abort or set an error.  Would that work?
> > 
> > The invalid state of enum still needs to be saved in the data.  It is 
> > detected
> > by the input visitor, but should be checked by other visitors (output, 
> > dealloc)
> > later.
> 
> Yes, that's fine.  The only part where I'm not sure is the special
> casing of the _MAX enum.
> 

Yes, it is abusing. Let's add an _INVALID = 0 enum which is much clearer.

Fam



reply via email to

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