diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-30 11:17:06 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-30 13:10:44 +0100 |
commit | f68b3ac861ae607a333211c775dded82ae2b2c4a (patch) | |
tree | 03dfee58ccfd723bcbc9dc6c6d7270629ae4489d /python | |
parent | 3d15f7e652340777514ff30c3cfc560a90b612ec (diff) | |
download | libguestfs-f68b3ac861ae607a333211c775dded82ae2b2c4a.tar.gz libguestfs-f68b3ac861ae607a333211c775dded82ae2b2c4a.tar.xz libguestfs-f68b3ac861ae607a333211c775dded82ae2b2c4a.zip |
Generated code for 'set_memsize'/'get_memsize' calls.
Diffstat (limited to 'python')
-rw-r--r-- | python/guestfs-py.c | 50 | ||||
-rw-r--r-- | python/guestfs.py | 27 |
2 files changed, 77 insertions, 0 deletions
diff --git a/python/guestfs-py.c b/python/guestfs-py.c index 340beebe..bf27d0d5 100644 --- a/python/guestfs-py.c +++ b/python/guestfs-py.c @@ -1657,6 +1657,54 @@ py_guestfs_end_busy (PyObject *self, PyObject *args) } static PyObject * +py_guestfs_set_memsize (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + int memsize; + + if (!PyArg_ParseTuple (args, (char *) "Oi:guestfs_set_memsize", + &py_g, &memsize)) + return NULL; + g = get_handle (py_g); + + r = guestfs_set_memsize (g, memsize); + 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_get_memsize (PyObject *self, PyObject *args) +{ + PyObject *py_g; + guestfs_h *g; + PyObject *py_r; + int r; + + if (!PyArg_ParseTuple (args, (char *) "O:guestfs_get_memsize", + &py_g)) + return NULL; + g = get_handle (py_g); + + r = guestfs_get_memsize (g); + if (r == -1) { + PyErr_SetString (PyExc_RuntimeError, guestfs_last_error (g)); + return NULL; + } + + py_r = PyInt_FromLong ((long) r); + return py_r; +} + +static PyObject * py_guestfs_mount (PyObject *self, PyObject *args) { PyObject *py_g; @@ -5060,6 +5108,8 @@ static PyMethodDef methods[] = { { (char *) "set_busy", py_guestfs_set_busy, METH_VARARGS, NULL }, { (char *) "set_ready", py_guestfs_set_ready, METH_VARARGS, NULL }, { (char *) "end_busy", py_guestfs_end_busy, METH_VARARGS, NULL }, + { (char *) "set_memsize", py_guestfs_set_memsize, METH_VARARGS, NULL }, + { (char *) "get_memsize", py_guestfs_get_memsize, METH_VARARGS, NULL }, { (char *) "mount", py_guestfs_mount, METH_VARARGS, NULL }, { (char *) "sync", py_guestfs_sync, METH_VARARGS, NULL }, { (char *) "touch", py_guestfs_touch, METH_VARARGS, NULL }, diff --git a/python/guestfs.py b/python/guestfs.py index aa3572bf..d334a910 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -415,6 +415,33 @@ class GuestFS: """ return libguestfsmod.end_busy (self._o) + def set_memsize (self, memsize): + u"""This sets the memory size in megabytes allocated to the + qemu subprocess. This only has any effect if called + before "g.launch". + + You can also change this by setting the environment + variable "LIBGUESTFS_MEMSIZE" before the handle is + created. + + For more information on the architecture of libguestfs, + see guestfs(3). + """ + return libguestfsmod.set_memsize (self._o, memsize) + + def get_memsize (self): + u"""This gets the memory size in megabytes allocated to the + qemu subprocess. + + If "g.set_memsize" was not called on this handle, and if + "LIBGUESTFS_MEMSIZE" was not set, then this returns the + compiled-in default value for memsize. + + For more information on the architecture of libguestfs, + see guestfs(3). + """ + return libguestfsmod.get_memsize (self._o) + def mount (self, device, mountpoint): u"""Mount a guest disk at a position in the filesystem. Block devices are named "/dev/sda", "/dev/sdb" and so |