vhost-user-blk: simplify and fix vhost_user_blk_handle_config_change
commitf67d296b6ea0e946e4ca13a39c699ca13bd977b6
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Fri, 29 Mar 2024 18:37:54 +0000 (29 21:37 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Apr 2024 06:31:29 +0000 (9 02:31 -0400)
treed13c7c623f64aab8540b9b19ca506ca0f70210df
parent6ae72f609a21cfc56bf655cd4bcded5d07691ce7
vhost-user-blk: simplify and fix vhost_user_blk_handle_config_change

Let's not care about what was changed and update the whole config,
reasons:

1. config->geometry should be updated together with capacity, so we fix
   a bug.

2. Vhost-user protocol doesn't say anything about config change
   limitation. Silent ignore of changes doesn't seem to be correct.

3. vhost-user-vsock reads the whole config

4. on realize we don't do any checks on retrieved config, so no reason
   to care here

Comment "valid for resize only" exists since introduction the whole
hw/block/vhost-user-blk.c in commit
   00343e4b54ba0685e9ebe928ec5713b0cf7f1d1c
    "vhost-user-blk: introduce a new vhost-user-blk host device",
seems it was just an extra limitation.

Also, let's notify guest unconditionally:

1. So does vhost-user-vsock

2. We are going to reuse the functionality in new cases when we do want
   to notify the guest unconditionally. So, no reason to create extra
   branches in the logic.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Acked-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Message-Id: <20240329183758.3360733-2-vsementsov@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/block/vhost-user-blk.c