[virt-tools-list] [PATCH virt-viewer v2] ovirt-foreign-menu: Only set domain_valid once

Eduardo Lima (Etrunko) etrunko at redhat.com
Wed Aug 21 13:40:44 UTC 2019


On 8/19/19 6:51 AM, Victor Toso wrote:
> Hi,
> 
> On Fri, Aug 16, 2019 at 03:25:54PM -0300, Eduardo Lima (Etrunko) wrote:
>> In the case of having a valid storage domain without any ISO files, this
>> variable can be reset to FALSE again in the next iteration of the loop,
>> resulting in a misleading error message presented to the user.
> 
> Sure,
> 
>>
>> Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
>> ---
>>  src/ovirt-foreign-menu.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
>> index 4ec0858..c2f43e6 100644
>> --- a/src/ovirt-foreign-menu.c
>> +++ b/src/ovirt-foreign-menu.c
>> @@ -669,6 +669,7 @@ static gboolean storage_domain_validate(OvirtForeignMenu *menu G_GNUC_UNUSED,
>>      }
>>  #endif
>>  
>> +    g_debug ("Storage domain '%s' is %s", name, ret ? "valid" : "not valid");
>>      g_free(name);
>>      return ret;
>>  }
>> @@ -697,10 +698,12 @@ static void storage_domains_fetched_cb(GObject *source_object,
>>      while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&domain)) {
>>          OvirtCollection *file_collection;
>>  
>> -        domain_valid = storage_domain_validate(menu, domain);
>> -        if (!domain_valid)
>> +        if (!storage_domain_validate(menu, domain))
> 
> just note: reverts yours 1c9a9c12050

Yes, at first my tests were okay, but when I tested on another instance
of oVirt, the results were different. So I had to get back to the first
version of the patch.

> 
>>              continue;
>>  
>> +        if (!domain_valid)
>> +            domain_valid = TRUE;
> 
> I'd remove the if but up to you
> Acked-by: Victor Toso <victortoso at redhat.com>
> 

Thanks, Pushed.

>> +
>>          file_collection = ovirt_storage_domain_get_files(domain);
>>          if (file_collection != NULL) {
>>              if (menu->priv->files) {
>> -- 
>> 2.21.0
>>
>> _______________________________________________
>> virt-tools-list mailing list
>> virt-tools-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/virt-tools-list


-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - Red Hat
etrunko at redhat.com




More information about the virt-tools-list mailing list