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 659068 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 snapshot C API
lvm2-create-snapshot-api.patch (text/plain), 2.34 KB, created by
James Antill
on 2012-12-06 22:06:18 UTC
(
hide
)
Description:
Add snapshot C API
Filename:
MIME Type:
Creator:
James Antill
Created:
2012-12-06 22:06:18 UTC
Size:
2.34 KB
patch
obsolete
>commit b1078d4f14a8ea66d81ab1a4ac16df4be2732daa >Author: James Antill <james@and.org> >Date: Thu Dec 6 16:58:26 2012 -0500 > > Add an exported lvm_vg_create_lv_snapshot() API, to create snapshots LVs. > >diff --git a/liblvm/lvm2app.h b/liblvm/lvm2app.h >index dd200e3..500f149 100644 >--- a/liblvm/lvm2app.h >+++ b/liblvm/lvm2app.h >@@ -1002,6 +1002,32 @@ int lvm_vg_set_property(const vg_t vg, const char *name, > lv_t lvm_vg_create_lv_linear(vg_t vg, const char *name, uint64_t size); > > /** >+ * Create a logical volume snapshot of another volume. >+ * This function commits the change to disk and does _not_ require calling >+ * lvm_vg_write(). >+ * NOTE: The commit behavior of this function is subject to change >+ * as the API is developed. >+ * >+ * \param vg >+ * VG handle obtained from lvm_vg_create() or lvm_vg_open(). >+ * >+ * \param origin >+ * Name of logical volume to create snapshot from. >+ * >+ * \param name >+ * Name of logical volume to create. >+ * >+ * \param size >+ * Size of logical volume in extents. >+ * >+ * \return >+ * non-NULL handle to an LV object created, or NULL if creation fails. >+ * >+ */ >+lv_t lvm_vg_create_lv_snapshot(vg_t vg, const char *origin, >+ const char *name, uint64_t size); >+ >+/** > * Return a list of lvseg handles for a given LV handle. > * > * \memberof lv_t >diff --git a/liblvm/lvm_lv.c b/liblvm/lvm_lv.c >index 336b714..6a394fd 100644 >--- a/liblvm/lvm_lv.c >+++ b/liblvm/lvm_lv.c >@@ -166,6 +166,33 @@ lv_t lvm_vg_create_lv_linear(vg_t vg, const char *name, uint64_t size) > return (lv_t) lvl->lv; > } > >+lv_t lvm_vg_create_lv_snapshot(vg_t vg, const char *origin, >+ const char *name, uint64_t size) >+{ >+ struct lvcreate_params lp; >+ uint64_t extents; >+ struct lv_list *lvl; >+ >+ if (vg_read_error(vg)) >+ return NULL; >+ if (!vg_check_write_mode(vg)) >+ return NULL; >+ memset(&lp, 0, sizeof(lp)); >+ extents = extents_from_size(vg->cmd, size / SECTOR_SIZE, >+ vg->extent_size); >+ _lv_set_default_params(&lp, vg, name, extents); >+ if (!_lv_set_default_linear_params(vg->cmd, &lp)) >+ return_NULL; >+ lp.snapshot = 1; >+ lp.origin = origin; >+ if (!lv_create_single(vg, &lp)) >+ return NULL; >+ lvl = find_lv_in_vg(vg, name); >+ if (!lvl) >+ return NULL; >+ return (lv_t) lvl->lv; >+} >+ > /* > * FIXME: This function should probably not commit to disk but require calling > * lvm_vg_write.
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