qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] hw/virtio/vhost-user: don't use uninitialized variable
@ 2022-05-25 12:55 Changpeng Liu
  2022-05-25 12:55 ` [PATCH 2/2] hw/vhost-user-scsi|blk: set `supports_config` flag correctly Changpeng Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Changpeng Liu @ 2022-05-25 12:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee, changpeng.liu

Variable `vdev` in `struct vhost_dev` will not be ready
until start the device, so let's not use it for the error
output here.

Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when supported")

Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
---
 hw/virtio/vhost-user.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index b040c1ad2b..0594178224 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -2031,18 +2031,16 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque,
         if (supports_f_config) {
             if (!virtio_has_feature(protocol_features,
                                     VHOST_USER_PROTOCOL_F_CONFIG)) {
-                error_setg(errp, "vhost-user device %s expecting "
+                error_setg(errp, "vhost-user device expecting "
                            "VHOST_USER_PROTOCOL_F_CONFIG but the vhost-user backend does "
-                           "not support it.", dev->vdev->name);
+                           "not support it.");
                 return -EPROTO;
             }
         } else {
             if (virtio_has_feature(protocol_features,
                                    VHOST_USER_PROTOCOL_F_CONFIG)) {
                 warn_reportf_err(*errp, "vhost-user backend supports "
-                                 "VHOST_USER_PROTOCOL_F_CONFIG for "
-                                 "device %s but QEMU does not.",
-                                 dev->vdev->name);
+                                 "VHOST_USER_PROTOCOL_F_CONFIG but QEMU does not.");
                 protocol_features &= ~(1ULL << VHOST_USER_PROTOCOL_F_CONFIG);
             }
         }
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-06-02  8:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-25 12:55 [PATCH 1/2] hw/virtio/vhost-user: don't use uninitialized variable Changpeng Liu
2022-05-25 12:55 ` [PATCH 2/2] hw/vhost-user-scsi|blk: set `supports_config` flag correctly Changpeng Liu
2022-05-31  5:40   ` Raphael Norwitz
2022-05-31  5:21 ` [PATCH 1/2] hw/virtio/vhost-user: don't use uninitialized variable Raphael Norwitz
2022-05-31 14:45 ` Alex Bennée
2022-06-01  0:58   ` Liu, Changpeng
2022-06-02  8:27     ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).