commit: Fix use of error handling policy
Commit implemented the 'enospc' policy as 'ignore' if the error was not ENOSPC. The QAPI documentation promises that it's treated as 'stop'. Using the common block job error handling function fixes this and also adds the missing QMP event. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
		
							parent
							
								
									f6166a06ff
								
							
						
					
					
						commit
						1e8fb7f1ee
					
				| 
						 | 
					@ -171,9 +171,9 @@ wait:
 | 
				
			||||||
            bytes_written += n * BDRV_SECTOR_SIZE;
 | 
					            bytes_written += n * BDRV_SECTOR_SIZE;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (ret < 0) {
 | 
					        if (ret < 0) {
 | 
				
			||||||
            if (s->on_error == BLOCKDEV_ON_ERROR_STOP ||
 | 
					            BlockErrorAction action =
 | 
				
			||||||
                s->on_error == BLOCKDEV_ON_ERROR_REPORT||
 | 
					                block_job_error_action(&s->common, false, s->on_error, -ret);
 | 
				
			||||||
                (s->on_error == BLOCKDEV_ON_ERROR_ENOSPC && ret == -ENOSPC)) {
 | 
					            if (action == BLOCK_ERROR_ACTION_REPORT) {
 | 
				
			||||||
                goto out;
 | 
					                goto out;
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                n = 0;
 | 
					                n = 0;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue