On 9/16/19 3:44 PM, Laine Stump wrote:
I vote for putting a check in virDomainNetDefValidate() that errors
out if it finds target dev present but empty. There may be some who
would say "it's existing behavior and has been like this for a long
time, so we have to preserve it", but since the schema doesn't allow
it and we've never documented it, I think it's reasonable to disallow
it (except for, as you say, existing domain definitions at reboot
time; NB: there will still be an error if a domain containing this
now-illegal setting is ever edited).
Or maybe we should just check for empty but non-null target dev directly
in the parser and replace it with a NULL right away. That way anybody
whose code is accidentally setting it to '' will get the proper default
behavior instead of a strange error.
(I wonder if there's any other strings that provoke a different behavior
for '' vs null. I think I remember one, but don't recall what it was...)