mirror of
				https://gitlab.com/libvirt/libvirt.git
				synced 2025-11-03 08:24:18 +03:00 
			
		
		
		
	esx_vi.c: Simplify error handling in MachineByName
The same pattern is used in lots of other places. Also, reporting error message is not desired because all callers check the return value and report errors on their own. Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
		
				
					committed by
					
						
						Michal Privoznik
					
				
			
			
				
	
			
			
			
						parent
						
							7ac08cc929
						
					
				
				
					commit
					00d9edfe2f
				
			@@ -3014,17 +3014,8 @@ esxVI_LookupVirtualMachineByName(esxVI_Context *ctx, const char *name,
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!(*virtualMachine)) {
 | 
			
		||||
        if (occurrence == esxVI_Occurrence_OptionalItem) {
 | 
			
		||||
            result = 0;
 | 
			
		||||
 | 
			
		||||
            goto cleanup;
 | 
			
		||||
        } else {
 | 
			
		||||
            virReportError(VIR_ERR_NO_DOMAIN,
 | 
			
		||||
                           _("Could not find domain with name '%s'"), name);
 | 
			
		||||
            goto cleanup;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (!(*virtualMachine) && occurrence != esxVI_Occurrence_OptionalItem)
 | 
			
		||||
        goto cleanup;
 | 
			
		||||
 | 
			
		||||
    result = 0;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user