Re: [PATCH v4 4/7] storage: Add support to create a luks volume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 14, 2016 at 16:55:01 -0400, John Ferlan wrote:
> 
> 
> [...]
> 
> >> +
> >> +void
> >> +virQEMUBuildLuksOpts(virBufferPtr buf,
> >> +                     virStorageEncryptionInfoDefPtr enc,
> >> +                     const char *alias)
> >> +{
> >> +    virBufferAsprintf(buf, "key-secret=%s,", alias);
> >> +
> >> +    /* If there's any cipher, then add that to the command line */
> > 
> >> +    if (enc->cipher_name) {
> >> +        virBufferEscapeString(buf, "cipher-alg=%s-", enc->cipher_name);
> >> +        virBufferAsprintf(buf, "%u,", enc->cipher_size);
> >> +        if (enc->cipher_mode)
> >> +            virBufferEscapeString(buf, "cipher-mode=%s,",
> >> enc->cipher_mode);
> >> +        if (enc->cipher_hash)
> >> +            virBufferEscapeString(buf, "hash-alg=%s,",
> >> enc->cipher_hash);
> >> +        if (enc->ivgen_name)
> >> +            virBufferEscapeString(buf, "ivgen-alg=%s,",
> >> enc->ivgen_name);
> >> +        if (enc->ivgen_hash)
> >> +            virBufferEscapeString(buf, "ivgen-hash-alg=%s,",
> >> enc->ivgen_hash);
> > 
> > s/virBufferEscapeString/qemuBufferEscapeComma/
> 
> Not sure I understand what this is referencing.... Besides

I'd guess that it doesn't make much sense to escape < to &lt; and > to
&gt; in code that puts stuff on the command line rather to an XML and
that it makes more sense to escape a comma in the strings with two
commas as is usual for qemu command lines.

> qemuBufferEscapeComma is static to qemu_command

Extracting it to src/util/virbuffer.c could help.

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]