OSDN Git Service

hw/virtio/vhost-user: don't suppress F_CONFIG when supported
authorAlex Bennée <alex.bennee@linaro.org>
Mon, 21 Mar 2022 15:30:36 +0000 (15:30 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 16 May 2022 08:38:40 +0000 (04:38 -0400)
commit56534930b5cd3a6c7259cfeba69f08ba28c8f62a
tree9792a01ca459e6134ae734e797384b59cf154c20
parent27351992bf238f669dd08655d31ad111905bf899
hw/virtio/vhost-user: don't suppress F_CONFIG when supported

Previously we would silently suppress VHOST_USER_PROTOCOL_F_CONFIG
during the protocol negotiation if the QEMU stub hadn't implemented
the vhost_dev_config_notifier. However this isn't the only way we can
handle config messages, the existing vdc->get/set_config can do this
as well.

Lightly re-factor the code to check for both potential methods and
instead of silently squashing the feature error out. It is unlikely
that a vhost-user backend expecting to handle CONFIG messages will
behave correctly if they never get sent.

Fixes: 1c3e5a2617 ("vhost-user: back SET/GET_CONFIG requests with a protocol feature")
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220321153037.3622127-13-alex.bennee@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/scsi/vhost-user-scsi.c
hw/virtio/vhost-user.c
include/hw/virtio/vhost-user.h