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

Re: [libvirt] [PATCH v2 1/4] conf: add rawio attribute to disk element of domain XML



On 01/31/2012 11:53 AM, Laine Stump wrote:
> I also found that "make check wouldn't pass, which was mostly traced to
> the concept of making the default value of rawio "-1". The problem with
> this is that there are other functions that create and fill-in domain
> structures, and they hadn't been taught about this default value. I
> changed the object to have a "bool rawio_specified", and modified the
> parse and format functions accordingly.

We could have also solved this by using a three-state enum with the
default state being 0 rather than -1:

enum {
   VIR_DOMAIN_DISK_RAWIO_DEFAULT = 0,
   VIR_DOMAIN_DISK_RAWIO_NO = 1,
   VIR_DOMAIN_DISK_RAWIO_YES = 2,
}

which we have done for other setups, as that avoids the need for a
separate bool value.  But I'm not too worried about what you did to
bother changing things.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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