diff options
author | Thanos Makatos <thanos.makatos@nutanix.com> | 2021-01-26 14:25:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-26 14:25:19 +0000 |
commit | ba691a97b726b5057812fe5a82c344f2e428b495 (patch) | |
tree | d1116d2c3ad8ede5830cad6c440c74a0cba26b31 /samples/server.c | |
parent | c249ce8aa3570fc46e5c14d6ec9ceaf3ca9b54a3 (diff) | |
download | libvfio-user-ba691a97b726b5057812fe5a82c344f2e428b495.zip libvfio-user-ba691a97b726b5057812fe5a82c344f2e428b495.tar.gz libvfio-user-ba691a97b726b5057812fe5a82c344f2e428b495.tar.bz2 |
minor comments and assertions (#258)
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Diffstat (limited to 'samples/server.c')
-rw-r--r-- | samples/server.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/server.c b/samples/server.c index f7a1cd1..dfea69e 100644 --- a/samples/server.c +++ b/samples/server.c @@ -273,6 +273,7 @@ migration_device_state_transition(vfu_ctx_t *vfu_ctx, vfu_migr_state_t state) server_data->migration.pending_bytes = server_data->bar1_size; break; case VFU_MIGR_STATE_STOP: + /* FIXME should gracefully fail */ assert(server_data->migration.pending_bytes == 0); break; case VFU_MIGR_STATE_RESUME: @@ -350,6 +351,7 @@ migration_read_data(vfu_ctx_t *vfu_ctx, void *buf, __u64 size, __u64 offset) * Reading from the migration region in any other state is undefined * (I think). */ + assert(false); return 0; } if (offset > bar_size) { @@ -405,7 +407,7 @@ migration_data_written(UNUSED vfu_ctx_t *vfu_ctx, UNUSED __u64 count, { /* * We apply migration state directly in the migration_write_data callback, - * we don't need to do anything here. We would have to apply migration + * so we don't need to do anything here. We would have to apply migration * state in this callback if the migration region was memory mappable, in * which case we wouldn't know when the client wrote migration data. */ |