소스 검색

qemu-img: allow rebase to a NULL backing file when unsafe

QEMU can drop a backing file so that an image file no longer depends on
the backing file, but this feature has not been exposed in qemu-img.
This is useful in an image streaming usecase or when an image file has
been fully allocated and no reads can hit the backing file anymore.

Since the dropping the backing file can make the image unusable, only
allow this when the unsafe flag has been set.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Anthony Liguori 14 년 전
부모
커밋
9a9d9dba3e
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      qemu-img.c

+ 1 - 1
qemu-img.c

@@ -1240,7 +1240,7 @@ static int img_rebase(int argc, char **argv)
         }
         }
     }
     }
 
 
-    if ((optind >= argc) || !out_baseimg) {
+    if ((optind >= argc) || (!unsafe && !out_baseimg)) {
         help();
         help();
     }
     }
     filename = argv[optind++];
     filename = argv[optind++];