[libvirt] [PATCH] qemu: Escape external snapshot names containing comma

Eric Blake eblake at redhat.com
Wed Feb 13 22:41:41 UTC 2019


On 2/13/19 3:58 PM, John Ferlan wrote:
> 
> 
> On 2/12/19 11:33 PM, Eric Blake wrote:
>> The code for creating external snapshots for an offline domain
>> called out to qemu-img without escaping commas in the manner
>> that qemu-img expects. This also fixes a typo in the comment.
>>
>> Signed-off-by: Eric Blake <eblake at redhat.com>
>> ---
>>
>> Noticed by code inspection; I did not try very hard to see how
>> easy or hard it would be to convince libvirt to actually try
>> and create an external snapshot to /path/file,with,comma to
>> see how things break.
>>
>>  src/qemu/qemu_driver.c | 15 ++++++++++-----
>>  1 file changed, 10 insertions(+), 5 deletions(-)
>>
> 
> Oh joy another place that uses qemu-img...
> 
> Looks like qemuDomainSnapshotForEachQcow2Raw uses virDomainDiskGetSource
> or disk def->src->path as well for qemuimgarg[4].

Urgh, so it does. And it uses virRun() instead of the nicer
virCommand... API :( I'll save that for a separate patch,

> 
> Reviewed-by: John Ferlan <jferlan at redhat.com>

and have pushed this one.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190213/fd933609/attachment-0001.sig>


More information about the libvir-list mailing list