Skip to contentSkip to conversation

Fix qemu-img argument handling

PATCH Applied Hervé Poussineau 4 participants 5 messages Feb 7, 2009 – Feb 27, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix qemu-img argument handling

Hi,

qemu-img doesn't work on MS Windows, when compiled with MinGW Runtime package >= 3.15
According to http://sourceforge.net/tracker/index.php?func=detail&aid=2222263&group_id=2435&atid=102435 , qemu-img shouldn't skip the first argument (command name) by doing optind++.

Attached patch fixes the problems, and repairs qemu-img parsing with MinGW Runtime package >= 3.15

Hervé

qemu-img.c +2 -1
Index: qemu-img.c
===================================================================
@@ -865,7 +865,8 @@
     if (argc < 2)
         help();
     cmd = argv[1];
-    optind++;
+    argc--;
+    argv++;
     if (!strcmp(cmd, "create")) {
         img_create(argc, argv);
     } else if (!strcmp(cmd, "commit")) {
#1 lore raw
Quoted 4 lines · Hervé Poussineau

According to
http://sourceforge.net/tracker/index.php?func=detail&aid=2222263&group_id=2435&atid=102435
, qemu-img shouldn't skip the first argument (command name) by doing optind++.

Oh, that was me in November. ;-)

Quoted 2 lines

Attached patch fixes the problems, and repairs qemu-img parsing with MinGW Runtime package >= 3.15

Thanks for this patch! :-)

Robert Riebisch

Signature · 2 lines
BTTR Software
http://www.bttr-software.de/
#2 lore raw
In reply to Hervé Poussineau
Quoted 9 lines · Hervé Poussineau

Hi,

qemu-img doesn't work on MS Windows, when compiled with MinGW Runtime package >= 3.15
According to
http://sourceforge.net/tracker/index.php?func=detail&aid=2222263&group_id=2435&atid=102435
, qemu-img shouldn't skip the first argument (command name) by doing optind++.

Quoted 4 lines

Attached patch fixes the problems, and repairs qemu-img parsing with MinGW Runtime package >= 3.15

Thanks, applied.

Signature · 2 lines
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net
#4 lore raw
In reply to Hervé Poussineau
Quoted 8 lines · Hervé Poussineau

Hi,

qemu-img doesn't work on MS Windows, when compiled with MinGW Runtime package >= 3.15
According to http://sourceforge.net/tracker/index.php?func=detail&aid=2222263&group_id=2435&atid=102435 , qemu-img shouldn't skip the first argument (command name) by doing optind++.

Attached patch fixes the problems, and repairs qemu-img parsing with MinGW Runtime package >= 3.15

This resend either inlining the patch or attaching it with text/plan.

Regards,

Anthony Liguori

Quoted 1 line

Hervé