[libvirt] [PATCHv1.5 06/27] qemu: Simplify call pattern of qemuBuildDriveURIString

Peter Krempa pkrempa at redhat.com
Wed Nov 27 16:02:10 UTC 2013


On 11/26/13 19:30, Michal Privoznik wrote:
> On 26.11.2013 17:48, Peter Krempa wrote:
>> Automatically assign secret type from the disk source definition and
>> pull in adding of the comma. Then update callers to keep generated
>> output the same.
>> ---
>>  src/qemu/qemu_command.c | 34 +++++++++++++---------------------
>>  1 file changed, 13 insertions(+), 21 deletions(-)
>>
>> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
>> index 36bdc15..2326221 100644
>> --- a/src/qemu/qemu_command.c
>> +++ b/src/qemu/qemu_command.c

...

>> @@ -3709,20 +3707,22 @@ qemuBuildDriveURIString(virConnectPtr conn,
>>
>>      virBufferAddLit(opt, "file=");
>>
>> -    if (disk->auth.username && secretUsageType != VIR_SECRET_USAGE_TYPE_NONE) {
>> +    if (disk->protocol == VIR_DOMAIN_DISK_PROTOCOL_ISCSI &&
>> +        disk->auth.username) {
>>          /* Get the secret string using the virDomainDiskDef */
>>          if (!(secret = qemuGetSecretString(conn,
>> -                                           virDomainDiskProtocolTypeToString(protocol),
>> +                                           virDomainDiskProtocolTypeToString(disk->protocol),
>>                                             false,
>>                                             disk->auth.secretType,
>>                                             disk->auth.username,
>>                                             disk->auth.secret.uuid,
>>                                             disk->auth.secret.usage,
>> -                                           secretUsageType)))
>> +                                           VIR_SECRET_USAGE_TYPE_ISCSI)))
> 
> I know we were currently using this only for _ISCSI, but when touching
> this how about making it more robust and choosing the correct
> VIR_SECRET_USAGE_TYPE_ here? The @disk is passed anyway so the decision
> can be made here.

Well it is "choosing the correct type" right now technically :). See
patch 10/27 where I move RBD stuff here too that will do exactly what
you are asking here :)

>>
....
> 
> Weak ACK due to comment above.
> 
> Michal
> 

PEter

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


More information about the libvir-list mailing list