From: Richard Jones Date: Fri, 16 Jul 2010 11:57:24 +0000 (+0100) Subject: generator: Don't hard-code name in DeviceList check. X-Git-Tag: 1.2.11~7 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=902a732ffdbe7a21ec767a5e636969351c3ba87b;p=libguestfs.git generator: Don't hard-code name in DeviceList check. Only one function currently uses DeviceList. The generated code unfortunately hard-coded the argument name from that function. Cherry picked from aac51942aab63a9355ad6724345ea923148bf2a9 and rebased for stable branch. --- diff --git a/src/generator.ml b/src/generator.ml index 87b36df..be4542e 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6076,9 +6076,12 @@ and generate_daemon_actions () = | DeviceList n -> pr_list_handling_code n; pr " /* Ensure that each is a device,\n"; - pr " * and perform device name translation. */\n"; - pr " { int pvi; for (pvi = 0; physvols[pvi] != NULL; ++pvi)\n"; - pr " RESOLVE_DEVICE (physvols[pvi], goto done);\n"; + pr " * and perform device name translation.\n"; + pr " */\n"; + pr " {\n"; + pr " int i;\n"; + pr " for (i = 0; %s[i] != NULL; ++i)\n" n; + pr " RESOLVE_DEVICE (%s[i], goto done);\n" n; pr " }\n"; | Bool n -> pr " %s = args.%s;\n" n n | Int n -> pr " %s = args.%s;\n" n n