From 8c3b820c2b687345448e3d74a7101b07ff32688e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 1 May 2009 11:47:31 +0100 Subject: Generated code for ping-daemon command. --- python/guestfs-py.c | 25 +++++++++++++++++++++++++ python/guestfs.py | 9 +++++++++ 2 files changed, 34 insertions(+) (limited to 'python') diff --git a/python/guestfs-py.c b/python/guestfs-py.c index dd9f4ca3..6a807e3e 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -3205,6 +3205,30 @@ py_guestfs_dmesg (PyObject *self, PyObject *args) return py_r; } +static PyObject * +py_guestfs_ping_daemon (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + + if (!PyArg_ParseTuple (args, (char *) "O:guestfs_ping_daemon", + &py_g)) + return NULL; + g = get_handle (py_g); + + r = guestfs_ping_daemon (g); + 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 }, @@ -3320,6 +3344,7 @@ static PyMethodDef methods[] = { { (char *) "mv", py_guestfs_mv, METH_VARARGS, NULL }, { (char *) "drop_caches", py_guestfs_drop_caches, METH_VARARGS, NULL }, { (char *) "dmesg", py_guestfs_dmesg, METH_VARARGS, NULL }, + { (char *) "ping_daemon", py_guestfs_ping_daemon, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } }; diff --git a/python/guestfs.py b/python/guestfs.py index e2989223..1596bcdb 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -1233,3 +1233,12 @@ class GuestFS: """ return libguestfsmod.dmesg (self._o) + def ping_daemon (self): + u"""This is a test probe into the guestfs daemon running + inside the qemu subprocess. Calling this function checks + that the daemon responds to the ping message, without + affecting the daemon or attached block device(s) in any + other way. + """ + return libguestfsmod.ping_daemon (self._o) + -- cgit