1QA output created by qcow2-internal-snapshots 2Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 3 4=== Write some data, take a snapshot and overwrite part of it === 5 6QEMU X.Y.Z monitor - type 'help' for more information 7(qemu) qemu-io disk0 "write -P0x11 0 1M" 8wrote 1048576/1048576 bytes at offset 0 91 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 10(qemu) savevm snap0 11(qemu) qemu-io disk0 "write -P0x22 0 512k" 12wrote 524288/524288 bytes at offset 0 13512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 14(qemu) quit 15 16Snapshot list: 17ID TAG VM_SIZE DATE VM_CLOCK ICOUNT 181 snap0 SIZE yyyy-mm-dd hh:mm:ss 0000:00:00.000 -- 19No errors were found on the image. 20 21=== Verify that loading the snapshot reverts to the old content === 22 23QEMU X.Y.Z monitor - type 'help' for more information 24(qemu) qemu-io disk0 "read -P0x11 0 1M" 25read 1048576/1048576 bytes at offset 0 261 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 27(qemu) qemu-io disk0 "write -P0x33 512k 512k" 28wrote 524288/524288 bytes at offset 524288 29512 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 30(qemu) loadvm snap0 31(qemu) qemu-io disk0 "read -P0x11 0 1M" 32read 1048576/1048576 bytes at offset 0 331 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 34(qemu) qemu-io disk0 "write -P0x33 63k 2k" 35wrote 2048/2048 bytes at offset 64512 362 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 37(qemu) qemu-io disk0 "read -P0x11 0 63k" 38read 64512/64512 bytes at offset 0 3963 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 40(qemu) qemu-io disk0 "read -P0x33 63k 2k" 41read 2048/2048 bytes at offset 64512 422 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 43(qemu) qemu-io disk0 "read -P0x11 65k 63k" 44read 64512/64512 bytes at offset 66560 4563 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 46(qemu) savevm snap1 47(qemu) quit 48 49Snapshot list: 50ID TAG VM_SIZE DATE VM_CLOCK ICOUNT 511 snap0 SIZE yyyy-mm-dd hh:mm:ss 0000:00:00.000 -- 522 snap1 SIZE yyyy-mm-dd hh:mm:ss 0000:00:00.000 -- 53No errors were found on the image. 54 55=== qemu-img snapshot can revert to snapshots === 56 57read 1048576/1048576 bytes at offset 0 581 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 59read 64512/64512 bytes at offset 0 6063 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 61read 2048/2048 bytes at offset 64512 622 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 63read 64512/64512 bytes at offset 66560 6463 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 65 66=== Deleting snapshots === 67 68QEMU X.Y.Z monitor - type 'help' for more information 69(qemu) delvm snap1 70(qemu) qemu-io disk0 "read -P0x11 0 63k" 71read 64512/64512 bytes at offset 0 7263 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 73(qemu) qemu-io disk0 "read -P0x33 63k 2k" 74read 2048/2048 bytes at offset 64512 752 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 76(qemu) qemu-io disk0 "read -P0x11 65k 63k" 77read 64512/64512 bytes at offset 66560 7863 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) 79(qemu) quit 80 81Snapshot list: 82ID TAG VM_SIZE DATE VM_CLOCK ICOUNT 831 snap0 SIZE yyyy-mm-dd hh:mm:ss 0000:00:00.000 -- 84No errors were found on the image. 85 86=== Error cases === 87 88QEMU X.Y.Z monitor - type 'help' for more information 89(qemu) QEMU_PROG: Snapshot 'snap1' does not exist in one or more devices 90 91QEMU X.Y.Z monitor - type 'help' for more information 92(qemu) loadvm snap1 93Error: Snapshot 'snap1' does not exist in one or more devices 94(qemu) quit 95 96QEMU_PROG: 'incoming' and 'loadvm' options are mutually exclusive 97QEMU X.Y.Z monitor - type 'help' for more information 98(qemu) loadvm snap0 99Error: Device 'disk0' is writable but does not support snapshots 100(qemu) delvm snap0 101Error: Device 'disk0' is writable but does not support snapshots 102(qemu) savevm snap1 103Error: Device 'disk0' is writable but does not support snapshots 104(qemu) quit 105 106QEMU_PROG: 'preconfig' and 'loadvm' options are mutually exclusive 107*** done 108