Skip to content

Commit

Permalink
postcopy: Add extra check for COPY function
Browse files Browse the repository at this point in the history
As an extra sanity check, make sure the region we're registering
can perform UFFDIO_COPY;  the COPY will fail later but this
gives a cleaner failure.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20170224182844.32452-17-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  • Loading branch information
dagrh committed Feb 28, 2017
1 parent 0c1f403 commit 665414a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions migration/postcopy-ram.c
Expand Up @@ -378,6 +378,10 @@ static int ram_block_enable_notify(const char *block_name, void *host_addr,
error_report("%s userfault register: %s", __func__, strerror(errno));
return -1;
}
if (!(reg_struct.ioctls & ((__u64)1 << _UFFDIO_COPY))) {
error_report("%s userfault: Region doesn't support COPY", __func__);
return -1;
}

return 0;
}
Expand Down

0 comments on commit 665414a

Please sign in to comment.