dissect.hypervisor 3.20.dev2__tar.gz → 3.21.dev2__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 (103) hide show
  1. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/PKG-INFO +2 -1
  2. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/qcow2.py +6 -12
  3. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/vmdk.py +1 -1
  4. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect.hypervisor.egg-info/PKG-INFO +2 -1
  5. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect.hypervisor.egg-info/SOURCES.txt +1 -0
  6. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect.hypervisor.egg-info/requires.txt +3 -0
  7. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/pyproject.toml +1 -0
  8. dissect_hypervisor-3.21.dev2/tests/_data/disk/qcow2/basic-zstd.qcow2.gz +0 -0
  9. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/conftest.py +5 -0
  10. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/disk/test_qcow2.py +3 -2
  11. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/.git-blame-ignore-revs +0 -0
  12. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/COPYRIGHT +0 -0
  13. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/LICENSE +0 -0
  14. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/MANIFEST.in +0 -0
  15. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/README.md +0 -0
  16. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/__init__.py +0 -0
  17. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/descriptor/__init__.py +0 -0
  18. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/descriptor/c_hyperv.py +0 -0
  19. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/descriptor/hyperv.py +0 -0
  20. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/descriptor/ovf.py +0 -0
  21. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/descriptor/pvs.py +0 -0
  22. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/descriptor/vbox.py +0 -0
  23. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/descriptor/vmx.py +0 -0
  24. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/__init__.py +0 -0
  25. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/asif.py +0 -0
  26. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/c_asif.py +0 -0
  27. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/c_asif.pyi +0 -0
  28. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/c_hdd.py +0 -0
  29. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/c_qcow2.py +0 -0
  30. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/c_qcow2.pyi +0 -0
  31. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/c_vdi.py +0 -0
  32. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/c_vhd.py +0 -0
  33. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/c_vhdx.py +0 -0
  34. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/c_vmdk.py +0 -0
  35. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/hdd.py +0 -0
  36. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/vdi.py +0 -0
  37. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/vhd.py +0 -0
  38. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/disk/vhdx.py +0 -0
  39. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/exceptions.py +0 -0
  40. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/tools/__init__.py +0 -0
  41. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/tools/envelope.py +0 -0
  42. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/tools/vmtar.py +0 -0
  43. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/util/__init__.py +0 -0
  44. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/util/envelope.py +0 -0
  45. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect/hypervisor/util/vmtar.py +0 -0
  46. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect.hypervisor.egg-info/dependency_links.txt +0 -0
  47. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect.hypervisor.egg-info/entry_points.txt +0 -0
  48. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/dissect.hypervisor.egg-info/top_level.txt +0 -0
  49. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/setup.cfg +0 -0
  50. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/__init__.py +0 -0
  51. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/descriptor/hyperv/test.VMRS +0 -0
  52. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/descriptor/hyperv/test.vmcx +0 -0
  53. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/descriptor/vmx/encrypted.vmx +0 -0
  54. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/asif/basic.asif.gz +0 -0
  55. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/expanding.hdd/DiskDescriptor.xml +0 -0
  56. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/expanding.hdd/expanding.hdd +0 -0
  57. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/expanding.hdd/expanding.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  58. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/plain.hdd/DiskDescriptor.xml +0 -0
  59. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/plain.hdd/plain.hdd +0 -0
  60. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/plain.hdd/plain.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  61. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/split.hdd/DiskDescriptor.xml +0 -0
  62. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/split.hdd/split.hdd +0 -0
  63. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/split.hdd/split.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  64. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/split.hdd/split.hdd.1.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  65. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/split.hdd/split.hdd.2.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  66. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/split.hdd/split.hdd.3.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  67. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/split.hdd/split.hdd.4.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  68. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/hdd/split.hdd/split.hdd.5.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  69. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/qcow2/backing-chain-1.qcow2.gz +0 -0
  70. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/qcow2/backing-chain-2.qcow2.gz +0 -0
  71. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/qcow2/backing-chain-3.qcow2.gz +0 -0
  72. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/qcow2/basic.qcow2.gz +0 -0
  73. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/qcow2/data-file.bin.gz +0 -0
  74. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/qcow2/data-file.qcow2.gz +0 -0
  75. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/qcow2/snapshot.qcow2.gz +0 -0
  76. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/vhd/dynamic.vhd.gz +0 -0
  77. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/vhd/fixed.vhd.gz +0 -0
  78. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/vhdx/differencing.avhdx.gz +0 -0
  79. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/vhdx/dynamic.vhdx.gz +0 -0
  80. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/vhdx/fixed.vhdx.gz +0 -0
  81. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/disk/vmdk/sesparse.vmdk.gz +0 -0
  82. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/util/envelope/encryption.info +0 -0
  83. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/util/envelope/local.tgz.ve +0 -0
  84. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_data/util/vmtar/test.vgz +0 -0
  85. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_docs/Makefile +0 -0
  86. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_docs/conf.py +0 -0
  87. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/_docs/index.rst +0 -0
  88. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/descriptor/__init__.py +0 -0
  89. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/descriptor/test_hyperv.py +0 -0
  90. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/descriptor/test_ovf.py +0 -0
  91. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/descriptor/test_pvs.py +0 -0
  92. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/descriptor/test_vbox.py +0 -0
  93. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/descriptor/test_vmx.py +0 -0
  94. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/disk/__init__.py +0 -0
  95. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/disk/test_asif.py +0 -0
  96. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/disk/test_hdd.py +0 -0
  97. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/disk/test_vhd.py +0 -0
  98. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/disk/test_vhdx.py +0 -0
  99. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/disk/test_vmdk.py +0 -0
  100. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/util/__init__.py +0 -0
  101. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/util/test_envelope.py +0 -0
  102. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tests/util/test_vmtar.py +0 -0
  103. {dissect_hypervisor-3.20.dev2 → dissect_hypervisor-3.21.dev2}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.hypervisor
