Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 659069 Details for
Bug 884874
[PATCH] snapshot API, and fix for create linear API.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Add python snapshot API
pylvm2-create-snapshot-api.patch (text/plain), 1.70 KB, created by
James Antill
on 2012-12-06 22:06:46 UTC
(
hide
)
Description:
Add python snapshot API
Filename:
MIME Type:
Creator:
James Antill
Created:
2012-12-06 22:06:46 UTC
Size:
1.70 KB
patch
obsolete
>commit 71a77975b89d7356f7f4873b69c40a4995afd74d >Author: James Antill <james@and.org> >Date: Thu Dec 6 16:57:14 2012 -0500 > > Add lv.snapshot() API, uses new lvm_vg_create_lv_snapshot() lvm2 API. > >diff --git a/liblvm.c b/liblvm.c >index 633f604..fc64585 100644 >--- a/liblvm.c >+++ b/liblvm.c >@@ -1318,6 +1318,44 @@ liblvm_lvm_lv_list_lvsegs(lvobject *self) > return pytuple; > } > >+static PyObject * >+liblvm_lvm_vg_create_lv_snapshot(lvobject *self, PyObject *args) >+{ >+ const char *vgname; >+ uint64_t size; >+ unsigned long asize; >+ lvobject *lvobj; >+ vgobject *vgobj; >+ const char *selfname = NULL; >+ >+ LV_VALID(self); >+ >+ if (!PyArg_ParseTuple(args, "sl", &vgname, &asize)) { >+ return NULL; >+ } >+ size = asize; >+ >+ if ((lvobj = PyObject_New(lvobject, &LibLVMlvType)) == NULL) >+ return NULL; >+ >+ /* Initialize the parent ptr in case lv create fails and we dealloc lvobj */ >+ lvobj->parent_vgobj = NULL; >+ >+ selfname = lvm_lv_get_name(self->lv); >+ vgobj = self->parent_vgobj; >+ if ((lvobj->lv = lvm_vg_create_lv_snapshot(vgobj->vg, selfname, >+ vgname, size)) == NULL) { >+ PyErr_SetObject(LibLVMError, liblvm_get_last_error()); >+ Py_DECREF(lvobj); >+ return NULL; >+ } >+ >+ lvobj->parent_vgobj = vgobj; >+ Py_INCREF(lvobj->parent_vgobj); >+ >+ return (PyObject *)lvobj; >+} >+ > /* PV Methods */ > > #define PV_VALID(pvobject) \ >@@ -1590,6 +1628,7 @@ static PyMethodDef liblvm_lv_methods[] = { > #endif > { "resize", (PyCFunction)liblvm_lvm_lv_resize, METH_VARARGS }, > { "listLVsegs", (PyCFunction)liblvm_lvm_lv_list_lvsegs, METH_NOARGS }, >+ { "snapshot", (PyCFunction)liblvm_lvm_vg_create_lv_snapshot, METH_VARARGS }, > { NULL, NULL} /* sentinel */ > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 884874
:
659067
|
659068
| 659069