diff options
Diffstat (limited to 'lib/migration.c')
-rw-r--r-- | lib/migration.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/migration.c b/lib/migration.c index 20d542c..aefd103 100644 --- a/lib/migration.c +++ b/lib/migration.c @@ -292,6 +292,7 @@ handle_mig_data_read(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) assert(msg != NULL); if (msg->in.iov.iov_len < sizeof(struct vfio_user_mig_data)) { + vfu_log(vfu_ctx, LOG_ERR, "message too short"); return ERROR_INT(EINVAL); } @@ -299,6 +300,7 @@ handle_mig_data_read(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) struct vfio_user_mig_data *req = msg->in.iov.iov_base; if (vfu_ctx->migration == NULL) { + vfu_log(vfu_ctx, LOG_ERR, "migration not enabled"); return ERROR_INT(EINVAL); } @@ -333,6 +335,7 @@ handle_mig_data_read(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) ssize_t ret = migr->callbacks.read_data(vfu_ctx, &res->data, req->size); if (ret < 0) { + vfu_log(vfu_ctx, LOG_ERR, "read_data callback failed"); msg->out.iov.iov_len = 0; return ret; } @@ -350,6 +353,7 @@ handle_mig_data_write(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) assert(msg != NULL); if (msg->in.iov.iov_len < sizeof(struct vfio_user_mig_data)) { + vfu_log(vfu_ctx, LOG_ERR, "message too short"); return ERROR_INT(EINVAL); } @@ -357,6 +361,7 @@ handle_mig_data_write(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) struct vfio_user_mig_data *req = msg->in.iov.iov_base; if (vfu_ctx->migration == NULL) { + vfu_log(vfu_ctx, LOG_ERR, "migration not enabled"); return ERROR_INT(EINVAL); } @@ -381,6 +386,7 @@ handle_mig_data_write(vfu_ctx_t *vfu_ctx, vfu_msg_t *msg) ssize_t ret = migr->callbacks.write_data(vfu_ctx, &req->data, req->size); if (ret < 0) { + vfu_log(vfu_ctx, LOG_ERR, "write_data callback failed"); return ret; } else if (ret != req->size) { vfu_log(vfu_ctx, LOG_ERR, "migration data partial write"); |