vhost-user-blk: use different event handlers on initialization
commit0c99d722e72dba458f4fa7876d96de5626780c94
authorDenis Plotnikov <den-plotnikov@yandex-team.ru>
Thu, 25 Mar 2021 15:12:15 +0000 (25 18:12 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 1 Apr 2021 15:39:12 +0000 (1 11:39 -0400)
tree110c4de39cc1a1364b5dd8da8037b5d219196b99
parent1bd16067b652cce41a9214d0c62c73d5b45ab4b1
vhost-user-blk: use different event handlers on initialization

It is useful to use different connect/disconnect event handlers
on device initialization and operation as seen from the further
commit fixing a bug on device initialization.

This patch refactors the code to make use of them: we don't rely any
more on the VM state for choosing how to cleanup the device, instead
we explicitly use the proper event handler depending on whether
the device has been initialized.

Signed-off-by: Denis Plotnikov <den-plotnikov@yandex-team.ru>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Message-Id: <20210325151217.262793-2-den-plotnikov@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