[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WR
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server |
Date: |
Wed, 20 Jul 2016 09:09:10 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 |
On 20/07/2016 06:37, Fam Zheng wrote:
> Yes, you are right about this, I was confused because "qemu-img map" does not
> report this allocation state after zero write. (No idea why SEEK_DATA doesn't
> hit the fallocate'ed area.)
Apparently it's because it's zeroed.
$ fallocate -z -o 10485760 -l 10485760 test
$ fallocate -p -o 49152000 -l 10485760 test
$ fallocate -o 49152000 -l 10485760 test
$ fallocate -p -o 65536000 -l 10485760 test
Now we have:
- a zero area at 10240K..20480K
- an hole+allocated area at 48000K..59240K
- a hole at 64000K..74240K
$ qemu-img map test
Offset Length Mapped to File
0 0xa00000 0 test << ends at 10240K
0x1400000 0x1ae0000 0x1400000 test << ends at 48000K
0x38e0000 0x5a0000 0x38e0000 test << ends at 64000K
0x4880000 0x1b80000 0x4880000 test
So "qemu-img map" hides both zeroed and hole areas. With the JSON format
we get more information:
$ qemu-img map --output=json test
[{ "start": 0, "length": 10485760, "depth": 0, "zero": false, "data": true,
"offset": 0},
{ "start": 10485760, "length": 10485760, "depth": 0, "zero": true, "data":
false, "offset": 10485760},
{ "start": 20971520, "length": 28180480, "depth": 0, "zero": false, "data":
true, "offset": 20971520},
{ "start": 49152000, "length": 10485760, "depth": 0, "zero": true, "data":
false, "offset": 49152000},
{ "start": 59637760, "length": 5898240, "depth": 0, "zero": false, "data":
true, "offset": 59637760},
{ "start": 65536000, "length": 10485760, "depth": 0, "zero": true, "data":
false, "offset": 65536000},
{ "start": 76021760, "length": 28835840, "depth": 0, "zero": false, "data":
true, "offset": 76021760}]
Both zeroed and holes are reported as "zero": true, "data": false. This
limitation stems from the fact that we cannot use FIEMAP.
Paolo
- [Qemu-block] [PATCH v5 09/14] nbd: Let client skip portions of server reply, (continued)
- [Qemu-block] [PATCH v5 09/14] nbd: Let client skip portions of server reply, Eric Blake, 2016/07/19
- [Qemu-block] [PATCH v5 08/14] nbd: Let server know when client gives up negotiation, Eric Blake, 2016/07/19
- [Qemu-block] [PATCH v5 04/14] nbd: Treat flags vs. command type as separate fields, Eric Blake, 2016/07/19
- [Qemu-block] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Eric Blake, 2016/07/19
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Fam Zheng, 2016/07/19
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Eric Blake, 2016/07/19
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Paolo Bonzini, 2016/07/19
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Fam Zheng, 2016/07/19
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Eric Blake, 2016/07/19
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Fam Zheng, 2016/07/20
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server,
Paolo Bonzini <=
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Fam Zheng, 2016/07/20
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Paolo Bonzini, 2016/07/20
- Re: [Qemu-block] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Fam Zheng, 2016/07/20
- [Qemu-block] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Paolo Bonzini, 2016/07/20
- Re: [Qemu-block] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Dave Chinner, 2016/07/20
- Re: [Qemu-block] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Niels de Vos, 2016/07/20
- Re: [Qemu-block] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Dave Chinner, 2016/07/21
- Re: [Qemu-block] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Pádraig Brady, 2016/07/21
- Re: [Qemu-block] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Dave Chinner, 2016/07/21
- Re: [Qemu-block] semantics of FIEMAP without FIEMAP_FLAG_SYNC (was Re: [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server), Paolo Bonzini, 2016/07/20