diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/guestfs-py.c | 31 | ||||
-rw-r--r-- | python/guestfs.py | 11 |
2 files changed, 42 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c index 59f0b6e4..0022b5b5 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -2795,6 +2795,36 @@ py_guestfs_mount_vfs (PyObject *self, PyObject *args) 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 PyMethodDef methods[] = { { (char *) "create", py_guestfs_create, METH_VARARGS, NULL }, { (char *) "close", py_guestfs_close, METH_VARARGS, NULL }, @@ -2894,6 +2924,7 @@ static PyMethodDef methods[] = { { (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 }, { NULL, NULL, 0, NULL } }; diff --git a/python/guestfs.py b/python/guestfs.py index 7515aa75..b2c3e49a 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -1075,3 +1075,14 @@ class GuestFS: """ return libguestfsmod.mount_vfs (self._o, options, vfstype, device, mountpoint) + def debug (self, subcmd, extraargs): + u"""The "g.debug" command exposes some internals of + "guestfsd" (the guestfs daemon) that runs inside the + qemu subprocess. + + There is no comprehensive help for this command. You + have to look at the file "daemon/debug.c" in the + libguestfs source to find out what you can do. + """ + return libguestfsmod.debug (self._o, subcmd, extraargs) + |