start XS transaction before getting the list of domains
This commit is contained in:
parent
caf3ed1ae4
commit
abfe99756f
@ -196,6 +196,8 @@ def block_list(vm = None, system_disks = False):
|
|||||||
desc_re = re.compile(r"^.{1,255}$")
|
desc_re = re.compile(r"^.{1,255}$")
|
||||||
mode_re = re.compile(r"^[rw]$")
|
mode_re = re.compile(r"^[rw]$")
|
||||||
|
|
||||||
|
xs_trans = xs.transaction_start()
|
||||||
|
|
||||||
vm_list = []
|
vm_list = []
|
||||||
if vm is not None:
|
if vm is not None:
|
||||||
if not vm.is_running():
|
if not vm.is_running():
|
||||||
@ -205,7 +207,6 @@ def block_list(vm = None, system_disks = False):
|
|||||||
else:
|
else:
|
||||||
vm_list = xs.ls('', '/local/domain')
|
vm_list = xs.ls('', '/local/domain')
|
||||||
|
|
||||||
xs_trans = xs.transaction_start()
|
|
||||||
devices_list = {}
|
devices_list = {}
|
||||||
for xid in vm_list:
|
for xid in vm_list:
|
||||||
vm_name = xs.read(xs_trans, '/local/domain/%s/name' % xid)
|
vm_name = xs.read(xs_trans, '/local/domain/%s/name' % xid)
|
||||||
|
Loading…
Reference in New Issue
Block a user