qemu-img: add dirty flag status
Some block drivers can verify their image files are clean or not. So we can show it while using "qemu-img info". Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
		
							parent
							
								
									11c9c615c8
								
							
						
					
					
						commit
						64c79160b4
					
				
							
								
								
									
										1
									
								
								block.h
								
								
								
								
							
							
						
						
									
										1
									
								
								block.h
								
								
								
								
							| 
						 | 
					@ -15,6 +15,7 @@ typedef struct BlockDriverInfo {
 | 
				
			||||||
    int cluster_size;
 | 
					    int cluster_size;
 | 
				
			||||||
    /* offset at which the VM state can be saved (0 if not possible) */
 | 
					    /* offset at which the VM state can be saved (0 if not possible) */
 | 
				
			||||||
    int64_t vm_state_offset;
 | 
					    int64_t vm_state_offset;
 | 
				
			||||||
 | 
					    bool is_dirty;
 | 
				
			||||||
} BlockDriverInfo;
 | 
					} BlockDriverInfo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef struct BlockFragInfo {
 | 
					typedef struct BlockFragInfo {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1132,6 +1132,9 @@ static int img_info(int argc, char **argv)
 | 
				
			||||||
        if (bdi.cluster_size != 0) {
 | 
					        if (bdi.cluster_size != 0) {
 | 
				
			||||||
            printf("cluster_size: %d\n", bdi.cluster_size);
 | 
					            printf("cluster_size: %d\n", bdi.cluster_size);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        if (bdi.is_dirty) {
 | 
				
			||||||
 | 
					            printf("cleanly shut down: no\n");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    bdrv_get_backing_filename(bs, backing_filename, sizeof(backing_filename));
 | 
					    bdrv_get_backing_filename(bs, backing_filename, sizeof(backing_filename));
 | 
				
			||||||
    if (backing_filename[0] != '\0') {
 | 
					    if (backing_filename[0] != '\0') {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue