summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-22 21:02:49 +0100
committerRichard Jones <rjones@redhat.com>2009-04-22 21:02:49 +0100
commit79cdf81e2fb717ea4372a55170d16800cdbddf23 (patch)
tree42b91b69ef02a17c49de10944d249526d63698f6 /python
parentd7ffe439e8ec5304a1a2d1eb591d348c4ab84f38 (diff)
downloadlibguestfs-79cdf81e2fb717ea4372a55170d16800cdbddf23.tar.gz
libguestfs-79cdf81e2fb717ea4372a55170d16800cdbddf23.tar.xz
libguestfs-79cdf81e2fb717ea4372a55170d16800cdbddf23.zip
Generated code for new mount_* commands.
Diffstat (limited to 'python')
-rw-r--r--python/guestfs-py.c84
-rw-r--r--python/guestfs.py20
2 files changed, 104 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c
index d6470140..59f0b6e4 100644
--- a/python/guestfs-py.c
+++ b/python/guestfs-py.c
@@ -2714,6 +2714,87 @@ py_guestfs_tgz_out (PyObject *self, PyObject *args)
return py_r;
}
+static PyObject *
+py_guestfs_mount_ro (PyObject *self, PyObject *args)
+{
+ PyObject *py_g;
+ guestfs_h *g;
+ PyObject *py_r;
+ int r;
+ const char *device;
+ const char *mountpoint;
+
+ if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_mount_ro",
+ &py_g, &device, &mountpoint))
+ return NULL;
+ g = get_handle (py_g);
+
+ r = guestfs_mount_ro (g, device, 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 PyObject *
+py_guestfs_mount_options (PyObject *self, PyObject *args)
+{
+ PyObject *py_g;
+ guestfs_h *g;
+ PyObject *py_r;
+ int r;
+ const char *options;
+ const char *device;
+ const char *mountpoint;
+
+ if (!PyArg_ParseTuple (args, (char *) "Osss:guestfs_mount_options",
+ &py_g, &options, &device, &mountpoint))
+ return NULL;
+ g = get_handle (py_g);
+
+ r = guestfs_mount_options (g, options, device, 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 PyObject *
+py_guestfs_mount_vfs (PyObject *self, PyObject *args)
+{
+ PyObject *py_g;
+ guestfs_h *g;
+ PyObject *py_r;
+ int r;
+ const char *options;
+ const char *vfstype;
+ const char *device;
+ const char *mountpoint;
+
+ if (!PyArg_ParseTuple (args, (char *) "Ossss:guestfs_mount_vfs",
+ &py_g, &options, &vfstype, &device, &mountpoint))
+ return NULL;
+ g = get_handle (py_g);
+
+ r = guestfs_mount_vfs (g, options, vfstype, device, 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 },
@@ -2810,6 +2891,9 @@ static PyMethodDef methods[] = {
{ (char *) "tar_out", py_guestfs_tar_out, METH_VARARGS, NULL },
{ (char *) "tgz_in", py_guestfs_tgz_in, METH_VARARGS, NULL },
{ (char *) "tgz_out", py_guestfs_tgz_out, METH_VARARGS, NULL },
+ { (char *) "mount_ro", py_guestfs_mount_ro, METH_VARARGS, NULL },
+ { (char *) "mount_options", py_guestfs_mount_options, METH_VARARGS, NULL },
+ { (char *) "mount_vfs", py_guestfs_mount_vfs, METH_VARARGS, NULL },
{ NULL, NULL, 0, NULL }
};
diff --git a/python/guestfs.py b/python/guestfs.py
index e5f43d1f..7515aa75 100644
--- a/python/guestfs.py
+++ b/python/guestfs.py
@@ -1055,3 +1055,23 @@ class GuestFS:
"""
return libguestfsmod.tgz_out (self._o, directory, tarball)
+ def mount_ro (self, device, mountpoint):
+ u"""This is the same as the "g.mount" command, but it mounts
+ the filesystem with the read-only (*-o ro*) flag.
+ """
+ return libguestfsmod.mount_ro (self._o, device, mountpoint)
+
+ def mount_options (self, options, device, mountpoint):
+ u"""This is the same as the "g.mount" command, but it allows
+ you to set the mount options as for the mount(8) *-o*
+ flag.
+ """
+ return libguestfsmod.mount_options (self._o, options, device, mountpoint)
+
+ def mount_vfs (self, options, vfstype, device, mountpoint):
+ u"""This is the same as the "g.mount" command, but it allows
+ you to set both the mount options and the vfstype as for
+ the mount(8) *-o* and *-t* flags.
+ """
+ return libguestfsmod.mount_vfs (self._o, options, vfstype, device, mountpoint)
+