mirror of
				https://passt.top/passt
				synced 2025-10-26 00:59:13 +02:00 
			
		
		
		
	migrate, flow: Trivially succeed if migrating with no flows
We could get a migration request when we have no active flows; or at least
none that we need or are able to migrate.  In this case after sending or
receiving the number of flows we continue to step through various lists.
In the target case, this could include communication with passt-repair.  If
passt-repair wasn't started that could cause further errors, but of course
they shouldn't matter if we have nothing to repair.
Make it more obvious that there's nothing to do and avoid such errors by
short-circuiting flow_migrate_{source,target}() if there are no migratable
flows.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
	
	
This commit is contained in:
		
					parent
					
						
							
								e5575743d9
							
						
					
				
			
			
				commit
				
					
						2aa1b789b4
					
				
			
		
					 1 changed files with 6 additions and 0 deletions
				
			
		
							
								
								
									
										6
									
								
								flow.c
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								flow.c
									
										
									
									
									
								
							|  | @ -1019,6 +1019,9 @@ int flow_migrate_source(struct ctx *c, const struct migrate_stage *stage, | |||
| 
 | ||||
| 	debug("Sending %u flows", ntohl(count)); | ||||
| 
 | ||||
| 	if (!count) | ||||
| 		return 0; | ||||
| 
 | ||||
| 	/* Dump and send information that can be stored in the flow table.
 | ||||
| 	 * | ||||
| 	 * Limited rollback options here: if we fail to transfer any data (that | ||||
|  | @ -1088,6 +1091,9 @@ int flow_migrate_target(struct ctx *c, const struct migrate_stage *stage, | |||
| 	count = ntohl(count); | ||||
| 	debug("Receiving %u flows", count); | ||||
| 
 | ||||
| 	if (!count) | ||||
| 		return 0; | ||||
| 
 | ||||
| 	if ((rc = flow_migrate_repair_all(c, true))) | ||||
| 		return -rc; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 David Gibson
				David Gibson