On Fri, Jun 11, 2021 at 10:09:09AM +0200, Kevin Wolf wrote:
> > Yes, that might work as well.  But we didn't previously document
> > depth to be optional.  Removing something from output risks breaking
> > more downstream tools that expect it to be non-optional, compared to
> > providing a new value.
> 
> A negative value isn't any less unexpected than a missing key. I don't
> think any existing tool would be able to handle it. Encoding different
> meanings in a single value isn't very QAPI-like either. Usually strings
> that are parsed are the problem, but negative integers really isn't that
> much different. I don't really like this solution.
> 
> Leaving out the depth feels like a better suggestion to me.
> 
> But anyway, this seems to only happen at the end of the backing chain.
> So if the backing chain consistents of n images, why not report 'depth':
> n + 1? So, in the above example, you would get 1. I think this has the
> best chances of tools actually working correctly with the new output,
> even though it's still not unlikely to break something.

Ooh, I like that.  It is closer to reality - the file data really
comes from the next depth, even if we have no filename at that depth.
v2 of my patch coming up.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


Reply via email to