Browse Source

Additional check for qemu-nbd hang

/sys/block/*device*/pid check is not enough. I see that the unix
socket used by the device my be stuck as well, so let's add another
check for the path to the unix socket for the device as well to
figure out if the device is free. Complain loud and clear that the
qemu-nbd is leaking resources.

Change-Id: I28cedffba7a9915ef6f7888989e40e4d0de475c6
Closes-Bug: #973413
Partial-Bug: #1254890
tags/2014.1.b3
Davanum Srinivas 5 years ago
parent
commit
a0891ad0af
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      nova/virt/disk/mount/nbd.py

+ 5
- 1
nova/virt/disk/mount/nbd.py View File

@@ -52,7 +52,11 @@ class NbdMount(api.Mount):
def _find_unused(self, devices):
for device in devices:
if not os.path.exists(os.path.join('/sys/block/', device, 'pid')):
return device
if not os.path.exists('/var/lock/qemu-nbd-%s' % device):
return device
else:
LOG.error(_('NBD error - previous umount did not cleanup '
'/var/lock/qemu-nbd-%s.'), device)
LOG.warn(_('No free nbd devices'))
return None


Loading…
Cancel
Save