From: Richard W.M. Jones Date: Tue, 30 Jun 2009 10:17:06 +0000 (+0100) Subject: Generated code for 'set_memsize'/'get_memsize' calls. X-Git-Tag: 1.0.55~41 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=f68b3ac861ae607a333211c775dded82ae2b2c4a;p=libguestfs.git Generated code for 'set_memsize'/'get_memsize' calls. --- diff --git a/capitests/tests.c b/capitests/tests.c index f1a450b..c8686a1 100644 --- a/capitests/tests.c +++ b/capitests/tests.c @@ -109,6 +109,8 @@ static void no_test_warnings (void) fprintf (stderr, "warning: \"guestfs_set_busy\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_set_ready\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_end_busy\" has no tests\n"); + fprintf (stderr, "warning: \"guestfs_set_memsize\" has no tests\n"); + fprintf (stderr, "warning: \"guestfs_get_memsize\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_ll\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_pvs_full\" has no tests\n"); fprintf (stderr, "warning: \"guestfs_vgs_full\" has no tests\n"); diff --git a/fish/cmds.c b/fish/cmds.c index a23fe2d..b2b6513 100644 --- a/fish/cmds.c +++ b/fish/cmds.c @@ -83,6 +83,7 @@ void list_commands (void) printf ("%-20s %s\n", "get-autosync", "get autosync mode"); printf ("%-20s %s\n", "get-e2label", "get the ext2/3/4 filesystem label"); printf ("%-20s %s\n", "get-e2uuid", "get the ext2/3/4 filesystem UUID"); + printf ("%-20s %s\n", "get-memsize", "get memory allocated to the qemu subprocess"); printf ("%-20s %s\n", "get-path", "get the search path"); printf ("%-20s %s\n", "get-qemu", "get the qemu binary"); printf ("%-20s %s\n", "get-state", "get the current state"); @@ -145,6 +146,7 @@ void list_commands (void) printf ("%-20s %s\n", "set-autosync", "set autosync mode"); printf ("%-20s %s\n", "set-e2label", "set the ext2/3/4 filesystem label"); printf ("%-20s %s\n", "set-e2uuid", "set the ext2/3/4 filesystem UUID"); + printf ("%-20s %s\n", "set-memsize", "set memory allocated to the qemu subprocess"); printf ("%-20s %s\n", "set-path", "set the search path"); printf ("%-20s %s\n", "set-qemu", "set the qemu binary"); printf ("%-20s %s\n", "set-verbose", "set verbose mode"); @@ -252,6 +254,12 @@ void display_command (const char *cmd) if (strcasecmp (cmd, "get_state") == 0 || strcasecmp (cmd, "get-state") == 0) pod2text ("get-state - get the current state", " get-state\n\nThis returns the current state as an opaque integer. This is\nonly useful for printing debug and internal error messages.\n\nFor more information on states, see L."); else + if (strcasecmp (cmd, "set_memsize") == 0 || strcasecmp (cmd, "set-memsize") == 0 || strcasecmp (cmd, "memsize") == 0) + pod2text ("set-memsize - set memory allocated to the qemu subprocess", " set-memsize \n\nThis sets the memory size in megabytes allocated to the\nqemu subprocess. This only has any effect if called before\nC.\n\nYou can also change this by setting the environment\nvariable C before the handle is\ncreated.\n\nFor more information on the architecture of libguestfs,\nsee L.\n\nYou can use 'memsize' as an alias for this command."); + else + if (strcasecmp (cmd, "get_memsize") == 0 || strcasecmp (cmd, "get-memsize") == 0) + pod2text ("get-memsize - get memory allocated to the qemu subprocess", " get-memsize\n\nThis gets the memory size in megabytes allocated to the\nqemu subprocess.\n\nIf C was not called\non this handle, and if C was not set,\nthen this returns the compiled-in default value for memsize.\n\nFor more information on the architecture of libguestfs,\nsee L."); + else if (strcasecmp (cmd, "mount") == 0) pod2text ("mount - mount a guest disk at a position in the filesystem", " mount \n\nMount a guest disk at a position in the filesystem. Block devices\nare named C, C and so on, as they were added to\nthe guest. If those block devices contain partitions, they will have\nthe usual names (eg. C). Also LVM C-style\nnames can be used.\n\nThe rules are the same as for L: A filesystem must\nfirst be mounted on C before others can be mounted. Other\nfilesystems can only be mounted on directories which already\nexist.\n\nThe mounted filesystem is writable, if we have sufficient permissions\non the underlying device.\n\nThe filesystem options C and C are set with this\ncall, in order to improve reliability."); else @@ -1077,6 +1085,34 @@ static int run_get_state (const char *cmd, int argc, char *argv[]) return 0; } +static int run_set_memsize (const char *cmd, int argc, char *argv[]) +{ + int r; + int memsize; + if (argc != 1) { + fprintf (stderr, "%s should have 1 parameter(s)\n", cmd); + fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd); + return -1; + } + memsize = atoi (argv[0]); + r = guestfs_set_memsize (g, memsize); + return r; +} + +static int run_get_memsize (const char *cmd, int argc, char *argv[]) +{ + int r; + if (argc != 0) { + fprintf (stderr, "%s should have 0 parameter(s)\n", cmd); + fprintf (stderr, "type 'help %s' for help on %s\n", cmd, cmd); + return -1; + } + r = guestfs_get_memsize (g); + if (r == -1) return -1; + printf ("%d\n", r); + return 0; +} + static int run_mount (const char *cmd, int argc, char *argv[]) { int r; @@ -3246,6 +3282,12 @@ int run_action (const char *cmd, int argc, char *argv[]) if (strcasecmp (cmd, "get_state") == 0 || strcasecmp (cmd, "get-state") == 0) return run_get_state (cmd, argc, argv); else + if (strcasecmp (cmd, "set_memsize") == 0 || strcasecmp (cmd, "set-memsize") == 0 || strcasecmp (cmd, "memsize") == 0) + return run_set_memsize (cmd, argc, argv); + else + if (strcasecmp (cmd, "get_memsize") == 0 || strcasecmp (cmd, "get-memsize") == 0) + return run_get_memsize (cmd, argc, argv); + else if (strcasecmp (cmd, "mount") == 0) return run_mount (cmd, argc, argv); else diff --git a/fish/completion.c b/fish/completion.c index 4a247e1..3cd133b 100644 --- a/fish/completion.c +++ b/fish/completion.c @@ -65,6 +65,9 @@ static const char *const commands[] = { "is-launching", "is-busy", "get-state", + "set-memsize", + "memsize", + "get-memsize", "mount", "sync", "touch", diff --git a/guestfish-actions.pod b/guestfish-actions.pod index 99519fc..986284e 100644 --- a/guestfish-actions.pod +++ b/guestfish-actions.pod @@ -685,6 +685,20 @@ C. This returns the ext2/3/4 filesystem UUID of the filesystem on C. +=head2 get-memsize + + get-memsize + +This gets the memory size in megabytes allocated to the +qemu subprocess. + +If C was not called +on this handle, and if C was not set, +then this returns the compiled-in default value for memsize. + +For more information on the architecture of libguestfs, +see L. + =head2 get-path get-path @@ -1303,6 +1317,21 @@ L manpage. You can use either C or C to return the existing UUID of a filesystem. +=head2 set-memsize | memsize + + set-memsize memsize + +This sets the memory size in megabytes allocated to the +qemu subprocess. This only has any effect if called before +C. + +You can also change this by setting the environment +variable C before the handle is +created. + +For more information on the architecture of libguestfs, +see L. + =head2 set-path | path set-path path diff --git a/guestfs-actions.pod b/guestfs-actions.pod index aade37b..1225dcc 100644 --- a/guestfs-actions.pod +++ b/guestfs-actions.pod @@ -885,6 +885,22 @@ C. This function returns a string, or NULL on error. I. +=head2 guestfs_get_memsize + + int guestfs_get_memsize (guestfs_h *handle); + +This gets the memory size in megabytes allocated to the +qemu subprocess. + +If C was not called +on this handle, and if C was not set, +then this returns the compiled-in default value for memsize. + +For more information on the architecture of libguestfs, +see L. + +On error this function returns -1. + =head2 guestfs_get_path const char *guestfs_get_path (guestfs_h *handle); @@ -1737,6 +1753,24 @@ to return the existing UUID of a filesystem. This function returns 0 on success or -1 on error. +=head2 guestfs_set_memsize + + int guestfs_set_memsize (guestfs_h *handle, + int memsize); + +This sets the memory size in megabytes allocated to the +qemu subprocess. This only has any effect if called before +C. + +You can also change this by setting the environment +variable C before the handle is +created. + +For more information on the architecture of libguestfs, +see L. + +This function returns 0 on success or -1 on error. + =head2 guestfs_set_path int guestfs_set_path (guestfs_h *handle, diff --git a/haskell/Guestfs.hs b/haskell/Guestfs.hs index adf416f..3148450 100644 --- a/haskell/Guestfs.hs +++ b/haskell/Guestfs.hs @@ -45,6 +45,8 @@ module Guestfs ( set_busy, set_ready, end_busy, + set_memsize, + get_memsize, mount, sync, touch, @@ -427,6 +429,30 @@ end_busy h = do fail err else return () +foreign import ccall unsafe "guestfs_set_memsize" c_set_memsize + :: GuestfsP -> CInt -> IO (CInt) + +set_memsize :: GuestfsH -> Int -> IO () +set_memsize h memsize = do + r <- withForeignPtr h (\p -> c_set_memsize p (fromIntegral memsize)) + if (r == -1) + then do + err <- last_error h + fail err + else return () + +foreign import ccall unsafe "guestfs_get_memsize" c_get_memsize + :: GuestfsP -> IO (CInt) + +get_memsize :: GuestfsH -> IO (Int) +get_memsize h = do + r <- withForeignPtr h (\p -> c_get_memsize p) + if (r == -1) + then do + err <- last_error h + fail err + else return (fromIntegral r) + foreign import ccall unsafe "guestfs_mount" c_mount :: GuestfsP -> CString -> CString -> IO (CInt) diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index c5d4364..1e13b3a 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -908,6 +908,57 @@ public HashMap test0rhashtableerr () throws LibGuestFSException; /** + * set memory allocated to the qemu subprocess + *

+ * This sets the memory size in megabytes allocated to the + * qemu subprocess. This only has any effect if called + * before "g.launch". + *

+ * You can also change this by setting the environment + * variable "LIBGUESTFS_MEMSIZE" before the handle is + * created. + *

+ * For more information on the architecture of libguestfs, + * see guestfs(3). + *

+ * @throws LibGuestFSException + */ + public void set_memsize (int memsize) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("set_memsize: handle is closed"); + _set_memsize (g, memsize); + } + private native void _set_memsize (long g, int memsize) + throws LibGuestFSException; + + /** + * get memory allocated to the qemu subprocess + *

+ * This gets the memory size in megabytes allocated to the + * qemu subprocess. + *

+ * If "g.set_memsize" was not called on this handle, and if + * "LIBGUESTFS_MEMSIZE" was not set, then this returns the + * compiled-in default value for memsize. + *

+ * For more information on the architecture of libguestfs, + * see guestfs(3). + *

+ * @throws LibGuestFSException + */ + public int get_memsize () + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("get_memsize: handle is closed"); + return _get_memsize (g); + } + private native int _get_memsize (long g) + throws LibGuestFSException; + + /** * mount a guest disk at a position in the filesystem *

* Mount a guest disk at a position in the filesystem. diff --git a/java/com_redhat_et_libguestfs_GuestFS.c b/java/com_redhat_et_libguestfs_GuestFS.c index 43cad68..df16102 100644 --- a/java/com_redhat_et_libguestfs_GuestFS.c +++ b/java/com_redhat_et_libguestfs_GuestFS.c @@ -1402,6 +1402,37 @@ Java_com_redhat_et_libguestfs_GuestFS__1end_1busy } JNIEXPORT void JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1set_1memsize + (JNIEnv *env, jobject obj, jlong jg, jint jmemsize) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + int memsize; + + memsize = jmemsize; + r = guestfs_set_memsize (g, memsize); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return ; + } +} + +JNIEXPORT jint JNICALL +Java_com_redhat_et_libguestfs_GuestFS__1get_1memsize + (JNIEnv *env, jobject obj, jlong jg) +{ + guestfs_h *g = (guestfs_h *) (long) jg; + int r; + + r = guestfs_get_memsize (g); + if (r == -1) { + throw_exception (env, guestfs_last_error (g)); + return 0; + } + return (jint) r; +} + +JNIEXPORT void JNICALL Java_com_redhat_et_libguestfs_GuestFS__1mount (JNIEnv *env, jobject obj, jlong jg, jstring jdevice, jstring jmountpoint) { diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index c64e257..027f0e9 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -167,6 +167,8 @@ external get_state : t -> int = "ocaml_guestfs_get_state" external set_busy : t -> unit = "ocaml_guestfs_set_busy" external set_ready : t -> unit = "ocaml_guestfs_set_ready" external end_busy : t -> unit = "ocaml_guestfs_end_busy" +external set_memsize : t -> int -> unit = "ocaml_guestfs_set_memsize" +external get_memsize : t -> int = "ocaml_guestfs_get_memsize" external mount : t -> string -> string -> unit = "ocaml_guestfs_mount" external sync : t -> unit = "ocaml_guestfs_sync" external touch : t -> string -> unit = "ocaml_guestfs_touch" diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index dc09056..ef6a142 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -280,6 +280,12 @@ val set_ready : t -> unit val end_busy : t -> unit (** leave the busy state *) +val set_memsize : t -> int -> unit +(** set memory allocated to the qemu subprocess *) + +val get_memsize : t -> int +(** get memory allocated to the qemu subprocess *) + val mount : t -> string -> string -> unit (** mount a guest disk at a position in the filesystem *) diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index 3eedbda..6e937f4 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -1543,6 +1543,51 @@ ocaml_guestfs_end_busy (value gv) } CAMLprim value +ocaml_guestfs_set_memsize (value gv, value memsizev) +{ + CAMLparam2 (gv, memsizev); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("set_memsize: used handle after closing it"); + + int memsize = Int_val (memsizev); + int r; + + caml_enter_blocking_section (); + r = guestfs_set_memsize (g, memsize); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "set_memsize"); + + rv = Val_unit; + CAMLreturn (rv); +} + +CAMLprim value +ocaml_guestfs_get_memsize (value gv) +{ + CAMLparam1 (gv); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("get_memsize: used handle after closing it"); + + int r; + + caml_enter_blocking_section (); + r = guestfs_get_memsize (g); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "get_memsize"); + + rv = Val_int (r); + CAMLreturn (rv); +} + +CAMLprim value ocaml_guestfs_mount (value gv, value devicev, value mountpointv) { CAMLparam3 (gv, devicev, mountpointv); diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index e1da744..9c8b459 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -962,6 +962,30 @@ PREINIT: croak ("end_busy: %s", guestfs_last_error (g)); void +set_memsize (g, memsize) + guestfs_h *g; + int memsize; +PREINIT: + int r; + PPCODE: + r = guestfs_set_memsize (g, memsize); + if (r == -1) + croak ("set_memsize: %s", guestfs_last_error (g)); + +SV * +get_memsize (g) + guestfs_h *g; +PREINIT: + int memsize; + CODE: + memsize = guestfs_get_memsize (g); + if (memsize == -1) + croak ("get_memsize: %s", guestfs_last_error (g)); + RETVAL = newSViv (memsize); + OUTPUT: + RETVAL + +void mount (g, device, mountpoint) guestfs_h *g; char *device; diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index de16bd0..5f8cef4 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -680,6 +680,18 @@ C. This returns the ext2/3/4 filesystem UUID of the filesystem on C. +=item $memsize = $h->get_memsize (); + +This gets the memory size in megabytes allocated to the +qemu subprocess. + +If C<$h-Eset_memsize> was not called +on this handle, and if C was not set, +then this returns the compiled-in default value for memsize. + +For more information on the architecture of libguestfs, +see L. + =item $path = $h->get_path (); Return the current search path. @@ -1181,6 +1193,19 @@ L manpage. You can use either C<$h-Etune2fs_l> or C<$h-Eget_e2uuid> to return the existing UUID of a filesystem. +=item $h->set_memsize ($memsize); + +This sets the memory size in megabytes allocated to the +qemu subprocess. This only has any effect if called before +C<$h-Elaunch>. + +You can also change this by setting the environment +variable C before the handle is +created. + +For more information on the architecture of libguestfs, +see L. + =item $h->set_path ($path); Set the path that libguestfs searches for kernel and initrd.img. diff --git a/python/guestfs-py.c b/python/guestfs-py.c index 340beeb..bf27d0d 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -1657,6 +1657,54 @@ py_guestfs_end_busy (PyObject *self, PyObject *args) } static PyObject * +py_guestfs_set_memsize (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + int memsize; + + if (!PyArg_ParseTuple (args, (char *) "Oi:guestfs_set_memsize", + &py_g, &memsize)) + return NULL; + g = get_handle (py_g); + + r = guestfs_set_memsize (g, memsize); + if (r == -1) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + Py_INCREF (Py_None); + py_r = Py_None; + return py_r; +} + +static PyObject * +py_guestfs_get_memsize (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + + if (!PyArg_ParseTuple (args, (char *) "O:guestfs_get_memsize", + &py_g)) + return NULL; + g = get_handle (py_g); + + r = guestfs_get_memsize (g); + if (r == -1) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + py_r = PyInt_FromLong ((long) r); + return py_r; +} + +static PyObject * py_guestfs_mount (PyObject *self, PyObject *args) { PyObject *py_g; @@ -5060,6 +5108,8 @@ static PyMethodDef methods[] = { { (char *) "set_busy", py_guestfs_set_busy, METH_VARARGS, NULL }, { (char *) "set_ready", py_guestfs_set_ready, METH_VARARGS, NULL }, { (char *) "end_busy", py_guestfs_end_busy, METH_VARARGS, NULL }, + { (char *) "set_memsize", py_guestfs_set_memsize, METH_VARARGS, NULL }, + { (char *) "get_memsize", py_guestfs_get_memsize, METH_VARARGS, NULL }, { (char *) "mount", py_guestfs_mount, METH_VARARGS, NULL }, { (char *) "sync", py_guestfs_sync, METH_VARARGS, NULL }, { (char *) "touch", py_guestfs_touch, METH_VARARGS, NULL }, diff --git a/python/guestfs.py b/python/guestfs.py index aa3572b..d334a91 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -415,6 +415,33 @@ class GuestFS: """ return libguestfsmod.end_busy (self._o) + def set_memsize (self, memsize): + u"""This sets the memory size in megabytes allocated to the + qemu subprocess. This only has any effect if called + before "g.launch". + + You can also change this by setting the environment + variable "LIBGUESTFS_MEMSIZE" before the handle is + created. + + For more information on the architecture of libguestfs, + see guestfs(3). + """ + return libguestfsmod.set_memsize (self._o, memsize) + + def get_memsize (self): + u"""This gets the memory size in megabytes allocated to the + qemu subprocess. + + If "g.set_memsize" was not called on this handle, and if + "LIBGUESTFS_MEMSIZE" was not set, then this returns the + compiled-in default value for memsize. + + For more information on the architecture of libguestfs, + see guestfs(3). + """ + return libguestfsmod.get_memsize (self._o) + def mount (self, device, mountpoint): u"""Mount a guest disk at a position in the filesystem. Block devices are named "/dev/sda", "/dev/sdb" and so diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index 28f9968..9ac8e25 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -1329,6 +1329,41 @@ static VALUE ruby_guestfs_end_busy (VALUE gv) return Qnil; } +static VALUE ruby_guestfs_set_memsize (VALUE gv, VALUE memsizev) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "set_memsize"); + + int memsize = NUM2INT (memsizev); + + int r; + + r = guestfs_set_memsize (g, memsize); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return Qnil; +} + +static VALUE ruby_guestfs_get_memsize (VALUE gv) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "get_memsize"); + + + int r; + + r = guestfs_get_memsize (g); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return INT2NUM (r); +} + static VALUE ruby_guestfs_mount (VALUE gv, VALUE devicev, VALUE mountpointv) { guestfs_h *g; @@ -4828,6 +4863,10 @@ void Init__guestfs () ruby_guestfs_set_ready, 0); rb_define_method (c_guestfs, "end_busy", ruby_guestfs_end_busy, 0); + rb_define_method (c_guestfs, "set_memsize", + ruby_guestfs_set_memsize, 1); + rb_define_method (c_guestfs, "get_memsize", + ruby_guestfs_get_memsize, 0); rb_define_method (c_guestfs, "mount", ruby_guestfs_mount, 2); rb_define_method (c_guestfs, "sync", diff --git a/src/guestfs-actions.h b/src/guestfs-actions.h index c6d2933..80727ae 100644 --- a/src/guestfs-actions.h +++ b/src/guestfs-actions.h @@ -71,6 +71,8 @@ extern int guestfs_get_state (guestfs_h *handle); extern int guestfs_set_busy (guestfs_h *handle); extern int guestfs_set_ready (guestfs_h *handle); extern int guestfs_end_busy (guestfs_h *handle); +extern int guestfs_set_memsize (guestfs_h *handle, int memsize); +extern int guestfs_get_memsize (guestfs_h *handle); extern int guestfs_mount (guestfs_h *handle, const char *device, const char *mountpoint); extern int guestfs_sync (guestfs_h *handle); extern int guestfs_touch (guestfs_h *handle, const char *path);