]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: command: Optimize formatting of 'passwordid' in qemuBuildTLSx509BackendProps
authorPeter Krempa <pkrempa@redhat.com>
Thu, 17 May 2018 08:09:10 +0000 (10:09 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 18 May 2018 06:59:45 +0000 (08:59 +0200)
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>
src/qemu/qemu_command.c

index c4237339bfd0a0e0907238f59e1c62372fd7033a..173745ee49e966ffcb410d89b30b578799772dad 100644 (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: