diff --git a/tests/qemu-iotests/164 b/tests/qemu-iotests/164
new file mode 100755
index 0000000000..a55ab5d7d8
--- /dev/null
+++ b/tests/qemu-iotests/164
@@ -0,0 +1,98 @@
+#!/bin/bash
+#
+# prl-xml format validation test
+#
+# Copyright (C) 2017 Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+# creator
+owner=edgar.kaziakhmedov@virtuozzo.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+status=1	# failure is the default!
+
+_cleanup()
+{
+    _rm_test_img "$TEST_DIR/$PRL_XML_DIR/$CUR_IMAGE"
+    _rm_test_img "$TEST_DIR/$PRL_XML_DIR/$BACK_IMAGE"
+    _rm_test_img "$TEST_DIR/$PRL_XML_DIR/$SNAP_LIST"
+    _cleanup_test_img
+    rmdir "$TEST_DIR/$PRL_XML_DIR"
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_supported_fmt prl-xml
+_supported_proto file
+_supported_os Linux
+
+inuse_offset=$((0x2c))
+
+PRL_XML_DIR="prl-xml"
+mkdir "$TEST_DIR/$PRL_XML_DIR"
+CUR_IMAGE="parallels.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds"
+BACK_IMAGE="parallels.{986476cf-d62e-45d1-b355-86feca91376e}.hds"
+SNAP_LIST="Snapshots.xml"
+XML_IMG="DiskDescriptor.xml"
+size=128M
+CLUSTER_SIZE=64k
+IMGFMT=prl-xml
+_use_sample_img "$PRL_XML_DIR/$CUR_IMAGE.bz2"
+_use_sample_img "$PRL_XML_DIR/$BACK_IMAGE.bz2"
+_use_sample_img "$PRL_XML_DIR/$SNAP_LIST.bz2"
+_use_sample_img "$PRL_XML_DIR/$XML_IMG.bz2"
+
+echo == read empty image ==
+{ $QEMU_IO -c "read -P 0 32k 64k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == write more than 1 block in a row ==
+{ $QEMU_IO -c "write -P 0x11 32k 128k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == read less than block ==
+{ $QEMU_IO -c "read -P 0x69 32k 32k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == read exactly 1 block ==
+{ $QEMU_IO -c "read -P 0x69 64k 64k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == read more than 1 block ==
+{ $QEMU_IO -c "read -P 0x69 32k 128k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == check that there is no trash after written ==
+{ $QEMU_IO -c "read -P 0 160k 32k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == check that there is no trash before written ==
+{ $QEMU_IO -c "read -P 0 0 32k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == write the whole disk ==
+{ $QEMU_IO -c "write -P 0x45 0 2M" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == read the whole disk ==
+{ $QEMU_IO -c "read -P 0x45 0 2M" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == check that there is error while write out of range ==
+{ $QEMU_IO -c "write -P 0 2M 32k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+echo == check that there is error while disk size is less than data written ==
+{ $QEMU_IO -c "write -P 0x45 0 3M" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+
+echo "== Corrupt image =="
+poke_file "$TEST_DIR/$PRL_XML_DIR/$CUR_IMAGE" "$inuse_offset" "\x59\x6e\x6f\x74"
+{ $QEMU_IO -c "read -P 0x11 64k 64k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+# as it is a block filter, we change driver format
+_check_test_img
+_check_test_img -r all
+{ $QEMU_IO -c "read -P 0x11 64k 64k" "$TEST_IMG"; } 2>&1 | _filter_qemu_io | _filter_testdir
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/164.out b/tests/qemu-iotests/164.out
new file mode 100644
index 0000000000..777c0c2c1c
--- /dev/null
+++ b/tests/qemu-iotests/164.out
@@ -0,0 +1,54 @@
+QA output created by 164
+== read empty image ==
+read 65536/65536 bytes at offset 32768
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== write more than 1 block in a row ==
+wrote 131072/131072 bytes at offset 32768
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== read less than block ==
+Pattern verification failed at offset 32768, 32768 bytes
+read 32768/32768 bytes at offset 32768
+32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== read exactly 1 block ==
+Pattern verification failed at offset 65536, 65536 bytes
+read 65536/65536 bytes at offset 65536
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== read more than 1 block ==
+Pattern verification failed at offset 32768, 131072 bytes
+read 131072/131072 bytes at offset 32768
+128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== check that there is no trash after written ==
+read 32768/32768 bytes at offset 163840
+32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== check that there is no trash before written ==
+read 32768/32768 bytes at offset 0
+32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== write the whole disk ==
+wrote 2097152/2097152 bytes at offset 0
+2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== read the whole disk ==
+read 2097152/2097152 bytes at offset 0
+2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+== check that there is error while write out of range ==
+write failed: Input/output error
+== check that there is error while disk size is less than data written ==
+write failed: Input/output error
+== Corrupt image ==
+can't open device TEST_DIR/prl-xml/DiskDescriptor.xml: parallels: Image was not closed correctly; cannot be opened read/write
+Can't open top image
+ERROR image was not closed correctly
+
+1 errors were found on the image.
+Data may be corrupted, or further writes to the image may corrupt it.
+Repairing image was not closed correctly
+The following inconsistencies were found and repaired:
+
+    0 leaked clusters
+    1 corruptions
+
+Double checking the fixed image now...
+No errors were found on the image.
+Pattern verification failed at offset 65536, 65536 bytes
+read 65536/65536 bytes at offset 65536
+64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+*** done
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index e6b6ff7a04..0a87c8d840 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -229,6 +229,7 @@ image format options
     -bochs              test bochs
     -cloop              test cloop
     -parallels          test parallels
+    -prl-xml            test prl-xml
     -qcow               test qcow
     -qcow2              test qcow2
     -qed                test qed
@@ -288,6 +289,12 @@ testlist options
             xpand=false
             ;;
 
+        -prl-xml)
+            IMGFMT=prl-xml
+            IMGFMT_GENERIC=false
+            xpand=false
+            ;;
+
         -qcow)
             IMGFMT=qcow
             xpand=false
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index a2dfe79d86..d22853fed6 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -168,6 +168,7 @@
 160 rw auto quick
 162 auto quick
 163 rw auto quick
+164 rw auto quick
 165 rw auto quick
 170 rw auto quick
 171 rw auto quick
diff --git a/tests/qemu-iotests/sample_images/prl-xml/DiskDescriptor.xml.bz2 b/tests/qemu-iotests/sample_images/prl-xml/DiskDescriptor.xml.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..08dad3b4a9c980e931bc0b1d128bf931754a0730
GIT binary patch
diff --git a/tests/qemu-iotests/sample_images/prl-xml/Snapshots.xml.bz2 b/tests/qemu-iotests/sample_images/prl-xml/Snapshots.xml.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..b5d80ae94d4500b1b19f3439dc5e953383797c6f
GIT binary patch
diff --git a/tests/qemu-iotests/sample_images/prl-xml/parallels.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.bz2 b/tests/qemu-iotests/sample_images/prl-xml/parallels.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..174c8ba055fc1a24b91f179670fd15b53e00efdd
GIT binary patch
diff --git a/tests/qemu-iotests/sample_images/prl-xml/parallels.{986476cf-d62e-45d1-b355-86feca91376e}.hds.bz2 b/tests/qemu-iotests/sample_images/prl-xml/parallels.{986476cf-d62e-45d1-b355-86feca91376e}.hds.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..174c8ba055fc1a24b91f179670fd15b53e00efdd
