diff options
author | Anthony Liguori | 2011-02-16 15:47:13 +0100 |
---|---|---|
committer | Anthony Liguori | 2011-02-16 15:47:13 +0100 |
commit | 79f2b6fcdb7c06cdce6eccc796f5651f3efb843e (patch) | |
tree | fcb22804f1845c77206bbfe6ff2f3470deea014f /qemu-img.c | |
parent | Merge remote branch 'qemu-kvm/uq/master' into staging (diff) | |
parent | qcow2: Fix order in L2 table COW (diff) | |
download | qemu-79f2b6fcdb7c06cdce6eccc796f5651f3efb843e.tar.gz qemu-79f2b6fcdb7c06cdce6eccc796f5651f3efb843e.tar.xz qemu-79f2b6fcdb7c06cdce6eccc796f5651f3efb843e.zip |
Merge remote branch 'kwolf/for-anthony' into staging
Diffstat (limited to 'qemu-img.c')
-rw-r--r-- | qemu-img.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/qemu-img.c b/qemu-img.c index 4a3735811c..7e3cc4cbd5 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -213,8 +213,9 @@ static BlockDriverState *bdrv_new_open(const char *filename, BlockDriverState *bs; BlockDriver *drv; char password[256]; + int ret; - bs = bdrv_new(""); + bs = bdrv_new("image"); if (fmt) { drv = bdrv_find_format(fmt); @@ -225,10 +226,13 @@ static BlockDriverState *bdrv_new_open(const char *filename, } else { drv = NULL; } - if (bdrv_open(bs, filename, flags, drv) < 0) { - error_report("Could not open '%s'", filename); + + ret = bdrv_open(bs, filename, flags, drv); + if (ret < 0) { + error_report("Could not open '%s': %s", filename, strerror(-ret)); goto fail; } + if (bdrv_is_encrypted(bs)) { printf("Disk image '%s' is encrypted.\n", filename); if (read_password(password, sizeof(password)) < 0) { |