add-cow file can't live alone, must together will image_file and backing_file.
If we implement qemu-img convert operation for add-cow file format, we must
create image_file and backing_file manually, that will be confused for users,
so we just ignore add-cow format while doing converting.

Signed-off-by: Dong Xu Wang <wdon...@linux.vnet.ibm.com>
---
 qemu-img.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index c8a70ff..0bce61c 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -756,6 +756,12 @@ static int img_convert(int argc, char **argv)
         }
     }
 
+    if (strcmp(out_fmt, "add-cow") == 0) {
+        error_report("Convert operation does not support %s format.", out_fmt);
+        ret = -1;
+        goto out;
+    }
+
     /* Find driver and parse its options */
     drv = bdrv_find_format(out_fmt);
     if (!drv) {
-- 
1.7.1


Reply via email to