summary refs log tree commit diff stats
path: root/results/classifier/gemma3:12b/files/1117
blob: f7291ce46bc87c16271e3d1c7df22ebdea80f75c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
migration corrupts qcow2 metadata when "backing file: json:{" is involve
Description of problem:
the bug happens when you have a qcow2 with backing file in json format
image: 2.qcow2
[...]
backing file: json:{"driver": "qcow2", "file": { "driver": "file", "filename": "1.qcow2"}}
backing file format: qcow2
[...]
if you want to migrate a VM that have that kind of qcow2 attached, the migration is gonna corrupted qcow2 metadata in memory and info block will look like this
json:{\"backing\": {\"backing\": {\"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"0.qcow2\"}}, \"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"1.qcow2\"}}, \"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"2.qcow2\"}}
later if you execute blockdev-snapshot-sync, the corrupt json will be write to the new qcow2 resulting with a unusable qcow2
Steps to reproduce:
/opt/qemu-7.0.0/bin/qemu-img create -f qcow2 0.qcow2 64G
/opt/qemu-7.0.0/bin/qemu-img create -F qcow2 -f qcow2 -b 'json:{"driver": "qcow2", "file": { "driver": "file", "filename": "0.qcow2"}}' 1.qcow2
/opt/qemu-7.0.0/bin/qemu-img create -F qcow2 -f qcow2 -b 'json:{"driver": "qcow2", "file": { "driver": "file", "filename": "1.qcow2"}}' 2.qcow2

#VM1
/opt/qemu-7.0.0/bin/qemu-system-x86_64 -enable-kvm -drive if=virtio,file=2.qcow2,node-name=drive0 -qmp stdio -display none

#VM2
/opt/qemu-7.0.0/bin/qemu-system-x86_64 -enable-kvm -drive if=virtio,file=2.qcow2,node-name=drive0 -qmp stdio -display none -incoming tcp::8082


#VM1 INFO BLOCK
{"QMP": {"version": {"qemu": {"micro": 0, "minor": 0, "major": 7}, "package": ""}, "capabilities": ["oob"]}}
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "human-monitor-command", "arguments": {'command-line': 'info block'} }
{"return": "virtio0 (drive0): 2.qcow2 (qcow2)\r\n    Attached to:      /machine/peripheral-anon/device[0]/virtio-backend\r\n    Cache mode:       writethrough\r\n    Backing file:     1.qcow2 (chain depth: 2)\r\n\r\nide1-cd0: [not inserted]\r\n    Attached to:      /machine/unattached/device[24]\r\n    Removable device: not locked, tray closed\r\n\r\nfloppy0: [not inserted]\r\n    Attached to:      /machine/unattached/device[17]\r\n    Removable device: not locked, tray closed\r\n\r\nsd0: [not inserted]\r\n    Removable device: not locked, tray closed\r\n"}

#VM1 MIGRATE
{ "execute": "migrate", "arguments": { "uri": "tcp:localhost:8082" } }
{"return": {}}
{"timestamp": {"seconds": 1658491019, "microseconds": 233177}, "event": "STOP"}


#VM2 INFO BLOCK
{"QMP": {"version": {"qemu": {"micro": 0, "minor": 0, "major": 7}, "package": ""}, "capabilities": ["oob"]}}
{ "execute": "qmp_capabilities" }
{"return": {}}
{ "execute": "human-monitor-command", "arguments": {'command-line': 'info block'} }
{"return": "virtio0 (drive0): 2.qcow2 (qcow2)\r\n    Attached to:      /machine/peripheral-anon/device[0]/virtio-backend\r\n    Cache mode:       writeback\r\n    Backing file:     1.qcow2 (chain depth: 2)\r\n\r\nide1-cd0: [not inserted]\r\n    Attached to:      /machine/unattached/device[24]\r\n    Removable device: not locked, tray closed\r\n\r\nfloppy0: [not inserted]\r\n    Attached to:      /machine/unattached/device[17]\r\n    Removable device: not locked, tray closed\r\n\r\nsd0: [not inserted]\r\n    Removable device: not locked, tray closed\r\n"}

#VM2 MIGRATE
{"timestamp": {"seconds": 1658491019, "microseconds": 249760}, "event": "RESUME"}

