X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2Fgenerator.ml;h=f094749b73bee27cb1114db50d2ffb29f6e5675a;hp=eb3269804b6f50e7f5752ba3833cce99684dbfa2;hb=1bd1f9b85f45275b1600d148530bc1877ff15213;hpb=30c091f49dafab4ca9c8b6640d19fc0450b15971 diff --git a/src/generator.ml b/src/generator.ml index eb32698..f094749 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -794,8 +794,9 @@ against a completely different C library. This call was added in version C<1.0.58>. In previous versions of libguestfs there was no way to get the version -number. From C code you can use ELF weak linking tricks to find out if -this symbol exists (if it doesn't, then it's an earlier version). +number. From C code you can use dynamic linker functions +to find out if this symbol exists (if it doesn't, then +it's an earlier version). The call returns a structure with four elements. The first three (C, C and C) are numbers and @@ -4277,6 +4278,8 @@ the libguestfs appliance will be able to provide. The libguestfs groups, and the functions that those groups correspond to, are listed in L. +You can also fetch this list at runtime by calling +C. The argument C is a list of group names, eg: C<[\"inotify\", \"augeas\"]> would check for the availability of @@ -4455,7 +4458,7 @@ This command writes zeroes over the entire C. Compare with C which just zeroes the first few blocks of a device."); - ("txz_in", (RErr, [FileIn "tarball"; Pathname "directory"]), 229, [], + ("txz_in", (RErr, [FileIn "tarball"; Pathname "directory"]), 229, [Optional "xz"], [InitBasicFS, Always, TestOutput ( [["txz_in"; "../images/helloworld.tar.xz"; "/"]; ["cat"; "/hello"]], "hello\n")], @@ -4464,7 +4467,7 @@ a device."); This command uploads and unpacks local file C (an I tar file) into C."); - ("txz_out", (RErr, [Pathname "directory"; FileOut "tarball"]), 230, [], + ("txz_out", (RErr, [Pathname "directory"; FileOut "tarball"]), 230, [Optional "xz"], [], "pack directory into compressed tarball", "\ @@ -4686,6 +4689,39 @@ unlikely for regular files in ordinary circumstances. See also C."); + ("resize2fs_size", (RErr, [Device "device"; Int64 "size"]), 248, [], + [], + "resize an ext2/ext3 filesystem (with size)", + "\ +This command is the same as C except that it +allows you to specify the new size (in bytes) explicitly."); + + ("pvresize_size", (RErr, [Device "device"; Int64 "size"]), 249, [Optional "lvm2"], + [], + "resize an LVM physical volume (with size)", + "\ +This command is the same as C except that it +allows you to specify the new size (in bytes) explicitly."); + + ("ntfsresize_size", (RErr, [Device "device"; Int64 "size"]), 250, [Optional "ntfsprogs"], + [], + "resize an NTFS filesystem (with size)", + "\ +This command is the same as C except that it +allows you to specify the new size (in bytes) explicitly."); + + ("available_all_groups", (RStringList "groups", []), 251, [], + [], + "return a list of all optional groups", + "\ +This command returns a list of all optional groups that this +daemon knows about. Note this returns both supported and unsupported +groups. To find out which ones the daemon can actually support +you have to call C on each member of the +returned list. + +See also C and L."); + ] let all_functions = non_daemon_functions @ daemon_functions @@ -7456,6 +7492,9 @@ and generate_fish_cmds () = pr "#include \"xstrtol.h\"\n"; pr "#include \"fish.h\"\n"; pr "\n"; + pr "/* Valid suffixes allowed for numbers. See Gnulib xstrtol function. */\n"; + pr "static const char *xstrtol_suffixes = \"0kKMGTPEZY\";\n"; + pr "\n"; (* list_commands function, which implements guestfish -h *) pr "void list_commands (void)\n"; @@ -7674,7 +7713,7 @@ and generate_fish_cmds () = pr " strtol_error xerr;\n"; pr " %s r;\n" fntyp; pr "\n"; - pr " xerr = %s (argv[%d], NULL, 0, &r, \"\");\n" fn i; + pr " xerr = %s (argv[%d], NULL, 0, &r, xstrtol_suffixes);\n" fn i; pr " if (xerr != LONGINT_OK) {\n"; pr " fprintf (stderr,\n"; pr " _(\"%%s: %%s: invalid integer parameter (%%s returned %%d)\\n\"),\n"; @@ -9089,6 +9128,12 @@ and generate_python_c () = #define PY_SSIZE_T_CLEAN 1 #include +#if PY_VERSION_HEX < 0x02050000 +typedef int Py_ssize_t; +#define PY_SSIZE_T_MAX INT_MAX +#define PY_SSIZE_T_MIN INT_MIN +#endif + #include #include #include @@ -11011,9 +11056,12 @@ print_strings (char *const *argv) | FileIn n | FileOut n -> pr " printf (\"%%s\\n\", %s);\n" n | BufferIn n -> - pr " for (size_t i = 0; i < %s_size; ++i)\n" n; - pr " printf (\"<%%02x>\", %s[i]);\n" n; - pr " printf (\"\\n\");\n" + pr " {\n"; + pr " size_t i;\n"; + pr " for (i = 0; i < %s_size; ++i)\n" n; + pr " printf (\"<%%02x>\", %s[i]);\n" n; + pr " printf (\"\\n\");\n"; + pr " }\n"; | OptString n -> pr " printf (\"%%s\\n\", %s ? %s : \"null\");\n" n n | StringList n | DeviceList n -> pr " print_strings (%s);\n" n | Bool n -> pr " printf (\"%%s\\n\", %s ? \"true\" : \"false\");\n" n