
On 08/27/2013 07:59 PM, Eric Blake wrote:
On 08/27/2013 03:37 AM, Michal Privoznik wrote:
Yes, the codes haven't any implementation for BLOCK_COMMIT_DELETE flag now, maybe, only need to raise a friendly error message in here instead of "unsupported flags (0x2) xxxx". I agree that this error message is not user-friendly. Bare virsh users know nothing about our flags and their numerical expression. However, I don't think there is a way how to produce "Unsupported flag VIR_DOMAIN_BLOCK_COMMIT_DELETE" instead of "Unsupported flag 0x2" since all we see in the qemuDomainBlockCommit() function is just number. I mean, mapping of flag onto numeric value is not one-to-one function (aka injective function). That is, a value 0x2 can express VIR_DOMAIN_BLOCK_COMMIT_DELETE, VIR_DOMAIN_START_AUTODESTROY, VIR_DUMP_DESTROY, etc. (git grep "1<< 1," include/).
If we want to make it work, we have to introduce an injective function, e.g. virUnsupportedFlags(), which would accept a list (not an ORed value) of all flags that are not supported. Too much effort for not much outcome. Agreed - it may not be the nicest of messages, but it is a CORRECT message, and one that will eventually go away when we actually implement things, so it isn't worth the churn of making a temporarily "nicer" message just to rip it back out later when things are properly implemented.
Agree, it isn't worth changing a temporarily "nicer" message now.