aboutsummaryrefslogtreecommitdiff
path: root/net/vhost-vdpa.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/vhost-vdpa.c')
-rw-r--r--net/vhost-vdpa.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index 3726ee5..e6bdb45 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -34,7 +34,7 @@
typedef struct VhostVDPAState {
NetClientState nc;
struct vhost_vdpa vhost_vdpa;
- Notifier migration_state;
+ NotifierWithReturn migration_state;
VHostNetState *vhost_net;
/* Control commands shadow buffers */
@@ -322,17 +322,17 @@ static void vhost_vdpa_net_log_global_enable(VhostVDPAState *s, bool enable)
}
}
-static void vdpa_net_migration_state_notifier(Notifier *notifier, void *data)
+static int vdpa_net_migration_state_notifier(NotifierWithReturn *notifier,
+ MigrationEvent *e, Error **errp)
{
- MigrationState *migration = data;
- VhostVDPAState *s = container_of(notifier, VhostVDPAState,
- migration_state);
+ VhostVDPAState *s = container_of(notifier, VhostVDPAState, migration_state);
- if (migration_in_setup(migration)) {
+ if (e->type == MIG_EVENT_PRECOPY_SETUP) {
vhost_vdpa_net_log_global_enable(s, true);
- } else if (migration_has_failed(migration)) {
+ } else if (e->type == MIG_EVENT_PRECOPY_FAILED) {
vhost_vdpa_net_log_global_enable(s, false);
}
+ return 0;
}
static void vhost_vdpa_net_data_start_first(VhostVDPAState *s)