3
- Version: 3.20.dev2
3
+ Version: 3.21.dev2
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
@@ -26,6 +26,7 @@ Requires-Dist: dissect.cstruct<5,>=4
26
26
  Requires-Dist: dissect.util<4,>=3
27
27
  Provides-Extra: full
28
28
  Requires-Dist: pycryptodome; extra == "full"
29
+ Requires-Dist: backports.zstd; python_version < "3.14" and extra == "full"
29
30
  Provides-Extra: dev
30
31
  Requires-Dist: dissect.hypervisor[full]; extra == "dev"
31
32
  Requires-Dist: dissect.cstruct<5.0.dev,>=4.0.dev; extra == "dev"
@@ -3,9 +3,9 @@
3
3
  # - https://github.com/qemu/qemu/blob/master/docs/interop/qcow2.txt
4
4
  from __future__ import annotations
5
5
 
6
+ import sys
6
7
  import zlib
7
8
  from functools import cached_property, lru_cache
8
- from io import BytesIO
9
9
  from pathlib import Path
10
10
  from typing import TYPE_CHECKING, BinaryIO
11
11
 
@@ -28,8 +28,10 @@ if TYPE_CHECKING:
28
28
  from collections.abc import Iterator
29
29
 
30
30
  try:
31
- import zstandard as zstd
32
-
31
+ if sys.version_info >= (3, 14):
32
+ from compression import zstd # novermin
33
+ else:
34
+ from backports import zstd
33
35
  HAS_ZSTD = True
34
36
  except ImportError:
35
37
  HAS_ZSTD = False
@@ -384,16 +386,8 @@ class QCow2Stream(AlignedStream):
384
386
  return dctx.decompress(buf, self.qcow2.cluster_size)
385
387
 
386
388
  if self.qcow2.compression_type == c_qcow2.QCOW2_COMPRESSION_TYPE_ZSTD:
387
- result = []
388
-
389
389
  dctx = zstd.ZstdDecompressor()
390
- reader = dctx.stream_reader(BytesIO(buf))
391
- while reader.tell() < self.qcow2.cluster_size:
392
- chunk = reader.read(self.qcow2.cluster_size - reader.tell())
393
- if not chunk:
394
- break
395
- result.append(chunk)
396
- return b"".join(result)
390
+ return dctx.decompress(buf, self.qcow2.cluster_size)
397
391
 
398
392
  raise Error(f"Invalid compression type: {self.qcow2.compression_type}")
399
393
 
