Skip to content
Snippets Groups Projects
Commit ff4cd4d2 authored by Iustin Pop's avatar Iustin Pop
Browse files

query: return UNAVAIL for "wrong" HV parameters


If a HV parameter is required that does not apply for an instance,
currently the code returns None. This is bad, as it means we cannot
switch to the actual HV parameter types and validate correctly this
field.

This patch changes it so that in this case we return QRFS_UNAVAIL;
ideally we would use a NOT_APPROPRIATE or similar field, but UNAVAIL is
good enough (the call cannot fail in another way).

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent d1c3c3b3
No related branches found
No related tags found
No related merge requests found
......@@ -1038,7 +1038,7 @@ def _GetInstanceParameterFields():
# HV params
def _GetInstHvParam(name):
return lambda ctx, _: ctx.inst_hvparams.get(name, None)
return lambda ctx, _: ctx.inst_hvparams.get(name, _FS_UNAVAIL)
fields.extend([
# For now all hypervisor parameters are exported as QFT_OTHER
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment