dissect.hypervisor 3.22.dev3__tar.gz → 3.22.dev5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/PKG-INFO +1 -1
  2. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/vdi.py +1 -1
  3. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/util/vmtar.py +21 -6
  4. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect.hypervisor.egg-info/PKG-INFO +1 -1
  5. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/_docs/Makefile +1 -1
  6. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/_docs/conf.py +5 -1
  7. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/util/test_vmtar.py +1 -0
  8. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/.git-blame-ignore-revs +0 -0
  9. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/COPYRIGHT +0 -0
  10. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/LICENSE +0 -0
  11. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/MANIFEST.in +0 -0
  12. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/README.md +0 -0
  13. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/__init__.py +0 -0
  14. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/descriptor/__init__.py +0 -0
  15. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/descriptor/c_hyperv.py +0 -0
  16. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/descriptor/hyperv.py +0 -0
  17. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/descriptor/ovf.py +0 -0
  18. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/descriptor/pvs.py +0 -0
  19. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/descriptor/vbox.py +0 -0
  20. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/descriptor/vmx.py +0 -0
  21. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/__init__.py +0 -0
  22. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/asif.py +0 -0
  23. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_asif.py +0 -0
  24. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_asif.pyi +0 -0
  25. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_hdd.py +0 -0
  26. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_qcow2.py +0 -0
  27. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_qcow2.pyi +0 -0
  28. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_vdi.py +0 -0
  29. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_vdi.pyi +0 -0
  30. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_vhd.py +0 -0
  31. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_vhdx.py +0 -0
  32. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/c_vmdk.py +0 -0
  33. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/hdd.py +0 -0
  34. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/qcow2.py +0 -0
  35. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/vhd.py +0 -0
  36. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/vhdx.py +0 -0
  37. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/disk/vmdk.py +0 -0
  38. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/exceptions.py +0 -0
  39. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/tools/__init__.py +0 -0
  40. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/tools/envelope.py +0 -0
  41. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/tools/vmtar.py +0 -0
  42. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/util/__init__.py +0 -0
  43. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect/hypervisor/util/envelope.py +0 -0
  44. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect.hypervisor.egg-info/SOURCES.txt +0 -0
  45. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect.hypervisor.egg-info/dependency_links.txt +0 -0
  46. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect.hypervisor.egg-info/entry_points.txt +0 -0
  47. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect.hypervisor.egg-info/requires.txt +0 -0
  48. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/dissect.hypervisor.egg-info/top_level.txt +0 -0
  49. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/pyproject.toml +0 -0
  50. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/setup.cfg +0 -0
  51. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/__init__.py +0 -0
  52. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/_docs/index.rst +0 -0
  53. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/_tools/disk/vdi/generate.sh +0 -0
  54. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/_util.py +0 -0
  55. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/descriptor/__init__.py +0 -0
  56. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/descriptor/test_hyperv.py +0 -0
  57. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/descriptor/test_ovf.py +0 -0
  58. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/descriptor/test_pvs.py +0 -0
  59. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/descriptor/test_vbox.py +0 -0
  60. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/descriptor/test_vmx.py +0 -0
  61. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/disk/__init__.py +0 -0
  62. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/disk/test_asif.py +0 -0
  63. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/disk/test_hdd.py +0 -0
  64. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/disk/test_qcow2.py +0 -0
  65. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/disk/test_vdi.py +0 -0
  66. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/disk/test_vhd.py +0 -0
  67. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/disk/test_vhdx.py +0 -0
  68. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/disk/test_vmdk.py +0 -0
  69. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/util/__init__.py +0 -0
  70. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tests/util/test_envelope.py +0 -0
  71. {dissect_hypervisor-3.22.dev3 → dissect_hypervisor-3.22.dev5}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.hypervisor
3
- Version: 3.22.dev3
3
+ Version: 3.22.dev5
4
4
  Summary: A Dissect module implementing parsers for various hypervisor disk, backup and configuration files
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -18,7 +18,7 @@ if TYPE_CHECKING:
18
18
  class VDI:
