Re: [PATCH 1/6] virsh: Print cephx and iscsi usage

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

 



On 08/16/2013 09:46 AM, Ján Tomko wrote:
> On 08/08/2013 02:43 AM, John Ferlan wrote:
...
>> diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c
>> index 9d34c1a..30027fe 100644
>> --- a/tools/virsh-secret.c
>> +++ b/tools/virsh-secret.c
...
>> +        int usageType = virSecretGetUsageType(sec);
>> +        const char *usageStr = virSecretUsageTypeTypeToString(usageType);
>>          char uuid[VIR_UUID_STRING_BUFLEN];
>> +
>>          if (virSecretGetUUIDString(list->secrets[i], uuid) < 0) {
>>              vshError(ctl, "%s", _("Failed to get uuid of secret"));
>>              goto cleanup;
>>          }
>>  
>> -        if (usageType) {
>> +        if (usageType > VIR_SECRET_USAGE_TYPE_NONE &&
> 
>> +            usageType < VIR_SECRET_USAGE_TYPE_LAST) {
> 
> This condition seems redundant.
> 

Hmm. right. Don't think the range check is necessary at all since NONE
is zero, then "if (usageType) {" should be sufficient.  I've removed the
extraneous check.

John

--
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]