APIC support
[qemu] / qemu-img.c
index 5f83622..132428c 100644 (file)
@@ -333,7 +333,6 @@ static int img_create(int argc, char **argv)
             break;
         }
     }
-    optind++;
     if (optind >= argc) 
         help();
     filename = argv[optind++];
@@ -374,7 +373,7 @@ static int img_create(int argc, char **argv)
     ret = bdrv_create(drv, filename, size / 512, base_filename, encrypted);
     if (ret < 0) {
         if (ret == -ENOTSUP) {
-            error("Formatting or formatting option not suppored for file format '%s'", fmt);
+            error("Formatting or formatting option not supported for file format '%s'", fmt);
         } else {
             error("Error while formatting");
         }
@@ -403,7 +402,6 @@ static int img_commit(int argc, char **argv)
             break;
         }
     }
-    optind++;
     if (optind >= argc) 
         help();
     filename = argv[optind++];
@@ -511,7 +509,6 @@ static int img_convert(int argc, char **argv)
             break;
         }
     }
-    optind++;
     if (optind >= argc) 
         help();
     filename = argv[optind++];
@@ -534,7 +531,7 @@ static int img_convert(int argc, char **argv)
     ret = bdrv_create(drv, out_filename, total_sectors, NULL, encrypt);
     if (ret < 0) {
         if (ret == -ENOTSUP) {
-            error("Formatting not suppored for file format '%s'", fmt);
+            error("Formatting not supported for file format '%s'", fmt);
         } else {
             error("Error while formatting '%s'", out_filename);
         }
@@ -639,7 +636,6 @@ static int img_info(int argc, char **argv)
             break;
         }
     }
-    optind++;
     if (optind >= argc) 
         help();
     filename = argv[optind++];
@@ -686,6 +682,7 @@ int main(int argc, char **argv)
     if (argc < 2)
         help();
     cmd = argv[1];
+    optind++;
     if (!strcmp(cmd, "create")) {
         img_create(argc, argv);
     } else if (!strcmp(cmd, "commit")) {