diff mbox series

[XEN,for-4.13,2/6] xl: Pass libxl_domain_config to freemem(), instead of b_info

Message ID 20191004151707.24844-3-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show
Series Drop/deprecate libxl_get_required_*_memory | expand

Commit Message

Ian Jackson Oct. 4, 2019, 3:17 p.m. UTC
We are going to change the libxl API in a moment and this change will
make it simpler.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/xl/xl_vmcontrol.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Anthony PERARD Oct. 4, 2019, 5:24 p.m. UTC | #1
On Fri, Oct 04, 2019 at 04:17:03PM +0100, Ian Jackson wrote:
> We are going to change the libxl API in a moment and this change will
> make it simpler.
> 
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
diff mbox series

Patch

diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c
index b20582e15b..d33c6b38c9 100644
--- a/tools/xl/xl_vmcontrol.c
+++ b/tools/xl/xl_vmcontrol.c
@@ -314,7 +314,7 @@  static int domain_wait_event(uint32_t domid, libxl_event **event_r)
  * Returns true in case there is already, or we manage to free it, enough
  * memory, but also if autoballoon is false.
  */
-static bool freemem(uint32_t domid, libxl_domain_build_info *b_info)
+static bool freemem(uint32_t domid, libxl_domain_config *d_config)
 {
     int rc, retries = 3;
     uint64_t need_memkb, free_memkb;
@@ -322,7 +322,7 @@  static bool freemem(uint32_t domid, libxl_domain_build_info *b_info)
     if (!autoballoon)
         return true;
 
-    rc = libxl_domain_need_memory(ctx, b_info, &need_memkb);
+    rc = libxl_domain_need_memory(ctx, &d_config->b_info, &need_memkb);
     if (rc < 0)
         return false;
 
@@ -879,7 +879,7 @@  start:
         goto error_out;
 
     if (domid_soft_reset == INVALID_DOMID) {
-        if (!freemem(domid, &d_config.b_info)) {
+        if (!freemem(domid, &d_config)) {
             fprintf(stderr, "failed to free memory for the domain\n");
             ret = ERROR_FAIL;
             goto error_out;