]> xenbits.xensource.com Git - qemu-xen.git/commit
block: Let format drivers pass @exact
authorMax Reitz <mreitz@redhat.com>
Wed, 18 Sep 2019 09:51:42 +0000 (11:51 +0200)
committerMax Reitz <mreitz@redhat.com>
Mon, 28 Oct 2019 11:05:30 +0000 (12:05 +0100)
commite61a28a9b6b43da6a7a48f6d325fceadf9769388
tree4f4f9fa25e0c5486429dd082f60d119136b06c2f
parent82325ae5f2f86ad696db3d66563a078daabc9769
block: Let format drivers pass @exact

When truncating a format node, the @exact parameter is generally handled
simply by virtue of the format storing the new size in the image
metadata.  Such formats do not need to pass on the parameter to their
file nodes.

There are exceptions, though:
- raw and crypto cannot store the image size, and thus must pass on
  @exact.

- When using qcow2 with an external data file, it just makes sense to
  keep its size in sync with the qcow2 virtual disk (because the
  external data file is the virtual disk).  Therefore, we should pass
  @exact when truncating it.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20190918095144.955-7-mreitz@redhat.com
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/crypto.c
block/qcow2.c
block/raw-format.c