mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvmdbusd: Place Manager.UseLvmShell request on queue
We need to acquire a lock which can block us which in turn causes the dbus request handling to block as well. Place the request on the work queue instead.
This commit is contained in:
parent
df92d330aa
commit
99806ec7ec
@ -158,16 +158,22 @@ class Manager(AutomatedProperties):
|
||||
return p
|
||||
return '/'
|
||||
|
||||
@staticmethod
|
||||
def _use_lvm_shell(yes_no):
|
||||
return dbus.Boolean(cmdhandler.set_execution(yes_no))
|
||||
|
||||
@dbus.service.method(
|
||||
dbus_interface=MANAGER_INTERFACE,
|
||||
in_signature='b', out_signature='b')
|
||||
def UseLvmShell(self, yes_no):
|
||||
in_signature='b', out_signature='b',
|
||||
async_callbacks=('cb', 'cbe'))
|
||||
def UseLvmShell(self, yes_no, cb, cbe):
|
||||
"""
|
||||
Allow the client to enable/disable lvm shell, used for testing
|
||||
:param yes_no:
|
||||
:return: Nothing
|
||||
"""
|
||||
return dbus.Boolean(cmdhandler.set_execution(yes_no))
|
||||
r = RequestEntry(-1, Manager._use_lvm_shell, (yes_no,), cb, cbe, False)
|
||||
cfg.worker_q.put(r)
|
||||
|
||||
@dbus.service.method(
|
||||
dbus_interface=MANAGER_INTERFACE,
|
||||
|
Loading…
Reference in New Issue
Block a user