migration: Add postcopy_has_request()
commita1fe28df7547120bc3ac8bc4c3d1565d4cf7905e
authorPeter Xu <peterx@redhat.com>
Wed, 19 Jan 2022 08:09:18 +0000 (19 16:09 +0800)
committerJuan Quintela <quintela@redhat.com>
Fri, 28 Jan 2022 14:38:23 +0000 (28 15:38 +0100)
tree6a6d1a744b0a3e8ab395ed090f68263458acf10d
parent2d1c37c603ab3ed9ec1abfc4f4491b8680b23a77
migration: Add postcopy_has_request()

Add a helper to detect whether postcopy has pending request.

Since at it, cleanup the code a bit, e.g. in unqueue_page() we shouldn't need
to check it again on queue empty because we're the only one (besides cleanup
code, which should never run during this process) that will take a request off
the list, so the request list can only grow but not shrink under the hood.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/ram.c