From: Dmitry Isaykin Date: Thu, 9 Apr 2020 14:55:50 +0000 (+0100) Subject: tools/xl: Remove the filelock when building VM if autoballooning is off X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~416 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4fb402b486121c0110dd8cbc2ef2791ab9c1af73;p=xen.git tools/xl: Remove the filelock when building VM if autoballooning is off The presence of this filelock does not allow building several VMs at the same time. This filelock was added to prevent other xl instances from using memory freed for the currently building VM in autoballoon mode. Signed-off-by: Dmitry Isaykin Reviewed-by: Ian Jackson --- diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c index 2e2d427492..17b4514c94 100644 --- a/tools/xl/xl_vmcontrol.c +++ b/tools/xl/xl_vmcontrol.c @@ -874,9 +874,11 @@ int create_domain(struct domain_create *dom_info) start: assert(domid == INVALID_DOMID); - rc = acquire_lock(); - if (rc < 0) - goto error_out; + if (autoballoon) { + rc = acquire_lock(); + if (rc < 0) + goto error_out; + } if (domid_soft_reset == INVALID_DOMID) { if (!freemem(domid, &d_config)) { @@ -939,7 +941,8 @@ start: if ( ret ) goto error_out; - release_lock(); + if (autoballoon) + release_lock(); if (restore_fd_to_close >= 0) { if (close(restore_fd_to_close)) @@ -1113,7 +1116,8 @@ start: } error_out: - release_lock(); + if (autoballoon) + release_lock(); if (libxl_domid_valid_guest(domid)) { libxl_domain_destroy(ctx, domid, 0); domid = INVALID_DOMID;