X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=python%2Fguestfs-py.c;h=38f78c03a4a2df2dfe61bc990192dc9ed2918723;hb=68b7076d4b61f00c5a2fd9282f0a3c59d429c7df;hp=d647014063aa9a9bdda0524eb006446f968805c0;hpb=43db06ea892cc157324a6b837ca430607441c509;p=libguestfs.git diff --git a/python/guestfs-py.c b/python/guestfs-py.c index d647014..38f78c0 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -2714,6 +2714,192 @@ 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 PyObject * +py_guestfs_debug (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + char *r; + const char *subcmd; + PyObject *py_extraargs; + const char **extraargs; + + if (!PyArg_ParseTuple (args, (char *) "OsO:guestfs_debug", + &py_g, &subcmd, &py_extraargs)) + return NULL; + g = get_handle (py_g); + extraargs = get_string_list (py_extraargs); + if (!extraargs) return NULL; + + r = guestfs_debug (g, subcmd, extraargs); + free (extraargs); + if (r == NULL) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + py_r = PyString_FromString (r); + free (r); + return py_r; +} + +static PyObject * +py_guestfs_lvremove (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *device; + + if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_lvremove", + &py_g, &device)) + return NULL; + g = get_handle (py_g); + + r = guestfs_lvremove (g, device); + 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_vgremove (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *vgname; + + if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_vgremove", + &py_g, &vgname)) + return NULL; + g = get_handle (py_g); + + r = guestfs_vgremove (g, vgname); + 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_pvremove (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *device; + + if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_pvremove", + &py_g, &device)) + return NULL; + g = get_handle (py_g); + + r = guestfs_pvremove (g, device); + 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 +2996,13 @@ 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 }, + { (char *) "debug", py_guestfs_debug, METH_VARARGS, NULL }, + { (char *) "lvremove", py_guestfs_lvremove, METH_VARARGS, NULL }, + { (char *) "vgremove", py_guestfs_vgremove, METH_VARARGS, NULL }, + { (char *) "pvremove", py_guestfs_pvremove, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } };