Generated code for 'add_drive_ro' call.

This commit is contained in:
Richard Jones
2009-06-02 14:25:25 +01:00
parent bfdc03be23
commit d1a1ab972b
17 changed files with 320 additions and 5 deletions

View File

@@ -1178,6 +1178,31 @@ py_guestfs_add_cdrom (PyObject *self, PyObject *args)
return py_r;
}
static PyObject *
py_guestfs_add_drive_ro (PyObject *self, PyObject *args)
{
PyObject *py_g;
guestfs_h *g;
PyObject *py_r;
int r;
const char *filename;
if (!PyArg_ParseTuple (args, (char *) "Os:guestfs_add_drive_ro",
&py_g, &filename))
return NULL;
g = get_handle (py_g);
r = guestfs_add_drive_ro (g, filename);
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_config (PyObject *self, PyObject *args)
{
@@ -4416,6 +4441,7 @@ static PyMethodDef methods[] = {
{ (char *) "kill_subprocess", py_guestfs_kill_subprocess, METH_VARARGS, NULL },
{ (char *) "add_drive", py_guestfs_add_drive, METH_VARARGS, NULL },
{ (char *) "add_cdrom", py_guestfs_add_cdrom, METH_VARARGS, NULL },
{ (char *) "add_drive_ro", py_guestfs_add_drive_ro, METH_VARARGS, NULL },
{ (char *) "config", py_guestfs_config, METH_VARARGS, NULL },
{ (char *) "set_qemu", py_guestfs_set_qemu, METH_VARARGS, NULL },
{ (char *) "get_qemu", py_guestfs_get_qemu, METH_VARARGS, NULL },

View File

@@ -198,6 +198,12 @@ class GuestFS:
This is equivalent to the qemu parameter "-drive
file=filename".
Note that this call checks for the existence of
"filename". This stops you from specifying other types
of drive which are supported by qemu such as "nbd:" and
"http:" URLs. To specify those, use the general
"g.config" call instead.
"""
return libguestfsmod.add_drive (self._o, filename)
@@ -207,9 +213,37 @@ class GuestFS:
This is equivalent to the qemu parameter "-cdrom
filename".
Note that this call checks for the existence of
"filename". This stops you from specifying other types
of drive which are supported by qemu such as "nbd:" and
"http:" URLs. To specify those, use the general
"g.config" call instead.
"""
return libguestfsmod.add_cdrom (self._o, filename)
def add_drive_ro (self, filename):
u"""This adds a drive in snapshot mode, making it
effectively read-only.
Note that writes to the device are allowed, and will be
seen for the duration of the guestfs handle, but they
are written to a temporary file which is discarded as
soon as the guestfs handle is closed. We don't currently
have any method to enable changes to be committed,
although qemu can support this.
This is equivalent to the qemu parameter "-drive
file=filename,snapshot=on".
Note that this call checks for the existence of
"filename". This stops you from specifying other types
of drive which are supported by qemu such as "nbd:" and
"http:" URLs. To specify those, use the general
"g.config" call instead.
"""
return libguestfsmod.add_drive_ro (self._o, filename)
def config (self, qemuparam, qemuvalue):
u"""This can be used to add arbitrary qemu command line
parameters of the form "-param value". Actually it's not