19
19
  """VirtualBox Virtual Disk Image (VDI) implementation.
20
20
 
21
- Use :method:`open` to get a stream for reading from the VDI file. The stream will handle reading
21
+ Use :meth:`open` to get a stream for reading from the VDI file. The stream will handle reading
22
22
  from the parent disk if necessary (and provided).
23
23
 
24
24
  If provided with a file-like object, the caller is responsible for closing it.
@@ -22,9 +22,8 @@ class VisorTarInfo(tarfile.TarInfo):
22
22
  fixUpPgs: int | None
23
23
 
24
24
  @classmethod
25
- def frombuf(cls, buf: bytes, encoding: str, errors: str) -> VisorTarInfo:
26
- obj = super().frombuf(buf, encoding, errors)
27
-
25
+ def _init_visor_attrs(cls, obj: VisorTarInfo, buf: bytes) -> None:
26
+ """Initialize visor-specific attributes from the raw header buffer."""
28
27
  obj.is_visor = buf[257:264] == b"visor "
29
28
  if obj.is_visor:
30
29
  obj.offset_data = struct.unpack("<I", buf[496:500])[0]
@@ -35,6 +34,19 @@ class VisorTarInfo(tarfile.TarInfo):
35
34
  obj.textPgs = None
36
35
  obj.fixUpPgs = None
37
36
 
37
+ @classmethod
38
+ def frombuf(cls, buf: bytes, encoding: str, errors: str) -> VisorTarInfo:
39
+ obj = super().frombuf(buf, encoding, errors)
40
+ cls._init_visor_attrs(obj, buf)
41
+ return obj
42
+
43
+ @classmethod
44
+ def _frombuf(cls, buf: bytes, encoding: str, errors: str, **kwargs) -> VisorTarInfo:
45
+ # Python 3.13.13+ refactored tarfile to call _frombuf directly instead of
46
+ # frombuf in fromtarfile and _proc_gnulong/_proc_pax. We must override _frombuf
47
+ # to ensure visor-specific attributes are initialized for all code paths.
48
+ obj = super()._frombuf(buf, encoding, errors, **kwargs)
49
+ cls._init_visor_attrs(obj, buf)
38
50
  return obj
39
51
 
40
52
  def _proc_member(self, tarfile: tarfile.TarFile) -> VisorTarInfo | tarfile.TarInfo:
@@ -76,6 +88,8 @@ class VisorTarFile(tarfile.TarFile):
76
88
  try:
77
89
  t = cls.taropen(name, mode, fileobj, **kwargs)
78
90
  except Exception:
91
+ if fileobj is not None:
92
+ fileobj.seek(0)
79
93
  try:
80
94
  fileobj = GzipFile(name, mode + "b", fileobj=fileobj)
81
95
  except OSError as e:
@@ -103,10 +117,11 @@ class VisorTarFile(tarfile.TarFile):
103
117
  compressed = True
104
118
 
105
119
  # If we get here, we have a valid visor tar file
106
- if fileobj is not None and compressed:
107
- # Just read the entire file into memory, it's probably small
120
+ if fileobj is not None:
108
121
  fileobj.seek(0)
109
- fileobj = BytesIO(fileobj.read())
122
+ if compressed:
123
+ # Read the decompressed data into a BytesIO to make random reads faster
124
+ fileobj = BytesIO(fileobj.read())
110
125
 
111
126
  t = cls.taropen(name, mode, fileobj, **kwargs)
112
127
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.hypervisor
3
- Version: 3.22.dev3
3
+ Version: 3.22.dev5
4
4
  Summary: A Dissect module implementing parsers for various hypervisor disk, backup and configuration files
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -3,7 +3,7 @@
3
3
 
4
4
  # You can set these variables from the command line, and also
5
5
  # from the environment for the first two.
6
- SPHINXOPTS ?= -jauto
6
+ SPHINXOPTS ?= -jauto -w $(BUILDDIR)/warnings.log --fail-on-warning
7
7
  SPHINXBUILD ?= sphinx-build
8
8
  SOURCEDIR = .
9
9
  BUILDDIR = build
@@ -27,7 +27,6 @@ autoapi_options = [
27
27
  "show-inheritance",
28
28
  "show-module-summary",
29
29
  "special-members",
30
- "imported-members",
31
30
  ]
32
31
  autoapi_keep_files = True
33
32
  autoapi_template_dir = "_templates/autoapi"
@@ -36,3 +35,8 @@ autodoc_typehints = "signature"
36
35
  autodoc_member_order = "groupwise"
37
36
 
38
37
  autosectionlabel_prefix_document = True
38
+
39
+ suppress_warnings = [
40
+ # https://github.com/readthedocs/sphinx-autoapi/issues/285
41
+ "autoapi.python_import_resolution",
42
+ ]
@@ -21,6 +21,7 @@ def test_vmtar() -> None:
21
21
  # The test file has no textPgs/fixUpPgs
22
22
  assert all(member.is_visor for member in members.values())
23
23
  assert set(members.keys()) == {
24
+ "test",
24
25
  "test/file1",
25
26
  "test/file2",
26
27
  "test/file3",