diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 173745ee49e966ffcb410d89b30b578799772dad..19c7149b5b609ed5a440590c58e72074eca5f2f8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -712,35 +712,21 @@ qemuBuildTLSx509BackendProps(const char *tlspath, virQEMUCapsPtr qemuCaps, virJSONValuePtr *propsret) { - virBuffer buf = VIR_BUFFER_INITIALIZER; - char *path = NULL; - int ret = -1; - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_TLS_CREDS_X509)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("tls-creds-x509 not supported in this QEMU binary")); return -1; } - virQEMUBuildBufferEscapeComma(&buf, tlspath); - if (virBufferCheckError(&buf) < 0) - goto cleanup; - path = virBufferContentAndReset(&buf); - if (virJSONValueObjectCreate(propsret, - "s:dir", path, + "s:dir", tlspath, "s:endpoint", (isListen ? "server": "client"), "b:verify-peer", (isListen ? verifypeer : true), "S:passwordid", secalias, NULL) < 0) - goto cleanup; - - ret = 0; + return -1; - cleanup: - virBufferFreeAndReset(&buf); - VIR_FREE(path); - return ret; + return 0; } diff --git a/tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args b/tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args index a2b4d2bcbd142063ca340fd47ec15ec30161d17a..91d3a8a70a77d6eea07d3200f53d87ea19d53eb8 100644 --- a/tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args +++ b/tests/qemuxml2argvdata/disk-drive-network-tlsx509-vxhs.args @@ -24,7 +24,7 @@ server,nowait \ -boot c \ -usb \ -object tls-creds-x509,id=objvirtio-disk0_tls0,dir=/etc/pki/libvirt-vxhs/dummy,\ -,,,path,endpoint=client,verify-peer=yes \ +,path,endpoint=client,verify-peer=yes \ -drive file.driver=vxhs,file.tls-creds=objvirtio-disk0_tls0,\ file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc251,\ file.server.host=192.168.0.1,file.server.port=9999,format=raw,if=none,\ @@ -32,7 +32,7 @@ id=drive-virtio-disk0,serial=eb90327c-8302-4725-9e1b-4e85ed4dc251,cache=none \ -device virtio-blk-pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,\ id=virtio-disk0 \ -object tls-creds-x509,id=objvirtio-disk1_tls0,dir=/etc/pki/libvirt-vxhs/dummy,\ -,,,path,endpoint=client,verify-peer=yes \ +,path,endpoint=client,verify-peer=yes \ -drive file.driver=vxhs,file.tls-creds=objvirtio-disk1_tls0,\ file.vdisk-id=eb90327c-8302-4725-9e1b-4e85ed4dc252,\ file.server.host=192.168.0.2,file.server.port=9999,format=raw,if=none,\