[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 31/41] vhost-net: vhost_migration_done is vhost-user
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 31/41] vhost-net: vhost_migration_done is vhost-user specific |
Date: |
Fri, 29 Jul 2016 06:16:53 +0300 |
From: Marc-André Lureau <address@hidden>
Either the callback is mandatory to implement, in which case an assert()
is more appropriate, or it's not and we can't tell much whether the
function should fail or not (given it's name, I guess it should silently
success by default). Instead, make the implementation mandatory and
vhost-user specific to be more clear about its usage.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/net/vhost_net.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 54cf015..dd41a8e 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -383,13 +383,11 @@ void vhost_net_cleanup(struct vhost_net *net)
int vhost_net_notify_migration_done(struct vhost_net *net, char* mac_addr)
{
const VhostOps *vhost_ops = net->dev.vhost_ops;
- int r = -1;
- if (vhost_ops->vhost_migration_done) {
- r = vhost_ops->vhost_migration_done(&net->dev, mac_addr);
- }
+ assert(vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER);
+ assert(vhost_ops->vhost_migration_done);
- return r;
+ return vhost_ops->vhost_migration_done(&net->dev, mac_addr);
}
bool vhost_net_virtqueue_pending(VHostNetState *net, int idx)
--
MST
- [Qemu-devel] [PULL 22/41] vhost: add missing VHOST_OPS_DEBUG, (continued)
- [Qemu-devel] [PULL 22/41] vhost: add missing VHOST_OPS_DEBUG, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 21/41] vhost: do not assert() on vhost_ops failure, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 23/41] vhost: use error_report() instead of fprintf(stderr, ...), Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 24/41] qemu-char: fix qemu_chr_fe_set_msgfds() crash when disconnected, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 25/41] vhost-user: call set_msgfds unconditionally, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 26/41] vhost-user: check qemu_chr_fe_set_msgfds() return value, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 27/41] vhost-user: check vhost_user_{read, write}() return value, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 28/41] vhost-user: keep vhost_net after a disconnection, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 29/41] vhost-user: add get_vhost_net() assertions, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 30/41] Revert "vhost-net: do not crash if backend is not present", Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 31/41] vhost-net: vhost_migration_done is vhost-user specific,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 32/41] vhost: add assert() to check runtime behaviour, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 33/41] char: add chr_wait_connected callback, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 35/41] vhost-user: wait until backend init is completed, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 34/41] char: add and use tcp_chr_wait_connected, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 36/41] tests: plug some leaks in virtio-net-test, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 37/41] tests: fix vhost-user-test leak, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 38/41] vhost-user: add error report in vhost_user_write(), Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 39/41] vhost: add vhost_net_set_backend(), Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 41/41] mptsas: Fix a migration compatible issue, Michael S. Tsirkin, 2016/07/28
- [Qemu-devel] [PULL 40/41] vhost: do not update last avail idx on get_vring_base() failure, Michael S. Tsirkin, 2016/07/28