Add comma escaping for fs->src->path and fs->dst.
Signed-off-by: Sukrit Bhatnagar <skrtbhtngr(a)gmail.com>
---
src/qemu/qemu_command.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b75e441..e903491 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2396,7 +2396,8 @@ qemuBuildFSStr(virDomainFSDefPtr fs,
}
virBufferAsprintf(&opt, ",id=%s%s", QEMU_FSDEV_HOST_PREFIX,
fs->info.alias);
- virBufferAsprintf(&opt, ",path=%s", fs->src->path);
+ virBufferAddLit(&opt, ",path=");
+ virQEMUBuildBufferEscapeComma(&opt, fs->src->path);
if (fs->readonly) {
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_FSDEV_READONLY)) {
@@ -2441,7 +2442,8 @@ qemuBuildFSDevStr(const virDomainDef *def,
virBufferAsprintf(&opt, ",id=%s", fs->info.alias);
virBufferAsprintf(&opt, ",fsdev=%s%s",
QEMU_FSDEV_HOST_PREFIX, fs->info.alias);
- virBufferAsprintf(&opt, ",mount_tag=%s", fs->dst);
+ virBufferAddLit(&opt, ",mount_tag=");
+ virQEMUBuildBufferEscapeComma(&opt, fs->dst);
if (qemuBuildVirtioOptionsStr(&opt, fs->virtio, qemuCaps) < 0)
goto error;
--
1.8.3.1