mirror of
https://github.com/qemu/qemu.git
synced 2024-12-14 15:03:33 +08:00
7be2025258
Now that the implementation of subclusters is complete we can finally add the necessary options to create and read images with this feature, which we call "extended L2 entries". Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <6476caaa73216bd05b7bb2d504a20415e1665176.1594396418.git.berto@igalia.com> [mreitz: %s/5\.1/5.2/; fixed 302's and 303's reference output] Signed-off-by: Max Reitz <mreitz@redhat.com>
177 lines
3.9 KiB
Plaintext
177 lines
3.9 KiB
Plaintext
Test 1
|
|
{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "granularity": 16384, "name": "bitmap-0", "node": "drive0", "persistent": false}}
|
|
{"return": {}}
|
|
wrote 262144/262144 bytes at offset 0
|
|
256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
|
qemu-img info dump:
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 1 MiB (1048576 bytes)
|
|
cluster_size: 65536
|
|
Format specific information:
|
|
compat: 1.1
|
|
compression type: zlib
|
|
lazy refcounts: false
|
|
refcount bits: 16
|
|
corrupt: false
|
|
extended l2: false
|
|
|
|
No bitmap in JSON format output
|
|
|
|
Test 2
|
|
{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": true, "granularity": 32768, "name": "bitmap-1", "node": "drive0", "persistent": true}}
|
|
{"return": {}}
|
|
wrote 262144/262144 bytes at offset 262144
|
|
256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
|
qemu-img info dump:
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 1 MiB (1048576 bytes)
|
|
cluster_size: 65536
|
|
Format specific information:
|
|
compat: 1.1
|
|
compression type: zlib
|
|
lazy refcounts: false
|
|
bitmaps:
|
|
[0]:
|
|
flags:
|
|
name: bitmap-1
|
|
granularity: 32768
|
|
refcount bits: 16
|
|
corrupt: false
|
|
extended l2: false
|
|
|
|
The same bitmaps in JSON format:
|
|
[
|
|
{
|
|
"flags": [],
|
|
"granularity": 32768,
|
|
"name": "bitmap-1"
|
|
}
|
|
]
|
|
|
|
Test 3
|
|
{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "granularity": 65536, "name": "bitmap-2", "node": "drive0", "persistent": true}}
|
|
{"return": {}}
|
|
wrote 262144/262144 bytes at offset 524288
|
|
256 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
|
|
|
qemu-img info dump:
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 1 MiB (1048576 bytes)
|
|
cluster_size: 65536
|
|
Format specific information:
|
|
compat: 1.1
|
|
compression type: zlib
|
|
lazy refcounts: false
|
|
bitmaps:
|
|
[0]:
|
|
flags:
|
|
name: bitmap-1
|
|
granularity: 32768
|
|
[1]:
|
|
flags:
|
|
[0]: auto
|
|
name: bitmap-2
|
|
granularity: 65536
|
|
refcount bits: 16
|
|
corrupt: false
|
|
extended l2: false
|
|
|
|
The same bitmaps in JSON format:
|
|
[
|
|
{
|
|
"flags": [],
|
|
"granularity": 32768,
|
|
"name": "bitmap-1"
|
|
},
|
|
{
|
|
"flags": [
|
|
"auto"
|
|
],
|
|
"granularity": 65536,
|
|
"name": "bitmap-2"
|
|
}
|
|
]
|
|
|
|
Test 4
|
|
Checking "in-use" flag...
|
|
qemu-img info dump:
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 1 MiB (1048576 bytes)
|
|
cluster_size: 65536
|
|
Format specific information:
|
|
compat: 1.1
|
|
compression type: zlib
|
|
lazy refcounts: false
|
|
bitmaps:
|
|
[0]:
|
|
flags:
|
|
[0]: in-use
|
|
name: bitmap-1
|
|
granularity: 32768
|
|
[1]:
|
|
flags:
|
|
[0]: in-use
|
|
[1]: auto
|
|
name: bitmap-2
|
|
granularity: 65536
|
|
refcount bits: 16
|
|
corrupt: false
|
|
extended l2: false
|
|
|
|
The same bitmaps in JSON format:
|
|
[
|
|
{
|
|
"flags": [
|
|
"in-use"
|
|
],
|
|
"granularity": 32768,
|
|
"name": "bitmap-1"
|
|
},
|
|
{
|
|
"flags": [
|
|
"in-use",
|
|
"auto"
|
|
],
|
|
"granularity": 65536,
|
|
"name": "bitmap-2"
|
|
}
|
|
]
|
|
|
|
Test 5
|
|
{"execute": "block-dirty-bitmap-add", "arguments": {"disabled": false, "granularity": 16384, "name": "bitmap-0", "node": "drive0", "persistent": true}}
|
|
{"return": {}}
|
|
Write an unknown bitmap flag '0x4' into a new QCOW2 image at offset 327695
|
|
qemu-img: Could not open 'TEST_IMG': Bitmap 'bitmap-0' doesn't satisfy the constraints
|
|
|
|
Unset the unknown bitmap flag '0x4' in the bitmap directory entry:
|
|
|
|
image: TEST_IMG
|
|
file format: IMGFMT
|
|
virtual size: 1 MiB (1048576 bytes)
|
|
cluster_size: 65536
|
|
Format specific information:
|
|
compat: 1.1
|
|
compression type: zlib
|
|
lazy refcounts: false
|
|
bitmaps:
|
|
[0]:
|
|
flags:
|
|
[0]: auto
|
|
name: bitmap-0
|
|
granularity: 16384
|
|
refcount bits: 16
|
|
corrupt: false
|
|
extended l2: false
|
|
|
|
Test complete
|