@@ -407,7 +407,7 @@ RE_EXTENT_DESCRIPTOR = re.compile(
407
407
  ^
408
408
  (?P<access_mode>RW|RDONLY|NOACCESS)\s
409
409
  (?P<sectors>\d+)\s
410
- (?P<type>SPARSE|ZERO|FLAT|VMFS|VMFSSPARSE|VMFSRDM|VMFSRAW)
410
+ (?P<type>SESPARSE|SPARSE|ZERO|FLAT|VMFS|VMFSSPARSE|VMFSRDM|VMFSRAW)
411
411
  (\s(?P<filename>\".+\"))?
412
412
  (\s(?P<start_sector>\d+))?
413
413
  (\s(?P<partition_uuid>\S+))?
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.hypervisor
3
- Version: 3.20.dev2
3
+ Version: 3.21.dev2
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
@@ -26,6 +26,7 @@ Requires-Dist: dissect.cstruct<5,>=4
26
26
  Requires-Dist: dissect.util<4,>=3
27
27
  Provides-Extra: full
28
28
  Requires-Dist: pycryptodome; extra == "full"
29
+ Requires-Dist: backports.zstd; python_version < "3.14" and extra == "full"
29
30
  Provides-Extra: dev
30
31
  Requires-Dist: dissect.hypervisor[full]; extra == "dev"
31
32
  Requires-Dist: dissect.cstruct<5.0.dev,>=4.0.dev; extra == "dev"
@@ -66,6 +66,7 @@ tests/_data/disk/hdd/split.hdd/split.hdd.5.{5fbaabe3-6958-40ff-92a7-860e329aab41
66
66
  tests/_data/disk/qcow2/backing-chain-1.qcow2.gz
67
67
  tests/_data/disk/qcow2/backing-chain-2.qcow2.gz
68
68
  tests/_data/disk/qcow2/backing-chain-3.qcow2.gz
69
+ tests/_data/disk/qcow2/basic-zstd.qcow2.gz
69
70
  tests/_data/disk/qcow2/basic.qcow2.gz
70
71
  tests/_data/disk/qcow2/data-file.bin.gz
71
72
  tests/_data/disk/qcow2/data-file.qcow2.gz
@@ -9,3 +9,6 @@ dissect.util<4.0.dev,>=3.0.dev
9
9
 
10
10
  [full]
11
11
  pycryptodome
12
+
13
+ [full:python_version < "3.14"]
14
+ backports.zstd
@@ -39,6 +39,7 @@ repository = "https://github.com/fox-it/dissect.hypervisor"
39
39
  [project.optional-dependencies]
40
40
  full = [
41
41
  "pycryptodome",
42
+ "backports.zstd; python_version < '3.14'",
42
43
  ]
43
44
  dev = [
44
45
  "dissect.hypervisor[full]",
@@ -89,6 +89,11 @@ def basic_qcow2() -> Iterator[BinaryIO]:
89
89
  yield from open_file_gz("_data/disk/qcow2/basic.qcow2.gz")
90
90
 
91
91
 
92
+ @pytest.fixture
93
+ def basic_zstd_qcow2() -> Iterator[BinaryIO]:
94
+ yield from open_file_gz("_data/disk/qcow2/basic-zstd.qcow2.gz")
95
+
96
+
92
97
  @pytest.fixture
93
98
  def data_file_qcow2() -> Path:
94
99
  return absolute_path("_data/disk/qcow2/data-file.qcow2.gz")
@@ -16,8 +16,9 @@ def mock_open_gz(self: Path, *args, **kwargs) -> BinaryIO:
16
16
  return gzip.open(self if self.suffix.lower() == ".gz" else self.with_suffix(self.suffix + ".gz"))
17
17
 
18
18
 
19
- def test_basic(basic_qcow2: BinaryIO) -> None:
20
- qcow2 = QCow2(basic_qcow2)
19
+ @pytest.mark.parametrize("name", ["basic_qcow2", "basic_zstd_qcow2"])
20
+ def test_basic(name: str, request: pytest.FixtureRequest) -> None:
21
+ qcow2 = QCow2(request.getfixturevalue(name))
21
22
 
22
23
  assert qcow2.backing_file is None
23
24
  assert qcow2.data_file is qcow2.fh