#VM2 MIGRATION DONE, INFO BLOCK
{ "execute": "human-monitor-command", "arguments": {'command-line': 'info block'} }
{"return": "virtio0 (drive0): json:{\"backing\": {\"backing\": {\"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"0.qcow2\"}}, \"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"1.qcow2\"}}, \"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"2.qcow2\"}} (qcow2)\r\n    Attached to:      /machine/peripheral-anon/device[0]/virtio-backend\r\n    Cache mode:       writethrough\r\n    Backing file:     json:{\"backing\": {\"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"0.qcow2\"}}, \"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"1.qcow2\"}} (chain depth: 2)\r\n\r\nide1-cd0: [not inserted]\r\n    Attached to:      /machine/unattached/device[24]\r\n    Removable device: not locked, tray closed\r\n\r\nfloppy0: [not inserted]\r\n    Attached to:      /machine/unattached/device[17]\r\n    Removable device: not locked, tray closed\r\n\r\nsd0: [not inserted]\r\n    Removable device: not locked, tray closed\r\n"}


#VM2 SNAPSHOT AFTER MIGRATION
{ "execute": "blockdev-snapshot-sync", "arguments": { "format": "qcow2", "snapshot-file": "3.qcow2", "node-name": "drive0", "snapshot-node-name": "drive0-snap" }}
Formatting '3.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=68719476736 backing_file=json:{"backing": {"backing": {"driver": "qcow2",, "file": {"driver": "file",, "filename": "0.qcow2"}},, "driver": "qcow2",, "file": {"driver": "file",, "filename": "1.qcow2"}},, "driver": "qcow2",, "file": {"driver": "file",, "filename": "2.qcow2"}} backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
{"return": {}}


#VM2 INFO BLOCK AFTER SNAPSHOT
{ "execute": "human-monitor-command", "arguments": {'command-line': 'info block'} }
{"return": "virtio0 (drive0-snap): 3.qcow2 (qcow2)\r\n    Attached to:      /machine/peripheral-anon/device[0]/virtio-backend\r\n    Cache mode:       writethrough\r\n    Backing file:     json:{\"backing\": {\"backing\": {\"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"0.qcow2\"}}, \"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"1.qcow2\"}}, \"driver\": \"qcow2\", \"file\": {\"driver\": \"file\", \"filename\": \"2.qcow2\"}} (chain depth: 3)\r\n\r\nide1-cd0: [not inserted]\r\n    Attached to:      /machine/unattached/device[24]\r\n    Removable device: not locked, tray closed\r\n\r\nfloppy0: [not inserted]\r\n    Attached to:      /machine/unattached/device[17]\r\n    Removable device: not locked, tray closed\r\n\r\nsd0: [not inserted]\r\n    Removable device: not locked, tray closed\r\n"}



#INFO
/opt/qemu-7.0.0/bin/qemu-img info --backing-chain 3.qcow2
qemu-img: Could not open 'json:{"backing": {"backing": {"driver": "qcow2", "file": {"driver": "file", "filename": "0.qcow2"}}, "driver": "qcow2", "file": {"driver": "file", "filename": "1.qcow2"}}, "driver": "qcow2", "file": {"driver": "file", "filename": "2.qcow2"}}': Block format 'qcow2' does not support the option 'backing.backing.driver'
Additional information:
Even if the bug is scary it's very simple to fix it

/opt/qemu-7.0.0/bin/qemu-img info --backing-chain 3.qcow2
qemu-img: Could not open 'json:{"backing": {"backing": {"driver": "qcow2", "file": {"driver": "file", "filename": "0.qcow2"}}, "driver": "qcow2", "file": {"driver": "file", "filename": "1.qcow2"}}, "driver": "qcow2", "file": {"driver": "file", "filename": "2.qcow2"}}': Block format 'qcow2' does not support the option 'backing.backing.driver'

root@lenovo2:/data# /opt/qemu-7.0.0/bin/qemu-img rebase -f qcow2 -F qcow2 -u -b 2.qcow2 3.qcow2
root@lenovo2:/data# /opt/qemu-7.0.0/bin/qemu-img info --backing-chain 3.qcow2
image: 3.qcow2
file format: qcow2
virtual size: 64 GiB (68719476736 bytes)
disk size: 24 KiB
cluster_size: 65536
backing file: 2.qcow2
backing file format: qcow2
Format specific information:
    compat: 1.1
    compression type: zlib
    lazy refcounts: false
    refcount bits: 16
    corrupt: false
    extended l2: false

image: 2.qcow2
file format: qcow2
virtual size: 64 GiB (68719476736 bytes)
disk size: 24 KiB
cluster_size: 65536
[..........]