Skip to content

Commit

Permalink
fix(LargeBlock): Changed 512b check for review
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Thenot <[email protected]>
  • Loading branch information
Nambrok committed Mar 27, 2024
1 parent cbfaa3b commit 5f92e4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/LargeBlockSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def detach(self, sr_uuid):
def create(self, sr_uuid, size):
base_devices = self.dconf["device"].split(",")
for dev in base_devices:
logical_blocksize = util.pread2(["blockdev", "--getss", dev])
if int(logical_blocksize) == 512:
raise xs_errors.XenError("LargeBlockIncorrectBlocksize", opterr="The logical blocksize of the device {} isn't incompatible with other SR types".format(dev))
logical_blocksize = util.pread2(["blockdev", "--getss", dev]).strip()
if logical_blocksize == "512":
raise xs_errors.XenError("LargeBlockIncorrectBlocksize", opterr="The logical blocksize of the device {} is compatible with normal SR types".format(dev))

try:
self._create_emulated_device()
Expand Down

0 comments on commit 5f92e4a

Please sign in to comment.