diff mbox

[1/2] xen/balloon: cancel ballooning if adding new memory failed

Message ID 1478539797-15522-2-git-send-email-tim.gardner@canonical.com
State New
Headers show

Commit Message

Tim Gardner Nov. 7, 2016, 5:29 p.m. UTC
From: David Vrabel <david.vrabel@citrix.com>

BugLink: http://bugs.launchpad.net/bugs/1304001

If the balloon driver is adding additional memory regions to the
balloon and add_memory() fails it will likely continuously fail so
cancel the balloon operation.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
(back ported from commit 3dcf63677d4eb7fdfc13290c8558c301d2588fe8)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>

 Conflicts:
	drivers/xen/balloon.c
---
 drivers/xen/balloon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 7e40228..ebcef4b 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -243,8 +243,8 @@  static enum bp_state reserve_additional_memory(long credit)
 	rc = add_memory(nid, hotplug_start_paddr, balloon_hotplug << PAGE_SHIFT);
 
 	if (rc) {
-		pr_info("xen_balloon: %s: add_memory() failed: %i\n", __func__, rc);
-		return BP_EAGAIN;
+		pr_warn("Cannot add additional memory (%i)\n", rc);
+		return BP_ECANCELED;
 	}
 
 	balloon_hotplug -= credit;