Now that libxl_wait_for_memory_target is capable of waiting until dom0
reaches its target, we can remove the other wait function call:
libxl_wait_for_free_memory. No need to wait twice. Once dom0 has met its
target, simply loop again and recalculate free_memkb.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Mike Latimer <mlatimer@suse.com>
Tested-by: Mike Latimer <mlatimer@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
if (rc < 0)
return rc;
- rc = libxl_wait_for_free_memory(ctx, domid, need_memkb, 10);
- if (!rc)
- return 0;
- else if (rc != ERROR_NOMEM)
- return rc;
-
/* wait until dom0 reaches its target, as long as we are making
* progress */
- rc = libxl_wait_for_memory_target(ctx, 0, 1);
+ rc = libxl_wait_for_memory_target(ctx, 0, 10);
if (rc < 0)
return rc;