Updating link to change in openSUSE:Factory/xen revision 84.0
OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=24e6c52baae4dc9cfba9b8bb18434dec
This commit is contained in:
committed by
Git OBS Bridge
parent
7d0b7344dd
commit
2c789f7e2f
@@ -235,6 +235,13 @@ class Wholedisk:
|
||||
os.system("lvchange -ay '%s' > /dev/null 2>&1" % (self.vdev))
|
||||
self.mapped += 1
|
||||
|
||||
def partitionsdeactivated(self):
|
||||
"Return True if partition mappings have been removed, False otherwise"
|
||||
for part in self.partitions:
|
||||
if os.access(part.pdev, os.F_OK):
|
||||
return False
|
||||
return True
|
||||
|
||||
def deactivatepartitions(self):
|
||||
"""Remove device-mapper mappings and loop mapping.
|
||||
|
||||
@@ -246,9 +253,14 @@ class Wholedisk:
|
||||
self.mapped -= 1
|
||||
if not self.mapped:
|
||||
if self.pcount:
|
||||
verbose_print("kpartx %s -d '%s'" % (kpartx_args, self.physdev()))
|
||||
fd = os.popen("kpartx %s -d '%s'" % (kpartx_args, self.physdev()))
|
||||
fd.close()
|
||||
retries = 10
|
||||
while retries and not self.partitionsdeactivated():
|
||||
verbose_print("kpartx %s -d '%s'" % (kpartx_args, self.physdev()))
|
||||
os.system("kpartx %s -d '%s'" % (kpartx_args, self.physdev()))
|
||||
time.sleep(0.1)
|
||||
retries -= 1
|
||||
if retries == 0:
|
||||
error("unable to remove partition mappings with kpartx -d")
|
||||
if self.pcount and self.lvm:
|
||||
verbose_print("lvchange -an '%s'" % (self.vdev))
|
||||
ret = os.system("lvchange -an '%s' > /dev/null 2>&1" % (self.vdev)) >> 8
|
||||
|
Reference in New Issue
Block a user