X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2Fgenerator.ml;h=96b5b7012dcf90c4a27928a4ca5c4de1c62ddc2a;hp=7db58eb0ba06770227ce1de3ddbdc4cf772fcd62;hb=699f38f05f2545a2c188370500df17cc52cbdf98;hpb=48a9ff73319d0d065bff2b9374c84bcf6438cb20 diff --git a/src/generator.ml b/src/generator.ml index 7db58eb..96b5b70 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -489,9 +489,15 @@ image). This is equivalent to the qemu parameter C<-drive file=filename,cache=off,if=...>. + C is omitted in cases where it is not supported by the underlying filesystem. +C is set at compile time by the configuration option +C<./configure --with-drive-if=...>. In the rare case where you +might need to change this at run time, use C +or C. + Note that this call checks for the existence of C. This stops you from specifying other types of drive which are supported by qemu such as C and C URLs. To specify those, use @@ -540,6 +546,11 @@ changes to be committed, although qemu can support this. This is equivalent to the qemu parameter C<-drive file=filename,snapshot=on,if=...>. +C is set at compile time by the configuration option +C<./configure --with-drive-if=...>. In the rare case where you +might need to change this at run time, use C +or C. + Note that this call checks for the existence of C. This stops you from specifying other types of drive which are supported by qemu such as C and C URLs. To specify those, use @@ -887,6 +898,20 @@ qemu, which is not very helpful."); "\ Return the recovery process enabled flag."); + ("add_drive_with_if", (RErr, [String "filename"; String "iface"]), -1, [], + [], + "add a drive specifying the QEMU block emulation to use", + "\ +This is the same as C but it allows you +to specify the QEMU interface emulation to use at run time."); + + ("add_drive_ro_with_if", (RErr, [String "filename"; String "iface"]), -1, [], + [], + "add a drive read-only specifying the QEMU block emulation to use", + "\ +This is the same as C but it allows you +to specify the QEMU interface emulation to use at run time."); + ] (* daemon_functions are any functions which cause some action @@ -4238,7 +4263,7 @@ Rename a logical volume C with the new name C."); "\ Rename a volume group C with the new name C."); - ("initrd_cat", (RBufferOut "content", [Pathname "initrdpath"; String "filename"]), 221, [], + ("initrd_cat", (RBufferOut "content", [Pathname "initrdpath"; String "filename"]), 221, [ProtocolLimitWarning], [InitISOFS, Always, TestOutputBuffer ( [["initrd_cat"; "/initrd"; "known-4"]], "abc\ndef\nghi")], "list the contents of a single file in an initrd", @@ -4679,8 +4704,7 @@ let seq_of_test = function (* Handling for function flags. *) let protocol_limit_warning = "Because of the message protocol, there is a transfer limit -of somewhere between 2MB and 4MB. To transfer large files you should use -FTP." +of somewhere between 2MB and 4MB. See L." let danger_will_robinson = "B pr "PREINIT:\n"; @@ -8135,7 +8158,7 @@ DESTROY (g) pr ";\n"; do_cleanups (); pr " if (%s == -1)\n" n; - pr " croak (\"%s: %%s\", guestfs_last_error (g));\n" name; + pr " croak (\"%%s\", guestfs_last_error (g));\n"; pr " RETVAL = newSViv (%s);\n" n; pr " OUTPUT:\n"; pr " RETVAL\n" @@ -8148,7 +8171,7 @@ DESTROY (g) pr ";\n"; do_cleanups (); pr " if (%s == -1)\n" n; - pr " croak (\"%s: %%s\", guestfs_last_error (g));\n" name; + pr " croak (\"%%s\", guestfs_last_error (g));\n"; pr " RETVAL = my_newSVll (%s);\n" n; pr " OUTPUT:\n"; pr " RETVAL\n" @@ -8161,7 +8184,7 @@ DESTROY (g) pr ";\n"; do_cleanups (); pr " if (%s == NULL)\n" n; - pr " croak (\"%s: %%s\", guestfs_last_error (g));\n" name; + pr " croak (\"%%s\", guestfs_last_error (g));\n"; pr " RETVAL = newSVpv (%s, 0);\n" n; pr " OUTPUT:\n"; pr " RETVAL\n" @@ -8188,7 +8211,7 @@ DESTROY (g) pr ";\n"; do_cleanups (); pr " if (%s == NULL)\n" n; - pr " croak (\"%s: %%s\", guestfs_last_error (g));\n" name; + pr " croak (\"%%s\", guestfs_last_error (g));\n"; pr " RETVAL = newSVpv (%s, 0);\n" n; pr " free (%s);\n" n; pr " OUTPUT:\n"; @@ -8203,7 +8226,7 @@ DESTROY (g) pr ";\n"; do_cleanups (); pr " if (%s == NULL)\n" n; - pr " croak (\"%s: %%s\", guestfs_last_error (g));\n" name; + pr " croak (\"%%s\", guestfs_last_error (g));\n"; pr " for (n = 0; %s[n] != NULL; ++n) /**/;\n" n; pr " EXTEND (SP, n);\n"; pr " for (i = 0; i < n; ++i) {\n"; @@ -8227,7 +8250,7 @@ DESTROY (g) pr ";\n"; do_cleanups (); pr " if (%s == NULL)\n" n; - pr " croak (\"%s: %%s\", guestfs_last_error (g));\n" name; + pr " croak (\"%%s\", guestfs_last_error (g));\n"; pr " RETVAL = newSVpv (%s, size);\n" n; pr " free (%s);\n" n; pr " OUTPUT:\n"; @@ -8248,7 +8271,7 @@ and generate_perl_struct_list_code typ cols name style n do_cleanups = pr ";\n"; do_cleanups (); pr " if (%s == NULL)\n" n; - pr " croak (\"%s: %%s\", guestfs_last_error (g));\n" name; + pr " croak (\"%%s\", guestfs_last_error (g));\n"; pr " EXTEND (SP, %s->len);\n" n; pr " for (i = 0; i < %s->len; ++i) {\n" n; pr " hv = newHV ();\n"; @@ -8292,7 +8315,7 @@ and generate_perl_struct_code typ cols name style n do_cleanups = pr ";\n"; do_cleanups (); pr " if (%s == NULL)\n" n; - pr " croak (\"%s: %%s\", guestfs_last_error (g));\n" name; + pr " croak (\"%%s\", guestfs_last_error (g));\n"; pr " EXTEND (SP, 2 * %d);\n" (List.length cols); List.iter ( fun ((name, _) as col) -> @@ -8368,7 +8391,8 @@ schemes, qcow, qcow2, vmdk. Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, what filesystem is in each LV, etc.). It can also run commands -in the context of the guest. Also you can access filesystems over FTP. +in the context of the guest. Also you can access filesystems over +FUSE. See also L for a set of useful library functions for using libguestfs from Perl, including integration @@ -8905,7 +8929,8 @@ schemes, qcow, qcow2, vmdk. Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, what filesystem is in each LV, etc.). It can also run commands -in the context of the guest. Also you can access filesystems over FTP. +in the context of the guest. Also you can access filesystems over +FUSE. Errors which happen while using the API are turned into Python RuntimeError exceptions. @@ -10302,8 +10327,7 @@ namespace Guestfs pr " r = "; generate_call (); pr " if (r %s)\n" (c_error_comparison ()); - pr " throw new Error (\"%s: \" + guestfs_last_error (_handle));\n" - name; + pr " throw new Error (guestfs_last_error (_handle));\n"; (match fst style with | RErr -> () | RBool _ ->