All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] libvhost-user: fix SLAVE_SEND_FD handling
@ 2019-09-03 19:54 Johannes Berg
  2019-09-03 20:01 ` no-reply
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2019-09-03 19:54 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marc-André Lureau, Johannes Berg, Tiwei Bie, Michael S . Tsirkin

From: Johannes Berg <johannes.berg@intel.com>

It doesn't look like this could possibly work properly since
VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD is defined to 10, but the
dev->protocol_features has a bitmap. I suppose the peer this
was tested with also supported VHOST_USER_PROTOCOL_F_LOG_SHMFD,
in which case the test would always be false, but nevertheless
the code seems wrong.

Use has_feature() to fix this.

Fixes: d84599f56c82 ("libvhost-user: support host notifier")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 contrib/libvhost-user/libvhost-user.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c
index 6a02eaffc672..e250e69abec9 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -1097,7 +1097,8 @@ bool vu_set_queue_host_notifier(VuDev *dev, VuVirtq *vq, int fd,
 
     vmsg.fd_num = fd_num;
 
-    if ((dev->protocol_features & VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD) == 0) {
+    if (!has_feature(dev->protocol_features,
+		     VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD)) {
         return false;
     }
 
-- 
2.23.0



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

* Re: [Qemu-devel] [PATCH] libvhost-user: fix SLAVE_SEND_FD handling
  2019-09-03 19:54 [Qemu-devel] [PATCH] libvhost-user: fix SLAVE_SEND_FD handling Johannes Berg
@ 2019-09-03 20:01 ` no-reply
  0 siblings, 0 replies; 2+ messages in thread
From: no-reply @ 2019-09-03 20:01 UTC (permalink / raw)
  To: johannes; +Cc: tiwei.bie, marcandre.lureau, qemu-devel, johannes.berg, mst

Patchew URL: https://patchew.org/QEMU/20190903195442.11199-1-johannes@sipsolutions.net/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20190903195442.11199-1-johannes@sipsolutions.net
Subject: [Qemu-devel] [PATCH] libvhost-user: fix SLAVE_SEND_FD handling

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
9da584f libvhost-user: fix SLAVE_SEND_FD handling

=== OUTPUT BEGIN ===
ERROR: code indent should never use tabs
#30: FILE: contrib/libvhost-user/libvhost-user.c:1101:
+^I^I     VHOST_USER_PROTOCOL_F_SLAVE_SEND_FD)) {$

total: 1 errors, 0 warnings, 9 lines checked

Commit 9da584f52360 (libvhost-user: fix SLAVE_SEND_FD handling) has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190903195442.11199-1-johannes@sipsolutions.net/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

end of thread, other threads:[~2019-09-03 20:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03 19:54 [Qemu-devel] [PATCH] libvhost-user: fix SLAVE_SEND_FD handling Johannes Berg
2019-09-03 20:01 ` no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.