mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu: Escape commas for qemuBuildDriveDevStr
Add comma escaping for disk->vendor and disk->product when being built for the command line (and not from hotplug). Signed-off-by: Sukrit Bhatnagar <skrtbhtngr@gmail.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
a55cd7193a
commit
2234777dd0
@ -2114,11 +2114,15 @@ qemuBuildDriveDevStr(const virDomainDef *def,
|
||||
virBufferAsprintf(&opt, ",wwn=0x%s", disk->wwn);
|
||||
}
|
||||
|
||||
if (disk->vendor)
|
||||
virBufferAsprintf(&opt, ",vendor=%s", disk->vendor);
|
||||
if (disk->vendor) {
|
||||
virBufferAddLit(&opt, ",vendor=");
|
||||
virQEMUBuildBufferEscapeComma(&opt, disk->vendor);
|
||||
}
|
||||
|
||||
if (disk->product)
|
||||
virBufferAsprintf(&opt, ",product=%s", disk->product);
|
||||
if (disk->product) {
|
||||
virBufferAddLit(&opt, ",product=");
|
||||
virQEMUBuildBufferEscapeComma(&opt, disk->product);
|
||||
}
|
||||
|
||||
if (disk->bus == VIR_DOMAIN_DISK_BUS_USB) {
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_USB_STORAGE_REMOVABLE)) {
|
||||
|
Loading…
Reference in New Issue
Block a user