block: do not treat disks of not running VMs as used

There are legitimate use cases when one want to attach disk of one VM to
some other. Do not try to detach the disk from powered down VM in such
case.
This commit is contained in:
Marek Marczykowski-Górecki 2015-07-01 04:42:44 +02:00
parent d9c2990747
commit 310ba9f1df

View File

@ -337,6 +337,8 @@ def block_check_attached(qvmc, device):
if vm.qid == 0:
# Connecting devices to dom0 not supported
continue
if not vm.is_running():
continue
try:
libvirt_domain = vm.libvirt_domain
if libvirt_domain: