WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] - return error when appropriate from increase_memory

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] - return error when appropriate from increase_memory_reservation
From: Ben Thomas <bthomas@xxxxxxxxxxxxxxx>
Date: Thu, 20 Apr 2006 14:04:23 -0400
Delivery-date: Thu, 20 Apr 2006 11:04:48 -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: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)
This patch fixes a case in increasing a memory reservation where you
do not get the pages nor do you get an error.  While an argument might
be made that checking the page count independently is workable, it
does seem reasonable to have the operation return a failure in the
cases where it doesn't do what was asked. Right now, it mostly returns
the correct status.  This patch just adds another instance of this.

And, while-I-was-there, I've been generating linker maps for qemu in
my own builds. It's harmless, until you need it and then it's valuable.
Tweak the Makefile to create the map.

Signed-off-by:  Ben Thomas (ben@xxxxxxxxxxxxxxx)

--
------------------------------------------------------------------------
Ben Thomas                                         Virtual Iron Software
bthomas@xxxxxxxxxxxxxxx                            Tower 1, Floor 2
978-849-1214                                       900 Chelmsford Street
                                                   Lowell, MA 01851
--- a/tools/ioemu/target-i386-dm/Makefile       Fri Apr 14 14:31:13 2006 -0400
+++ b/tools/ioemu/target-i386-dm/Makefile       Thu Apr 20 13:56:56 2006 -0400
@@ -323,7 +323,7 @@ endif
 endif
 
 $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
-       $(CC) $(CFLAGS) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) 
$(VL_LIBS) -lpthread
+       $(CC) $(CFLAGS) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) 
$(VL_LIBS) -lpthread -Wl,-Map,qemu-dm.map -Wl,--cref
 
 vnc.o: vnc.c keyboard_rdesktop.c
        $(CC) $(CFLAGS) $(DEFINES) $(VNC_CFLAGS) -c -o $@ $<
diff -r 487f5e5c0fbd xen/common/memory.c
--- a/xen/common/memory.c       Fri Apr 14 14:31:13 2006 -0400
+++ b/xen/common/memory.c       Thu Apr 20 13:56:56 2006 -0400
@@ -348,6 +348,9 @@ long do_memory_op(unsigned long cmd, GUE
             break;
         }
 
+        if (rc < reservation.nr_extents && !preempted)
+            return -ENOMEM;
+ 
         if ( unlikely(reservation.domid != DOMID_SELF) )
             put_domain(d);
 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>