[lvm-devel] master - python-lvm: Make second lv.snapshot() argument optional

Andy Grover grover at fedoraproject.org
Fri Dec 14 22:11:08 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0958905b1bc0a59d34a4092377bae7c59f424181
Commit:        0958905b1bc0a59d34a4092377bae7c59f424181
Parent:        0e3093979e901384aecb22e08d83b5acb2ef12c1
Author:        Andy Grover <agrover at redhat.com>
AuthorDate:    Fri Dec 14 14:10:41 2012 -0800
Committer:     Andy Grover <agrover at redhat.com>
CommitterDate: Fri Dec 14 14:10:41 2012 -0800

python-lvm: Make second lv.snapshot() argument optional

If no size is given, size defaults to 0, which in lvm_lv_snapshot will
allocate extents equal to the original LV be allocated for the new
snapshot.

Signed-off-by: Andy Grover <agrover at redhat.com>
---
 python/liblvm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/liblvm.c b/python/liblvm.c
index 906825e..4db507c 100644
--- a/python/liblvm.c
+++ b/python/liblvm.c
@@ -1317,12 +1317,12 @@ static PyObject *
 liblvm_lvm_lv_snapshot(lvobject *self, PyObject *args)
 {
 	const char *vgname;
-	uint64_t size;
+	uint64_t size = 0;
 	lvobject *lvobj;
 
 	LV_VALID(self);
 
-	if (!PyArg_ParseTuple(args, "sl", &vgname, &size)) {
+	if (!PyArg_ParseTuple(args, "s|l", &vgname, &size)) {
 		return NULL;
 	}
 




More information about the lvm-devel mailing list