diff options
author | Richard Jones <rjones@redhat.com> | 2009-05-21 16:18:16 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-05-21 16:18:16 +0100 |
commit | 3e408f493496597dc026d20778837f421f05a9dd (patch) | |
tree | 5aee1850ae052c36ab56de764d4130789280c7a8 /python | |
parent | 0f81d0941a2705d49bc129f69924265fa60d9677 (diff) | |
download | libguestfs-3e408f493496597dc026d20778837f421f05a9dd.tar.gz libguestfs-3e408f493496597dc026d20778837f421f05a9dd.tar.xz libguestfs-3e408f493496597dc026d20778837f421f05a9dd.zip |
Generated code for e2fsck-f command.
Diffstat (limited to 'python')
-rw-r--r-- | python/guestfs-py.c | 26 | ||||
-rw-r--r-- | python/guestfs.py | 17 |
2 files changed, 43 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c index bb641043..44614620 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -3688,6 +3688,31 @@ py_guestfs_find (PyObject *self, PyObject *args) return py_r; } +static PyObject * +py_guestfs_e2fsck_f (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_e2fsck_f", + &py_g, &device)) + return NULL; + g = get_handle (py_g); + + r = guestfs_e2fsck_f (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 }, @@ -3822,6 +3847,7 @@ static PyMethodDef methods[] = { { (char *) "lvresize", py_guestfs_lvresize, METH_VARARGS, NULL }, { (char *) "resize2fs", py_guestfs_resize2fs, METH_VARARGS, NULL }, { (char *) "find", py_guestfs_find, METH_VARARGS, NULL }, + { (char *) "e2fsck_f", py_guestfs_e2fsck_f, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; diff --git a/python/guestfs.py b/python/guestfs.py index 237e62d4..a82c8cba 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -1433,6 +1433,13 @@ class GuestFS: def resize2fs (self, device): u"""This resizes an ext2 or ext3 filesystem to match the size of the underlying device. + + *Note:* It is sometimes required that you run + "g.e2fsck_f" on the "device" before calling this + command. For unknown reasons "resize2fs" sometimes gives + an error about this and sometimes not. In any case, it + is always safe to call "g.e2fsck_f" before calling this + function. """ return libguestfsmod.resize2fs (self._o, device) @@ -1467,3 +1474,13 @@ class GuestFS: """ return libguestfsmod.find (self._o, directory) + def e2fsck_f (self, device): + u"""This runs "e2fsck -p -f device", ie. runs the ext2/ext3 + filesystem checker on "device", noninteractively ("-p"), + even if the filesystem appears to be clean ("-f"). + + This command is only needed because of "g.resize2fs" + (q.v.). Normally you should use "g.fsck". + """ + return libguestfsmod.e2fsck_f (self._o, device) + |