qemu-img: Omit error_report() after img_open()
img_open() already prints an error if the operation failed, so there should not be another error_report() afterwards. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
		
							parent
							
								
									6e76d125f2
								
							
						
					
					
						commit
						cc4d3ee435
					
				@ -1126,7 +1126,6 @@ static int img_compare(int argc, char **argv)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    blk1 = img_open("image_1", filename1, fmt1, flags, true, quiet);
 | 
					    blk1 = img_open("image_1", filename1, fmt1, flags, true, quiet);
 | 
				
			||||||
    if (!blk1) {
 | 
					    if (!blk1) {
 | 
				
			||||||
        error_report("Can't open file %s", filename1);
 | 
					 | 
				
			||||||
        ret = 2;
 | 
					        ret = 2;
 | 
				
			||||||
        goto out3;
 | 
					        goto out3;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -1134,7 +1133,6 @@ static int img_compare(int argc, char **argv)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    blk2 = img_open("image_2", filename2, fmt2, flags, true, quiet);
 | 
					    blk2 = img_open("image_2", filename2, fmt2, flags, true, quiet);
 | 
				
			||||||
    if (!blk2) {
 | 
					    if (!blk2) {
 | 
				
			||||||
        error_report("Can't open file %s", filename2);
 | 
					 | 
				
			||||||
        ret = 2;
 | 
					        ret = 2;
 | 
				
			||||||
        goto out2;
 | 
					        goto out2;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -1482,7 +1480,6 @@ static int img_convert(int argc, char **argv)
 | 
				
			|||||||
                             true, quiet);
 | 
					                             true, quiet);
 | 
				
			||||||
        g_free(id);
 | 
					        g_free(id);
 | 
				
			||||||
        if (!blk[bs_i]) {
 | 
					        if (!blk[bs_i]) {
 | 
				
			||||||
            error_report("Could not open '%s'", argv[optind + bs_i]);
 | 
					 | 
				
			||||||
            ret = -1;
 | 
					            ret = -1;
 | 
				
			||||||
            goto out;
 | 
					            goto out;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -2962,7 +2959,6 @@ static int img_amend(int argc, char **argv)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    blk = img_open("image", filename, fmt, flags, true, quiet);
 | 
					    blk = img_open("image", filename, fmt, flags, true, quiet);
 | 
				
			||||||
    if (!blk) {
 | 
					    if (!blk) {
 | 
				
			||||||
        error_report("Could not open image '%s'", filename);
 | 
					 | 
				
			||||||
        ret = -1;
 | 
					        ret = -1;
 | 
				
			||||||
        goto out;
 | 
					        goto out;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user