[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 2/5] block: Generic truncation fallback
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [RFC 2/5] block: Generic truncation fallback |
Date: |
Fri, 12 Jul 2019 11:49:19 +0200 |
User-agent: |
Mutt/1.11.3 (2019-02-01) |
Am 11.07.2019 um 21:58 hat Max Reitz geschrieben:
> If a protocol driver does not support truncation, we call fall back to
> effectively not doing anything if the new size is less than the actual
> file size. This is what we have been doing for some host device drivers
> already.
Specifically, we're doing it for drivers that access a fixed-size image,
i.e. block devices rather than regular files. We don't want to do this
for drivers where the file size could be changed, but just didn't
implement it.
So I would suggest calling the function more specifically something like
bdrv_co_truncate_blockdev(), and not using it as an automatic fallback
in bdrv_co_truncate(), but just make it the BlockDriver.bdrv_co_truncate
implementation for those drivers where it makes sense.
And of course, we only need these fake implementations because qemu-img
(or .bdrv_co_create_opts) always wants to create the protocol level. If
we could avoid this, then we wouldn't need any of this.
Kevin
- Re: [Qemu-devel] [RFC 1/5] block/nbd: Fix hang in .bdrv_close(), (continued)
- Re: [Qemu-devel] [RFC 1/5] block/nbd: Fix hang in .bdrv_close(), Max Reitz, 2019/07/12
- Re: [Qemu-devel] [RFC 1/5] block/nbd: Fix hang in .bdrv_close(), Kevin Wolf, 2019/07/12
- Re: [Qemu-devel] [RFC 1/5] block/nbd: Fix hang in .bdrv_close(), Max Reitz, 2019/07/12
- Re: [Qemu-devel] [RFC 1/5] block/nbd: Fix hang in .bdrv_close(), Kevin Wolf, 2019/07/12
- Re: [Qemu-devel] [RFC 1/5] block/nbd: Fix hang in .bdrv_close(), Max Reitz, 2019/07/12
- Re: [Qemu-devel] [RFC 1/5] block/nbd: Fix hang in .bdrv_close(), Kevin Wolf, 2019/07/12
[Qemu-devel] [RFC 3/5] block: Fall back to fallback truncate function, Max Reitz, 2019/07/11
[Qemu-devel] [RFC 2/5] block: Generic truncation fallback, Max Reitz, 2019/07/11
- Re: [Qemu-devel] [RFC 2/5] block: Generic truncation fallback,
Kevin Wolf <=
[Qemu-devel] [RFC 5/5] iotests: Add test for fallback truncate/create, Max Reitz, 2019/07/11
[Qemu-devel] [RFC 4/5] block: Generic file creation fallback, Max Reitz, 2019/07/11