In vhost_user_receive() if vhost_net_notify_migration_done() reports
an error we display on the console:
Vhost user backend fails to broadcast fake RARP
This message can be useful if there is a problem to execute
VHOST_USER_SEND_RARP but it is useless if the backend doesn't
support VHOST_USER_PROTOCOL_F_RARP.
Don't report the error if vhost_net_notify_migration_done()
returns -ENOTSUP (from vhost_user_migration_done())
Update vhost_net-stub.c to return -ENOTSUP too.
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
hw/net/vhost_net-stub.c | 2 +-
net/vhost-user.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/net/vhost_net-stub.c b/hw/net/vhost_net-stub.c
index 72df6d757e4d..875cd6c2b9c8 100644
--- a/hw/net/vhost_net-stub.c
+++ b/hw/net/vhost_net-stub.c
@@ -93,7 +93,7 @@ void vhost_net_config_mask(VHostNetState *net, VirtIODevice
*dev, bool mask)
int vhost_net_notify_migration_done(struct vhost_net *net, char* mac_addr)
{
- return -1;
+ return -ENOTSUP;
}
VHostNetState *get_vhost_net(NetClientState *nc)
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 12555518e838..636fff8a84a2 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -146,7 +146,7 @@ static ssize_t vhost_user_receive(NetClientState *nc, const
uint8_t *buf,
r = vhost_net_notify_migration_done(s->vhost_net, mac_addr);
- if ((r != 0) && (display_rarp_failure)) {
+ if ((r != 0) && (r != -ENOTSUP) && (display_rarp_failure)) {
fprintf(stderr,
"Vhost user backend fails to broadcast fake RARP\n");
fflush(stderr);
--
2.47.1