vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
PATCH 1/1 vhsot-user: Do not wait for replay for not sent VHOST_USER_SET_LOG_BASE
From: BillXiang <[email protected]>
Hello, there are some code that must be added to my last
commit 7c211eb078c42146ee9a441cc028fbc4c378ef5a of
'Skip unnecessary duplicated VHOST_USER_SET_LOG_BASE requests'.
We can not wait for replies from those duplicated VHOST_USER_SET_LOG_BASE that not really sent.
Signed-off-by BillXiang <[email protected]>
--- hw/virtio/vhost-user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/virtio/vhost-user.c +2 -2
@@ -440,7 +440,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,int ret;VhostUserMsg msg = { .hdr.request =VHOST_USER_SET_LOG_BASE , - .hdr.flags =VHOST_USER_VERSION , + .hdr.flags =VHOST_USER_VERSION |VHOST_USER_NEED_REPLY_MASK , .payload.log.mmap_size = log->size *sizeof (*(log->log)), .payload.log.mmap_offset =0 , .hdr.size =sizeof (msg.payload.log),
@@ -460,7 +460,7 @@ static int vhost_user_set_log_base(struct vhost_dev *dev, uint64_t base,return ret; } -if (shmfd) { +if (shmfd && (msg.hdr.flags &VHOST_USER_NEED_REPLY_MASK )) { msg.hdr.size =0 ; ret =vhost_user_read (dev, &msg);if (ret <0 ) {
Signature · 1 line
2.30.0