On 05/15/2014 07:10 AM, Jeff Cody wrote: >> >> We are moving towards having qapi guarantee sane defaults for FOO when >> has_FOO is false; but aren't there yet. You are correct that this needs >> to guarantee that we aren't passing random memory. >> > > The QAPI code generator for the QMP input marshaller initializes all > pointers to NULL, and all bools to false. If has_ is false, then the > associated pointer will also be NULL, so it is safe to just pass > backing_file.
It didn't used to, and we still haven't documented that as being a reliable guarantee, nor does the testsuite cover that. It's still safer to not rely on that fact until we make it part of the contract of qapi. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
