]> git.proxmox.com Git - mirror_qemu.git/commit - block.c
block: clear dirty bitmap when discarding
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 14 Jan 2013 15:26:58 +0000 (16:26 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 15 Jan 2013 09:03:48 +0000 (10:03 +0100)
commitdf702c9b4c1d049b12d7cf2f2ee607ff32f766cb
tree98d268644fff7121bc9063488d9dcadea4fa7f53
parent501378c3af16e8e83a9dd500c11e594f4d1dbe79
block: clear dirty bitmap when discarding

Note that resetting bits in the dirty bitmap is done _before_ actually
processing the request.  Writes, instead, set bits after the request
is completed.

This way, when there are concurrent write and discard requests, the
outcome will always be that the blocks are marked dirty.  This scenario
should never happen, but it is safer to do it this way.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block.c