prl-xml.txt 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. = License =
  2. Copyright (c) 2015-2017, Virtuozzo, Inc.
  3. Authors:
  4. 2015 Denis Lunev <den@openvz.org>
  5. 2015 Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
  6. 2016-2017 Klim Kireev <klim.kireev@virtuozzo.com>
  7. 2016-2017 Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
  8. This work is licensed under the terms of the GNU GPL, version 2 or later.
  9. See the COPYING file in the top-level directory.
  10. This specification contains minimal information about Parallels Disk Format,
  11. which is enough to proper work with QEMU. Nevertheless, Parallels Cloud Server
  12. and Parallels Desktop are able to add some unspecified nodes to xml and use
  13. them, but they are for internal work and don't affect functionality. Also it
  14. uses auxiliary xml "Snapshot.xml", which allows to store optional snapshot
  15. information, but it doesn't influence open/read/write functionality. QEMU and
  16. other software should not use fields not covered in this document and
  17. Snapshot.xml file and must leave them as is.
  18. = Parallels Disk Format =
  19. Parallels disk consists of two parts: the set of snapshots and the disk
  20. descriptor file, which stores information about all files and snapshots.
  21. == Definitions ==
  22. Snapshot a record of the contents captured at a particular time,
  23. capable of storing current state. A snapshot has UUID and
  24. parent UUID.
  25. Snapshot image an overlay representing the difference between this
  26. snapshot and some earlier snapshot.
  27. Overlay an image storing the different sectors between two captured
  28. states.
  29. Root image snapshot image with no parent, the root of snapshot tree.
  30. Storage the backing storage for a subset of the virtual disk. When
  31. there is more than one storage in a Parallels disk then that
  32. is referred to as a split image. In this case every storage
  33. covers specific address space area of the disk and has its
  34. particular root image. Split images are not considered here
  35. and are not supported. Each storage consists of disk
  36. parameters and a list of images. The list of images always
  37. contains a root image and may also contain overlays. The
  38. root image can be an expandable Parallels image file or
  39. plain. Overlays must be expandable.
  40. Description DiskDescriptor.xml stores information about disk parameters,
  41. file snapshots, storages.
  42. Top The overlay between actual state and some previous snapshot.
  43. Snapshot It is not a snapshot in the classical sense because it
  44. serves as the active image that the guest writes to.
  45. Sector a 512-byte data chunk.
  46. == Description file ==
  47. All information is placed in a single XML element Parallels_disk_image.
  48. The element has only one attribute "Version", that must be 1.0.
  49. Schema of DiskDescriptor.xml:
  50. <Parallels_disk_image Version="1.0">
  51. <Disk_Parameters>
  52. ...
  53. </Disk_Parameters>
  54. <StorageData>
  55. ...
  56. </StorageData>
  57. <Snapshots>
  58. ...
  59. </Snapshots>
  60. </Parallels_disk_image>
  61. == Disk_Parameters element ==
  62. The Disk_Parameters element describes the physical layout of the virtual disk
  63. and some general settings.
  64. The Disk_Parameters element MUST contain the following child elements:
  65. * Disk_size - number of sectors in the disk,
  66. desired size of the disk.
  67. * Cylinders - number of the disk cylinders.
  68. * Heads - number of the disk heads.
  69. * Sectors - number of the disk sectors per cylinder
  70. (sector size is 512 bytes)
  71. Limitation: Product of the Heads, Sectors and Cylinders
  72. values MUST be equal to the value of the Disk_size parameter.
  73. * Padding - must be 0. Parallels Cloud Server and Parallels Desktop may
  74. use padding set to 1, however this case is not covered
  75. by this spec, QEMU and other software should not open
  76. such disks and should not create them.
  77. == StorageData element ==
  78. This element of the file describes the root image and all snapshot images.
  79. The StorageData element consists of the Storage child element, as shown below:
  80. <StorageData>
  81. <Storage>
  82. ...
  83. </Storage>
  84. </StorageData>
  85. A Storage element has following child elements:
  86. * Start - start sector of the storage, in case of non split storage
  87. equals to 0.
  88. * End - number of sector following the last sector, in case of non
  89. split storage equals to Disk_size.
  90. * Blocksize - storage cluster size, number of sectors per one cluster.
  91. Cluster size for each "Compressed" (see below) image in
  92. parallels disk must be equal to this field. Note: cluster
  93. size for Parallels Expandable Image is in 'tracks' field of
  94. its header (see docs/interop/parallels.txt).
  95. * Several Image child elements.
  96. Each Image element has following child elements:
  97. * GUID - image identifier, UUID in curly brackets.
  98. For instance, {12345678-9abc-def1-2345-6789abcdef12}.
  99. The GUID is used by the Snapshots element to reference images
  100. (see below)
  101. * Type - image type of the element. It can be:
  102. "Plain" for raw files.
  103. "Compressed" for expanding disks.
  104. * File - path to image file. Path can be relative to DiskDecriptor.xml or
  105. absolute.
  106. == Snapshots element ==
  107. The Snapshots element describes the snapshot relations with the snapshot tree.
  108. The element contains the set of Shot child elements, as shown below:
  109. <Snapshots>
  110. <TopGUID> ... </TopGUID> /* Optional child element */
  111. <Shot>
  112. ...
  113. </Shot>
  114. <Shot>
  115. ...
  116. </Shot>
  117. ...
  118. </Snapshots>
  119. Each Shot element contains the following child elements:
  120. * GUID - an image GUID.
  121. * ParentGUID - GUID of the image of the parent snapshot.
  122. The software may traverse snapshots from child to parent using <ParentGUID>
  123. field as reference. ParentGUID of root snapshot is
  124. {00000000-0000-0000-0000-000000000000}. There should be only one root
  125. snapshot. Top snapshot could be described via two ways: via TopGUID child
  126. element of the Snapshots element or via predefined GUID
  127. {5fbaabe3-6958-40ff-92a7-860e329aab41}. If TopGUID is defined, predefined GUID is
  128. interpreted as usual GUID. All snapshot images (except Top Snapshot) should be
  129. opened read-only. There is another predefined GUID,
  130. BackupID = {704718e1-2314-44c8-9087-d78ed36b0f4e}, which is used by original and
  131. some third-party software for backup, QEMU and other software may operate with
  132. images with GUID = BackupID as usual, however, it is not recommended to use this
  133. GUID for new disks. Top snapshot cannot have this GUID.