diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 20:24:47 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-29 20:25:20 +0100 |
commit | da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6 (patch) | |
tree | 5555f9addd140af8cf2b40c9526d1b1837abdd7f /python/guestfs-py.c | |
parent | 662617ae725c5e41c24128a037060419fbe4b026 (diff) | |
download | libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.tar.gz libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.tar.xz libguestfs-da8ddb2745c3d53c36e3ad7f09836a4c27a4d3e6.zip |
Generated code for the 'mkswap*' commands.
Diffstat (limited to 'python/guestfs-py.c')
-rw-r--r-- | python/guestfs-py.c | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c index 6a81349b..340beebe 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -4928,6 +4928,83 @@ py_guestfs_mount_loop (PyObject *self, PyObject *args) return py_r; } +static PyObject * +py_guestfs_mkswap (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_mkswap", + &py_g, &device)) + return NULL; + g = get_handle (py_g); + + r = guestfs_mkswap (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_mkswap_L (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *label; + const char *device; + + if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_mkswap_L", + &py_g, &label, &device)) + return NULL; + g = get_handle (py_g); + + r = guestfs_mkswap_L (g, label, 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_mkswap_U (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *uuid; + const char *device; + + if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_mkswap_U", + &py_g, &uuid, &device)) + return NULL; + g = get_handle (py_g); + + r = guestfs_mkswap_U (g, uuid, 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 }, @@ -5112,6 +5189,9 @@ static PyMethodDef methods[] = { { (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 }, + { (char *) "mkswap", py_guestfs_mkswap, METH_VARARGS, NULL }, + { (char *) "mkswap_L", py_guestfs_mkswap_L, METH_VARARGS, NULL }, + { (char *) "mkswap_U", py_guestfs_mkswap_U, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; |