qemu-io: Fix recent UI updates
Commit770e0e0e[*] tried to add 'writev -f', but didn't tweak the getopt() call to actually let it work. Likewise, commitc2e001cmissed implementing 'aio_write -u -z'. The latter commit also introduced a leak of ctx. [*] does it sound "ech0e" in here? :) Signed-off-by: Eric Blake <eblake@redhat.com> Message-id: 1463416983-28318-2-git-send-email-eblake@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
		
							parent
							
								
									3a3086b72a
								
							
						
					
					
						commit
						4ca1d3401b
					
				| 
						 | 
					@ -1107,7 +1107,7 @@ static int writev_f(BlockBackend *blk, int argc, char **argv)
 | 
				
			||||||
    int pattern = 0xcd;
 | 
					    int pattern = 0xcd;
 | 
				
			||||||
    QEMUIOVector qiov;
 | 
					    QEMUIOVector qiov;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    while ((c = getopt(argc, argv, "CqP:")) != -1) {
 | 
					    while ((c = getopt(argc, argv, "CfqP:")) != -1) {
 | 
				
			||||||
        switch (c) {
 | 
					        switch (c) {
 | 
				
			||||||
        case 'C':
 | 
					        case 'C':
 | 
				
			||||||
            Cflag = true;
 | 
					            Cflag = true;
 | 
				
			||||||
| 
						 | 
					@ -1393,7 +1393,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
 | 
				
			||||||
    int flags = 0;
 | 
					    int flags = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ctx->blk = blk;
 | 
					    ctx->blk = blk;
 | 
				
			||||||
    while ((c = getopt(argc, argv, "CfqP:z")) != -1) {
 | 
					    while ((c = getopt(argc, argv, "CfqP:uz")) != -1) {
 | 
				
			||||||
        switch (c) {
 | 
					        switch (c) {
 | 
				
			||||||
        case 'C':
 | 
					        case 'C':
 | 
				
			||||||
            ctx->Cflag = true;
 | 
					            ctx->Cflag = true;
 | 
				
			||||||
| 
						 | 
					@ -1436,6 +1436,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if ((flags & BDRV_REQ_MAY_UNMAP) && !ctx->zflag) {
 | 
					    if ((flags & BDRV_REQ_MAY_UNMAP) && !ctx->zflag) {
 | 
				
			||||||
        printf("-u requires -z to be specified\n");
 | 
					        printf("-u requires -z to be specified\n");
 | 
				
			||||||
 | 
					        g_free(ctx);
 | 
				
			||||||
        return 0;
 | 
					        return 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue