qemu: command: Optimize formatting of 'passwordid' in qemuBuildTLSx509BackendProps

Use the 'S' modifier for create the field optionally rather than calling
another JSON formatter function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2018-05-17 10:09:10 +02:00
parent 9a33776715
commit 8f50120693
1 changed files with 1 additions and 4 deletions

View File

@ -731,13 +731,10 @@ qemuBuildTLSx509BackendProps(const char *tlspath,
"s:dir", path,
"s:endpoint", (isListen ? "server": "client"),
"b:verify-peer", (isListen ? verifypeer : true),
"S:passwordid", secalias,
NULL) < 0)
goto cleanup;
if (secalias &&
virJSONValueObjectAdd(*propsret, "s:passwordid", secalias, NULL) < 0)
goto cleanup;
ret = 0;
cleanup: