Skip to content

Commit bbe7a7c

Browse files
committed
Fix lvutil.extractUuid
It's not supposed to return SR UUID but is used for parsing path like this "VG_XenStorage--a6f308d1--764f--f50c--dcda--0d9c0be2d710-VHD--cd1d86c1--f379--400c--b1f4--5a73f74119d3" instead. Replace its usage to obtain SR UUID in qcow2util by the same log instead. Signed-off-by: Damien Thenot <damien.thenot@vates.tech>
1 parent f941636 commit bbe7a7c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/lvmcowutil.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ def extractUuid(path: str) -> str:
229229
if uuid.startswith(VG_PREFIX):
230230
# we are dealing with realpath
231231
uuid = uuid.replace("--", "-")
232-
uuid = uuid.replace(VG_PREFIX, "")
233-
return uuid
232+
234233
for prefix in LV_PREFIX.values():
235234
if uuid.find(prefix) != -1:
236235
uuid = uuid.split(prefix)[-1]

drivers/qcow2util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from blktap2 import TapCtl
1515
from cowutil import CowUtil, CowImageInfo
1616
from lvmcache import LVMCache
17-
from LVMSR import NS_PREFIX_LVM
17+
from constants import NS_PREFIX_LVM, VG_PREFIX
1818

1919
MAX_QCOW_CHAIN_LENGTH: Final = 30
2020

@@ -495,7 +495,8 @@ def _getInfoLV(
495495
return None
496496

497497
vdiUuid = extractUuidFunction(lvPath)
498-
srUuid = extractUuidFunction(vgName)
498+
srUuid = vgName.replace(VG_PREFIX, "")
499+
499500
ns = NS_PREFIX_LVM + srUuid
500501
lvcache.activate(ns, vdiUuid, lvName, False)
501502
try:

0 commit comments

Comments
 (0)