OSDN Git Service

vhost-user-blk-server: notify client about disk resize
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Tue, 21 Mar 2023 20:13:23 +0000 (23:13 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 21 Apr 2023 08:25:52 +0000 (04:25 -0400)
commitca858a5fe94c0325bfe5f764f1bb090b160264a3
tree07b7b7ba8c8ef434caa9dee9ec4167908ec51769
parentb93fe7f2ca9aea5ef74db5881aabecd7b1c234ed
vhost-user-blk-server: notify client about disk resize

Currently block_resize qmp command is simply ignored by vhost-user-blk
export. So, the block-node is successfully resized, but virtio config
is unchanged and guest doesn't see that disk is resized.

Let's handle the resize by modifying the config and notifying the guest
appropriately.

After this comment, lsblk in linux guest with attached
vhost-user-blk-pci device shows new size immediately after block_resize
QMP command on vhost-user exported block node.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Message-Id: <20230321201323.3695923-1-vsementsov@yandex-team.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
block/export/vhost-user-blk-server.c
subprojects/libvhost-user/libvhost-user.c
subprojects/libvhost-user/libvhost-user.h