Skip to content

Commit

Permalink
feat(LargeBlock): Remove some useless function
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Thenot <[email protected]>
  • Loading branch information
Nambrok committed Feb 22, 2024
1 parent fcfcb92 commit f69ebe4
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions drivers/LargeBlockSR.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ class LargeBlockSR(EXTSR.EXTSR):
def handles(srtype):
return srtype == LargeBlockSR.DRIVER_TYPE

def load(self, sr_uuid):
super(LargeBlockSR, self).load(sr_uuid)

def delete(self, sr_uuid):
super(LargeBlockSR, self).delete(sr_uuid)

def attach(self, sr_uuid):
self.override_device()
super(LargeBlockSR, self).attach(sr_uuid)
Expand All @@ -68,20 +62,13 @@ def detach(self, sr_uuid):
super(LargeBlockSR, self).detach(sr_uuid)
self.remove_device()

@deviceCheck
def probe(self):
return super(LargeBlockSR, self).probe()

@deviceCheck
def create(self, sr_uuid, size):
#TODO: Need to check blocksize of the device before accepting to create a SR.
self.override_device()
super(LargeBlockSR, self).create(sr_uuid, size)
self.remove_device()

def vdi(self, uuid):
return LargeFileVDI(self, uuid)

def create_loopdev(self, dev, new_path):
cmd = ["losetup", "-f", "-v", "--show", "--sector-size", str(self.SECTOR_SIZE), dev]
self.loopdev = util.pread2(cmd).rstrip()
Expand Down Expand Up @@ -130,10 +117,6 @@ def remove_device(self):
new_path = self.get_new_path(dev)
self.delete_loopdev(dev, new_path)

class LargeFileVDI(EXTSR.EXTFileVDI):
def attach(self, sr_uuid, vdi_uuid):
return super(LargeFileVDI, self).attach(sr_uuid, vdi_uuid)

if __name__ == '__main__':
SRCommand.run(LargeBlockSR, DRIVER_INFO)
else:
Expand Down

0 comments on commit f69ebe4

Please sign in to comment.