]> git.proxmox.com Git - mirror_qemu.git/commit
block/qcow2: Lock s->lock in preallocate()
authorMax Reitz <mreitz@redhat.com>
Tue, 13 Jun 2017 20:21:01 +0000 (22:21 +0200)
committerMax Reitz <mreitz@redhat.com>
Tue, 11 Jul 2017 15:45:02 +0000 (17:45 +0200)
commit652fecd0058de7d90609c347bfdbeff76ef817a6
tree1052709f7b40a9f71edbf733acdce1e223ac0342
parent7bc45dc17265772abe5dd1d4649c7bb42e1c6df1
block/qcow2: Lock s->lock in preallocate()

preallocate() is and will be called only from places that do not
otherwise need to lock s->lock: Currently that is qcow2_create2(), as of
a future patch it will be called from qcow2_truncate(), too.

It therefore makes sense to move locking that mutex into preallocate()
itself.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20170613202107.10125-11-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2.c