[PATCH for-5.0 v2 02/23] blockdev: Allow resizing everywhere

Max Reitz posted 23 patches 6 years, 2 months ago
Maintainers: Markus Armbruster <armbru@redhat.com>, Xie Changlong <xiechanglong.d@gmail.com>, Wen Congyang <wencongyang2@huawei.com>, John Snow <jsnow@redhat.com>, Max Reitz <mreitz@redhat.com>, Alberto Garcia <berto@igalia.com>, Kevin Wolf <kwolf@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>
There is a newer version of this series
[PATCH for-5.0 v2 02/23] blockdev: Allow resizing everywhere
Posted by Max Reitz 6 years, 2 months ago
Block nodes that do not allow resizing should not share BLK_PERM_RESIZE.
It does not matter whether they are the first non-filter in their chain
or not.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 blockdev.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index ab78230d23..9dc2238bf3 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3177,11 +3177,6 @@ void qmp_block_resize(bool has_device, const char *device,
     aio_context = bdrv_get_aio_context(bs);
     aio_context_acquire(aio_context);
 
-    if (!bdrv_is_first_non_filter(bs)) {
-        error_setg(errp, QERR_FEATURE_DISABLED, "resize");
-        goto out;
-    }
-
     if (size < 0) {
         error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "size", "a >0 size");
         goto out;
-- 
2.23.0


Re: [PATCH for-5.0 v2 02/23] blockdev: Allow resizing everywhere
Posted by Alberto Garcia 6 years, 2 months ago
On Mon 11 Nov 2019 05:01:55 PM CET, Max Reitz wrote:
> @@ -3177,11 +3177,6 @@ void qmp_block_resize(bool has_device, const char *device,
>      aio_context = bdrv_get_aio_context(bs);
>      aio_context_acquire(aio_context);
>  
> -    if (!bdrv_is_first_non_filter(bs)) {
> -        error_setg(errp, QERR_FEATURE_DISABLED, "resize");
> -        goto out;
> -    }
> -

What happens with this case now?

https://lists.gnu.org/archive/html/qemu-block/2019-11/msg00793.html

Berto

Re: [PATCH for-5.0 v2 02/23] blockdev: Allow resizing everywhere
Posted by Max Reitz 6 years, 2 months ago
On 06.12.19 15:04, Alberto Garcia wrote:
> On Mon 11 Nov 2019 05:01:55 PM CET, Max Reitz wrote:
>> @@ -3177,11 +3177,6 @@ void qmp_block_resize(bool has_device, const char *device,
>>      aio_context = bdrv_get_aio_context(bs);
>>      aio_context_acquire(aio_context);
>>  
>> -    if (!bdrv_is_first_non_filter(bs)) {
>> -        error_setg(errp, QERR_FEATURE_DISABLED, "resize");
>> -        goto out;
>> -    }
>> -
> 
> What happens with this case now?
> 
> https://lists.gnu.org/archive/html/qemu-block/2019-11/msg00793.html

As far as I understand, we have a bug there and we’ll fix it in 5.0.
It’s just that in one case, it wasn’t visible because resize wasn’t
allowed on some nodes (where I think it should actually be allowed,
hence this patch).

So I think we should allow resize on those nodes (this patch) and fix
the bug, and that should be fine then.

Max