1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | typedef struct QCowSnapshotHeader { /* header is 8 byte aligned */ uint64_t l1_table_offset; uint32_t l1_size; uint16_t id_str_size; uint16_t name_size; uint32_t date_sec; uint32_t date_nsec; uint64_t vm_clock_nsec; uint32_t vm_state_size; uint32_t extra_data_size; /* for extension */ /* extra data follows */ /* id_str follows */ /* name follows */ } QcowSnapshotHeader; |
1 2 3 4 5 | $ qemu-img create -f qcow2 test.qcow2 10G Formatting 'test.qcow2', fmt=qcow2 size=10737418240 encryption=off cluster_size=65536 lazy_refcounts=off $ qemu-img create -f raw test.raw 10G Formatting 'test.raw', fmt=raw size=10737418240 |
1 2 3 4 5 6 7 8 9 10 11 | $ ll -sh test.* 200K -rw-r--r-- 1 qiaoliyong qiaoliyong 193K 5 月 6 10:29 test.qcow2 0 -rw-r--r-- 1 qiaoliyong qiaoliyong 10G 5 月 6 10:28 test.raw [qiaoliyong@localhost ]$ stat test.raw 文件:"test.raw" 大小:10737418240 块:0 IO 块:4096 普通文件 [qiaoliyong@localhost ]$ stat test.qcow2 文件:"test.qcow2" 大小:197120 块:400 IO 块:4096 普通文件 |
1 2 3 4 5 | qemu-img convert -f raw -O qcow2 test.raw test.raw.qcow2 [qiaoliyong@localhost kimchi]$ ll -sh test.* 200K -rw-r--r-- 1 qiaoliyong qiaoliyong 193K 5 月 6 10:29 test.qcow2 0 -rw-r--r-- 1 qiaoliyong qiaoliyong 10G 5 月 6 10:28 test.raw 200K -rw-r--r-- 1 qiaoliyong qiaoliyong 193K 5 月 6 10:44 test.raw.qcow2 |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |