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] Cleanup error paths in xen/common/dom0_ops.c

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Cleanup error paths in xen/common/dom0_ops.c
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Wed, 09 Mar 2005 14:28:31 -0600
Delivery-date: Wed, 09 Mar 2005 20:31:07 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Organization: IBM
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)
I've written an automated dom0_op generator in an effort to test the libxc rewrite. The tool is still awfully primative and the rewrite is not yet complete but I wanted to post fixes for some bugs the tool found so I wouldn't forget.

The first makes sure that builddomain returns ESRCH when passed an invalid domain ID (this is what every other dom0_op returns).

The second makes sure that unpausedomain returns EINVAL if you try to unpause yourself. This is the behavior of pausedomain and is a bit more sane than just returning 0.

I've tested this on today's unstable (able to boot and create domains with Xend just as before).

Regards,
Anthony Liguori

Signed-off-by: Anthony Liguori (aliguori@xxxxxxxxxx)

--- xen-unstable/xen/common/dom0_ops.c~ 2005-03-08 22:12:28.000000000 -0600
+++ xen-unstable/xen/common/dom0_ops.c  2005-03-09 14:03:05.000000000 -0600
@@ -114,7 +114,7 @@
     case DOM0_BUILDDOMAIN:
     {
         struct domain *d = find_domain_by_id(op->u.builddomain.domain);
-        ret = -EINVAL;
+        ret = -ESRCH;
         if ( d != NULL )
         {
             ret = final_setup_guest(d, &op->u.builddomain);
@@ -147,10 +147,13 @@
         if ( d != NULL )
         {
             ret = -EINVAL;
-            if ( test_bit(DF_CONSTRUCTED, &d->d_flags) )
+            if ( d != current->domain )
             {
-                domain_unpause_by_systemcontroller(d);
-                ret = 0;
+                if ( test_bit(DF_CONSTRUCTED, &d->d_flags) )
+                {
+                    domain_unpause_by_systemcontroller(d);
+                    ret = 0;
+                }
             }
             put_domain(d);
         }
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Cleanup error paths in xen/common/dom0_ops.c, Anthony Liguori <=