X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fgenerator.ml;h=29b0ecd7b74bc61d9900612379031243d63c7b66;hb=851b9a18d24de8fa81d4ca3063df59668484e884;hp=23738bd94c3cfe04285e0fd0b01c16a8dcf442f9;hpb=228e71fe10128c6f91a6935e6b148c49801bb17f;p=libguestfs.git diff --git a/src/generator.ml b/src/generator.ml index 23738bd..29b0ecd 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -33,6 +33,7 @@ *) #load "unix.cma";; +#load "str.cma";; open Printf @@ -1435,6 +1436,49 @@ it to local file C. To download an uncompressed tarball, use C."); + ("mount_ro", (RErr, [String "device"; String "mountpoint"]), 73, [], + [InitBasicFS, TestLastFail ( + [["umount"; "/"]; + ["mount_ro"; "/dev/sda1"; "/"]; + ["touch"; "/new"]]); + InitBasicFS, TestOutput ( + [["write_file"; "/new"; "data"; "0"]; + ["umount"; "/"]; + ["mount_ro"; "/dev/sda1"; "/"]; + ["cat"; "/new"]], "data")], + "mount a guest disk, read-only", + "\ +This is the same as the C command, but it +mounts the filesystem with the read-only (I<-o ro>) flag."); + + ("mount_options", (RErr, [String "options"; String "device"; String "mountpoint"]), 74, [], + [], + "mount a guest disk with mount options", + "\ +This is the same as the C command, but it +allows you to set the mount options as for the +L I<-o> flag."); + + ("mount_vfs", (RErr, [String "options"; String "vfstype"; String "device"; String "mountpoint"]), 75, [], + [], + "mount a guest disk with mount options and vfstype", + "\ +This is the same as the C command, but it +allows you to set both the mount options and the vfstype +as for the L I<-o> and I<-t> flags."); + + ("debug", (RString "result", [String "subcmd"; StringList "extraargs"]), 76, [], + [], + "debugging and internals", + "\ +The C command exposes some internals of +C (the guestfs daemon) that runs inside the +qemu subprocess. + +There is no comprehensive help for this command. You have +to look at the file C in the libguestfs source +to find out what you can do."); + ] let all_functions = non_daemon_functions @ daemon_functions @@ -2516,7 +2560,7 @@ and generate_daemon_actions_h () = and generate_daemon_actions () = generate_header CStyle GPLv2; - pr "#define _GNU_SOURCE // for strchrnul\n"; + pr "#include \n"; pr "\n"; pr "#include \n"; pr "#include \n"; @@ -3778,9 +3822,19 @@ and generate_fish_actions_pod () = fun (_, _, _, flags, _, _, _) -> not (List.mem NotInFish flags) ) all_functions_sorted in + let rex = Str.regexp "C]+\\)>" in + List.iter ( fun (name, style, _, flags, _, _, longdesc) -> - let longdesc = replace_str longdesc "C + let sub = + try Str.matched_group 1 s + with Not_found -> + failwithf "error substituting C in longdesc of function %s" name in + "C<" ^ replace_char sub '_' '-' ^ ">" + ) longdesc in let name = replace_char name '_' '-' in let alias = try find_map (function FishAlias n -> Some n | _ -> None) flags @@ -4106,6 +4160,8 @@ copy_table (char * const * argv) pr "{\n"; (match params with + | [p1; p2; p3; p4; p5] -> + pr " CAMLparam5 (%s);\n" (String.concat ", " params) | p1 :: p2 :: p3 :: p4 :: p5 :: rest -> pr " CAMLparam5 (%s);\n" (String.concat ", " [p1; p2; p3; p4; p5]); pr " CAMLxparam%d (%s);\n" @@ -5736,14 +5792,14 @@ Java_com_redhat_et_libguestfs_GuestFS__1create return 0; } guestfs_set_error_handler (g, NULL, NULL); - return (jlong) g; + return (jlong) (long) g; } JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1close (JNIEnv *env, jobject obj, jlong jg) { - guestfs_h *g = (guestfs_h *) jg; + guestfs_h *g = (guestfs_h *) (long) jg; guestfs_close (g); } @@ -5784,7 +5840,7 @@ Java_com_redhat_et_libguestfs_GuestFS__1close ) (snd style); pr ")\n"; pr "{\n"; - pr " guestfs_h *g = (guestfs_h *) jg;\n"; + pr " guestfs_h *g = (guestfs_h *) (long) jg;\n"; let error_code, no_ret = match fst style with | RErr -> pr " int r;\n"; "-1", ""