This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [PATCH]: Xend: Balloon an additional 8MB for QEMU device mod

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH]: Xend: Balloon an additional 8MB for QEMU device model
From: Chris Lalancette <clalance@xxxxxxxxxx>
Date: Fri, 24 Aug 2007 14:21:34 -0400
Delivery-date: Fri, 24 Aug 2007 11:22:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird (X11/20070719)
     Attached is a patch to make Xend balloon down an additional 8MB (for the
Cirrus logic video device) when doing a restore or migrate.  Without this, you
can run into the following situation:

1)  Start an HVM guest up on machine1
2)  Boot up machine2, making sure dom0 has *all* of available memory
3)  Migrate (off-line or live) from machine1 to machine2
4)  Have the video device setup fail, with the following in the qemu-dm log 

Failed allocation for dom 3: 2048 extents of order 0

The problem ends up being that if dom0 has all of memory, the restore on the
target side only balloons down exactly enough for the memory of the migrating
domain; it doesn't take into account the additional memory needed for the device
model.  So the "populate_physmap" that happens as part of video device setup
fails with out-of-memory, causing the failure above.

Note that it could be argued that this additional ballooning should be done from
QEMU, since it knows better than anyone how much memory it is going to need.
However, all of the logic for ballooning is currently contained in xend, so it
seems like a more appropriate place to put it.

The patch is against 3.1.0, but should apply fairly easily to xen-unstable.

Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
--- xen-3.1.0-src/tools/python/xen/xend/XendCheckpoint.py.orig  2007-08-24 
13:31:09.000000000 -0400
+++ xen-3.1.0-src/tools/python/xen/xend/XendCheckpoint.py       2007-08-24 
13:32:04.000000000 -0400
@@ -178,6 +178,10 @@ def restore(xd, fd, paused=False):
         log.info("restore hvm domain %d, apic=%d, pae=%d",
                  dominfo.domid, apic, pae)
+        # for an HVM guest, we actually need an additional 2048 pages (8MB)
+        # for the qemu device model; add that here
+        nr_pfns += 2048
         apic = 0
         pae  = 0
Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>