Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a7e1f973ccd1abfc…
Commit: a7e1f973ccd1abfc0f868f0b9c2382c2034e1633
Parent: 75568294be01f74ddadbf2c9bacf5d2fce219a44
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Wed Dec 14 15:30:01 2016 -0600
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Dec 20 11:06:57 2016 -0600
lvmdbusd: Use timeout_add instead
The function timeout_add_seconds has quite a bit of variability. Using
timeout_add which specifies the timeout in ms instead of seconds. Testing
shows that this is much more consistent which should improve clients that
are using shorter timeouts for the API and the connection.
---
daemons/lvmdbusd/request.py | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/daemons/lvmdbusd/request.py b/daemons/lvmdbusd/request.py
index 7c5da46..78392de 100644
--- a/daemons/lvmdbusd/request.py
+++ b/daemons/lvmdbusd/request.py
@@ -19,7 +19,6 @@ from .utils import log_error, mt_async_result
class RequestEntry(object):
def __init__(self, tmo, method, arguments, cb, cb_error,
return_tuple=True, job_state=None):
- self.tmo = tmo
self.method = method
self.arguments = arguments
self.cb = cb
@@ -35,23 +34,27 @@ class RequestEntry(object):
self._return_tuple = return_tuple
self._job_state = job_state
- if self.tmo < 0:
+ if tmo < 0:
# Client is willing to block forever
pass
elif tmo == 0:
self._return_job()
else:
- self.timer_id = GLib.timeout_add_seconds(
- tmo, RequestEntry._request_timeout, self)
+ # Note: using 990 instead of 1000 for second to ms conversion to
+ # account for overhead. Goal is to return just before the
+ # timeout amount has expired. Better to be a little early than
+ # late.
+ self.timer_id = GLib.timeout_add(
+ tmo * 990, RequestEntry._request_timeout, self)
@staticmethod
def _request_timeout(r):
"""
Method which gets called when the timer runs out!
:param r: RequestEntry which timed out
- :return: Nothing
+ :return: Result of timer_expired
"""
- r.timer_expired()
+ return r.timer_expired()
def _return_job(self):
# Return job is only called when we create a request object or when
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6fe6e8053a136af4…
Commit: 6fe6e8053a136af45174f153c00d404995af6e1c
Parent: f47da0ad234118f4a7a5e64b7a8480f6afd8e1de
Author: Tony Asleson <tasleson(a)redhat.com>
AuthorDate: Mon Dec 12 16:13:27 2016 -0600
Committer: Tony Asleson <tasleson(a)redhat.com>
CommitterDate: Tue Dec 20 11:06:57 2016 -0600
lvmdbusd: Remove un-needed main thread execution
---
daemons/lvmdbusd/request.py | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmdbusd/request.py b/daemons/lvmdbusd/request.py
index a2c2ac9..7c5da46 100644
--- a/daemons/lvmdbusd/request.py
+++ b/daemons/lvmdbusd/request.py
@@ -54,12 +54,15 @@ class RequestEntry(object):
r.timer_expired()
def _return_job(self):
+ # Return job is only called when we create a request object or when
+ # we pop a timer. In both cases we are running in the correct context
+ # and do not need to schedule the call back in main context.
self._job = Job(self, self._job_state)
cfg.om.register_object(self._job, True)
if self._return_tuple:
- mt_async_result(self.cb, ('/', self._job.dbus_object_path()))
+ self.cb(('/', self._job.dbus_object_path()))
else:
- mt_async_result(self.cb, self._job.dbus_object_path())
+ self.cb(self._job.dbus_object_path())
def run_cmd(self):
try:
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=eb3f83357afd2b74…
Commit: eb3f83357afd2b7462f5be9f409424f588a138c8
Parent: c90e9392e47a04f0d89c8ab0e0dca7fe9de00143
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Dec 19 14:06:55 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Dec 19 14:41:16 2016 +0100
lvconvert: fix shown lv name for snapshot split
We can't keep 'display_lvname' for too long - it's using
ringbuffer and keeps limited number of names. So it's
safe only per few simple tests, but can't be used anymore
after some function calls..
(Fixes 00e641ef37a977129acc503f3fa1b67f556ac5eb)
---
WHATS_NEW | 1 +
tools/lvconvert.c | 10 +++++-----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index fbaa369..ab113ae 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.169 -
=====================================
+ Fix displayed lv name when splitting snapshot (2.02.146).
Warn about command not making metadata backup just once per command.
Enable usage of cached volume as thin volume's external origin.
Support cache volume activation with -real layer.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 393d286..4103995 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2167,7 +2167,7 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu
return_0;
if (lv_is_pvmove(cow) || lv_is_mirror_type(cow) || lv_is_raid_type(cow) || lv_is_thin_type(cow)) {
- log_error("LV %s type is unsupported with --splitsnapshot.", cow_name);
+ log_error("LV %s type is unsupported with --splitsnapshot.", display_lvname(cow));
return 0;
}
@@ -2179,8 +2179,8 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu
lv_is_visible(cow) &&
lv_is_active(cow)) {
if (yes_no_prompt("Do you really want to split off active "
- "logical volume %s? [y/n]: ", cow_name) == 'n') {
- log_error("Logical volume %s not split.", cow_name);
+ "logical volume %s? [y/n]: ", display_lvname(cow)) == 'n') {
+ log_error("Logical volume %s not split.", display_lvname(cow));
return 0;
}
}
@@ -2189,14 +2189,14 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu
if (!archive(vg))
return_0;
- log_verbose("Splitting snapshot %s from its origin.", cow_name);
+ log_verbose("Splitting snapshot %s from its origin.", display_lvname(cow));
if (!vg_remove_snapshot(cow))
return_0;
backup(vg);
- log_print_unless_silent("Logical Volume %s split from its origin.", cow_name);
+ log_print_unless_silent("Logical Volume %s split from its origin.", display_lvname(cow));
return 1;
}