[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [HVM] Don't set the shadow allocation to zero if the dom is still shadowed.



# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
# Date 1167735470 0
# Node ID 711c31232d71608fe4ea9f4f22ca2620d3faf8ff
# Parent  4fc6ffff2ac583dc0c386eb3452484b31b37fd0e
[HVM] Don't set the shadow allocation to zero if the dom is still shadowed.
Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxxxxx>
---
 xen/arch/x86/mm/shadow/common.c |    9 +++++++++
 1 files changed, 9 insertions(+)

diff -r 4fc6ffff2ac5 -r 711c31232d71 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c   Sun Dec 31 12:26:42 2006 +0000
+++ b/xen/arch/x86/mm/shadow/common.c   Tue Jan 02 10:57:50 2007 +0000
@@ -3306,6 +3306,15 @@ int shadow_domctl(struct domain *d,
 
     case XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION:
         shadow_lock(d);
+        if ( sc->mb == 0 && shadow_mode_enabled(d) )
+        {            
+            /* Can't set the allocation to zero unless the domain stops using
+             * shadow pagetables first */
+            SHADOW_ERROR("Can't set shadow allocation to zero, domain %u"
+                         " is still using shadows.\n", d->domain_id);
+            shadow_unlock(d);
+            return -EINVAL;
+        }
         rc = sh_set_allocation(d, sc->mb << (20 - PAGE_SHIFT), &preempted);
         shadow_unlock(d);
         if ( preempted )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.