master - lvmdbus: resync latest changes with original repo
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0f353e205389180808557688c03b9565b6da0509 Commit: 0f353e205389180808557688c03b9565b6da0509 Parent: 545e58fd180cb891744a34a4d79440c447e5744b Author: Alasdair G Kergon <[email protected]> AuthorDate: Thu Feb 18 00:27:57 2016 +0000 Committer: Alasdair G Kergon <[email protected]> CommitterDate: Thu Feb 18 00:27:57 2016 +0000
lvmdbus: resync latest changes with original repo
--- daemons/lvmdbusd/lv.py | 15 +++++++ daemons/lvmdbusd/manager.py | 5 ++ daemons/lvmdbusd/request.py | 2 +- daemons/lvmdbusd/utils.py | 96 +++++++++++++++++++++++++++++++++++++++++++ daemons/lvmdbusd/vg.py | 22 ++++++++++ 5 files changed, 139 insertions(+), 1 deletions(-)
daemons/lvmdbusd/lv.py +15 -0
@@ -377,6 +377,8 @@ class Lv(LvCommon): out_signature='o', async_callbacks=('cb', 'cbe')) def Rename(self, name, tmo, rename_options, cb, cbe): + utils.validate_lv_name(LV_INTERFACE, self.vg_name_lookup(), name) + r = RequestEntry( tmo, Lv._rename, (self.Uuid, self.lvm_id, name, rename_options),
@@ -441,6 +443,9 @@ class Lv(LvCommon): async_callbacks=('cb', 'cbe')) def Snapshot(self, name, optional_size, tmo, snapshot_options, cb, cbe): + + utils.validate_lv_name(LV_INTERFACE, self.vg_name_lookup(), name) + r = RequestEntry( tmo, Lv._snap_shot, (self.Uuid, self.lvm_id, name,
@@ -590,6 +595,10 @@ class Lv(LvCommon): out_signature='o', async_callbacks=('cb', 'cbe')) def TagsAdd(self, tags, tmo, tag_options, cb, cbe): + + for t in tags: + utils.validate_tag(LV_INTERFACE, t) + r = RequestEntry( tmo, Lv._add_rm_tags, (self.state.Uuid, self.state.lvm_id,
@@ -603,6 +612,10 @@ class Lv(LvCommon): out_signature='o', async_callbacks=('cb', 'cbe')) def TagsDel(self, tags, tmo, tag_options, cb, cbe): + + for t in tags: + utils.validate_tag(LV_INTERFACE, t) + r = RequestEntry( tmo, Lv._add_rm_tags, (self.state.Uuid, self.state.lvm_id,
@@ -678,6 +691,8 @@ class LvThinPool(Lv): out_signature='(oo)', async_callbacks=('cb', 'cbe')) def LvCreate(self, name, size_bytes, tmo, create_options, cb, cbe): + utils.validate_lv_name(THIN_POOL_INTERFACE, self.vg_name_lookup(), name) + r = RequestEntry( tmo, LvThinPool._lv_create, (self.Uuid, self.lvm_id, name,
daemons/lvmdbusd/lvmdbusd +0 -0
daemons/lvmdbusd/manager.py +5 -0
@@ -61,6 +61,7 @@ class Manager(AutomatedProperties): out_signature='(oo)', async_callbacks=('cb', 'cbe')) def PvCreate(self, device, tmo, create_options, cb, cbe): + utils.validate_device_path(MANAGER_INTERFACE, device) r = RequestEntry( tmo, Manager._pv_create, (device, create_options), cb, cbe)
@@ -100,6 +101,7 @@ class Manager(AutomatedProperties): out_signature='(oo)', async_callbacks=('cb', 'cbe')) def VgCreate(self, name, pv_object_paths, tmo, create_options, cb, cbe): + utils.validate_vg_name(MANAGER_INTERFACE, name) r = RequestEntry( tmo, Manager._create_vg, (name, pv_object_paths, create_options,),
@@ -219,6 +221,9 @@ class Manager(AutomatedProperties): :param cbe: Not visible in API (used for async. error callback) :return: '/' if operation done, else job path """ + for d in device_paths: + utils.validate_device_path(MANAGER_INTERFACE, d) + r = RequestEntry( tmo, Manager._pv_scan, (activate, cache, device_paths, major_minors,
daemons/lvmdbusd/request.py +1 -1
@@ -34,7 +34,7 @@ class RequestEntry(object): self._rc_error = None self._return_tuple = return_tuple - if self.tmo == -1: + if self.tmo < 0: # Client is willing to block forever pass elif tmo == 0:
daemons/lvmdbusd/utils.py +96 -0
105 lines not on this page · raw message
daemons/lvmdbusd/vg.py +22 -0
@@ -179,6 +179,7 @@ class Vg(AutomatedProperties): in_signature='sia{sv}', out_signature='o', async_callbacks=('cb', 'cbe')) def Rename(self, name, tmo, rename_options, cb, cbe): + utils.validate_vg_name(VG_INTERFACE, name) r = RequestEntry(tmo, Vg._rename, (self.state.Uuid, self.state.lvm_id, name, rename_options), cb, cbe, False)
@@ -422,6 +423,7 @@ class Vg(AutomatedProperties): job object path if created. Each == '/' when it doesn't apply. """ + utils.validate_lv_name(VG_INTERFACE, self.Name, name) r = RequestEntry(tmo, Vg._lv_create, (self.state.Uuid, self.state.lvm_id, name, round_size(size_bytes), pv_dests_and_ranges,
@@ -459,6 +461,7 @@ class Vg(AutomatedProperties): async_callbacks=('cb', 'cbe')) def LvCreateLinear(self, name, size_bytes, thin_pool, tmo, create_options, cb, cbe): + utils.validate_lv_name(VG_INTERFACE, self.Name, name) r = RequestEntry(tmo, Vg._lv_create_linear, (self.state.Uuid, self.state.lvm_id, name, round_size(size_bytes), thin_pool,
@@ -496,6 +499,7 @@ class Vg(AutomatedProperties): def LvCreateStriped(self, name, size_bytes, num_stripes, stripe_size_kb, thin_pool, tmo, create_options, cb, cbe): + utils.validate_lv_name(VG_INTERFACE, self.Name, name) r = RequestEntry( tmo, Vg._lv_create_striped, (self.state.Uuid, self.state.lvm_id, name,
@@ -535,6 +539,7 @@ class Vg(AutomatedProperties): async_callbacks=('cb', 'cbe')) def LvCreateMirror(self, name, size_bytes, num_copies, tmo, create_options, cb, cbe): + utils.validate_lv_name(VG_INTERFACE, self.Name, name) r = RequestEntry( tmo, Vg._lv_create_mirror, (self.state.Uuid, self.state.lvm_id, name,
@@ -575,6 +580,7 @@ class Vg(AutomatedProperties): def LvCreateRaid(self, name, raid_type, size_bytes, num_stripes, stripe_size_kb, tmo, create_options, cb, cbe): + utils.validate_lv_name(VG_INTERFACE, self.Name, name) r = RequestEntry(tmo, Vg._lv_create_raid, (self.state.Uuid, self.state.lvm_id, name, raid_type, round_size(size_bytes), num_stripes,
@@ -692,6 +698,10 @@ class Vg(AutomatedProperties): out_signature='o', async_callbacks=('cb', 'cbe')) def PvTagsAdd(self, pvs, tags, tmo, tag_options, cb, cbe): + + for t in tags: + utils.validate_tag(VG_INTERFACE, t) + r = RequestEntry(tmo, Vg._pv_add_rm_tags, (self.state.Uuid, self.state.lvm_id, pvs, tags, None, tag_options),
@@ -704,6 +714,10 @@ class Vg(AutomatedProperties): out_signature='o', async_callbacks=('cb', 'cbe')) def PvTagsDel(self, pvs, tags, tmo, tag_options, cb, cbe): + + for t in tags: + utils.validate_tag(VG_INTERFACE, t) + r = RequestEntry( tmo, Vg._pv_add_rm_tags, (self.state.Uuid, self.state.lvm_id,
@@ -740,6 +754,10 @@ class Vg(AutomatedProperties): out_signature='o', async_callbacks=('cb', 'cbe')) def TagsAdd(self, tags, tmo, tag_options, cb, cbe): + + for t in tags: + utils.validate_tag(VG_INTERFACE, t) + r = RequestEntry(tmo, Vg._vg_add_rm_tags, (self.state.Uuid, self.state.lvm_id, tags, None, tag_options),
@@ -752,6 +770,10 @@ class Vg(AutomatedProperties): out_signature='o', async_callbacks=('cb', 'cbe')) def TagsDel(self, tags, tmo, tag_options, cb, cbe): + + for t in tags: + utils.validate_tag(VG_INTERFACE, t) + r = RequestEntry(tmo, Vg._vg_add_rm_tags, (self.state.Uuid, self.state.lvm_id, None, tags, tag_options),