-
Notifications
You must be signed in to change notification settings - Fork 11
Improve VMDK #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: improve-vdi
Are you sure you want to change the base?
Improve VMDK #74
Conversation
…/test.vmcx,tests/_data/descriptor/vmx/encrypted.vmx,tests/_data/disk/asif/basic.asif.gz,tests/_data/disk/hdd/expanding.hdd/DiskDescriptor.xml,tests/_data/disk/hdd/expanding.hdd/expanding.hdd,tests/_data/disk/hdd/expanding.hdd/expanding.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz,tests/_data/disk/hdd/plain.hdd/DiskDescriptor.xml,tests/_data/disk/hdd/plain.hdd/plain.hdd,tests/_data/disk/hdd/plain.hdd/plain.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz,tests/_data/disk/hdd/split.hdd/DiskDescriptor.xml,tests/_data/disk/hdd/split.hdd/split.hdd,tests/_data/disk/hdd/split.hdd/split.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz,tests/_data/disk/hdd/split.hdd/split.hdd.1.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz,tests/_data/disk/hdd/split.hdd/split.hdd.2.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz,tests/_data/disk/hdd/split.hdd/split.hdd.3.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz,tests/_data/disk/hdd/split.hdd/split.hdd.4.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz,tests/_data/disk/hdd/split.hdd/split.hdd.5.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz,tests/_data/disk/qcow2/backing-chain-1.qcow2.gz,tests/_data/disk/qcow2/backing-chain-2.qcow2.gz,tests/_data/disk/qcow2/backing-chain-3.qcow2.gz,tests/_data/disk/qcow2/basic-zstd.qcow2.gz,tests/_data/disk/qcow2/basic.qcow2.gz,tests/_data/disk/qcow2/data-file.bin.gz,tests/_data/disk/qcow2/data-file.qcow2.gz,tests/_data/disk/qcow2/snapshot.qcow2.gz,tests/_data/disk/vdi/basic.vdi.gz,tests/_data/disk/vhd/dynamic.vhd.gz,tests/_data/disk/vhd/fixed.vhd.gz,tests/_data/disk/vhdx/differencing.avhdx.gz,tests/_data/disk/vhdx/dynamic.vhdx.gz,tests/_data/disk/vhdx/fixed.vhdx.gz,tests/_data/disk/vmdk/sesparse.vmdk.gz,tests/_data/util/envelope/encryption.info,tests/_data/util/envelope/local.tgz.ve,tests/_data/util/vmtar/test.vgz: convert to Git LFS
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #74 +/- ##
==========================================
+ Coverage 78.01% 82.86% +4.84%
==========================================
Files 26 26
Lines 2202 2206 +4
==========================================
+ Hits 1718 1828 +110
+ Misses 484 378 -106
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at benchmarking it yet, but this is what I found when testing the implementation
| if self.parent is not None: | ||
| self.parent.seek(offset) | ||
| buf = self.parent.read(read_size) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When parent is a VMDK object, it does not have the seek and read anymore as VMDK is not a stream. This situation occurs when the VMDK object sets its parent with open_parent on L80, L95
| self.descriptor = None | ||
| self._disk_offsets = [] | ||
| self.sector_count = 0 | ||
| class VMDK: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an idea to add a __repr__ to make it easier to debug?
|
|
||
| return self.read_sectors(sector, count) | ||
|
|
||
| class Extent: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and a __repr__ for this one
44153f2 to
809f272
Compare
Closes #58
Based on #72 for convenience.
TODO:
This implementation aims to be a little simpler than the previous one, but we should be wary for performance degradation.