diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:00:46 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-05-01 11:00:46 +0100 |
commit | ac286b26df1aabceca26dac66c325a3676ace4cc (patch) | |
tree | e35289262967573c2ceb56ce67f66d7e678dba41 /python/guestfs-py.c | |
parent | 3cb794463a62239e36d730bc5d2d3eb4c7a66096 (diff) | |
download | libguestfs-ac286b26df1aabceca26dac66c325a3676ace4cc.tar.gz libguestfs-ac286b26df1aabceca26dac66c325a3676ace4cc.tar.xz libguestfs-ac286b26df1aabceca26dac66c325a3676ace4cc.zip |
Generated code for cp, cp-a and mv commands.
Diffstat (limited to 'python/guestfs-py.c')
-rw-r--r-- | python/guestfs-py.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c index 5afcee35..b85ba1aa 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -3078,6 +3078,84 @@ py_guestfs_grub_install (PyObject *self, PyObject *args) return py_r; } +static PyObject * +py_guestfs_cp (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *src; + const char *dest; + + if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_cp", + &py_g, &src, &dest)) + return NULL; + g = get_handle (py_g); + + r = guestfs_cp (g, src, dest); + 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_cp_a (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *src; + const char *dest; + + if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_cp_a", + &py_g, &src, &dest)) + return NULL; + g = get_handle (py_g); + + r = guestfs_cp_a (g, src, dest); + 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_mv (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + const char *src; + const char *dest; + + if (!PyArg_ParseTuple (args, (char *) "Oss:guestfs_mv", + &py_g, &src, &dest)) + return NULL; + g = get_handle (py_g); + + r = guestfs_mv (g, src, dest); + 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 }, @@ -3188,6 +3266,9 @@ static PyMethodDef methods[] = { { (char *) "fsck", py_guestfs_fsck, METH_VARARGS, NULL }, { (char *) "zero", py_guestfs_zero, METH_VARARGS, NULL }, { (char *) "grub_install", py_guestfs_grub_install, METH_VARARGS, NULL }, + { (char *) "cp", py_guestfs_cp, METH_VARARGS, NULL }, + { (char *) "cp_a", py_guestfs_cp_a, METH_VARARGS, NULL }, + { (char *) "mv", py_guestfs_mv, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; |