summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-29 16:05:22 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-06-29 16:05:22 +0100
commit5d6b6a3fbbfea19c606b984bac9cf64b6b81cafe (patch)
treeb1d34b141b935fc6acc46930acd0496dfcc0df8b /python
parenta548d51b703f5385797594a37287f4532af289a2 (diff)
downloadlibguestfs-5d6b6a3fbbfea19c606b984bac9cf64b6b81cafe.tar.gz
libguestfs-5d6b6a3fbbfea19c606b984bac9cf64b6b81cafe.tar.xz
libguestfs-5d6b6a3fbbfea19c606b984bac9cf64b6b81cafe.zip
Generated code for mount-loop command.
Diffstat (limited to 'python')
-rw-r--r--python/guestfs-py.c27
-rw-r--r--python/guestfs.py7
2 files changed, 34 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c
index d2682f9c..6a81349b 100644
--- a/python/guestfs-py.c
+++ b/python/guestfs-py.c
@@ -4902,6 +4902,32 @@ py_guestfs_initrd_list (PyObject *self, PyObject *args)
return py_r;
}
+static PyObject *
+py_guestfs_mount_loop (PyObject *self, PyObject *args)
+{
+ PyObject *py_g;
+ guestfs_h *g;
+ PyObject *py_r;
+ int r;
+ const char *file;
+ const char *mountpoint;
+
+ if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_mount_loop",
+ &py_g, &file, &mountpoint))
+ return NULL;
+ g = get_handle (py_g);
+
+ r = guestfs_mount_loop (g, file, mountpoint);
+ 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 PyMethodDef methods[] = {
{ (char *) "create", py_guestfs_create, METH_VARARGS, NULL },
{ (char *) "close", py_guestfs_close, METH_VARARGS, NULL },
@@ -5085,6 +5111,7 @@ static PyMethodDef methods[] = {
{ (char *) "df_h", py_guestfs_df_h, METH_VARARGS, NULL },
{ (char *) "du", py_guestfs_du, METH_VARARGS, NULL },
{ (char *) "initrd_list", py_guestfs_initrd_list, METH_VARARGS, NULL },
+ { (char *) "mount_loop", py_guestfs_mount_loop, METH_VARARGS, NULL },
{ NULL, NULL, 0, NULL }
};
diff --git a/python/guestfs.py b/python/guestfs.py
index 0f6fc3a8..46b02a48 100644
--- a/python/guestfs.py
+++ b/python/guestfs.py
@@ -1856,3 +1856,10 @@ class GuestFS:
"""
return libguestfsmod.initrd_list (self._o, path)
+ def mount_loop (self, file, mountpoint):
+ u"""This command lets you mount "file" (a filesystem image
+ in a file) on a mount point. It is entirely equivalent
+ to the command "mount -o loop file mountpoint".
+ """
+ return libguestfsmod.mount_loop (self._o, file, mountpoint)
+