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-changelog

[Xen-changelog] [xen-unstable] xl: save domain config (userdata) under c

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: save domain config (userdata) under correct domid/uuid
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Jan 2011 08:00:14 -0800
Delivery-date: Mon, 17 Jan 2011 08:21:40 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1294877915 0
# Node ID d839631b604807fe0f978f9eacc1c73f6a9bf0bd
# Parent  20b0f709153e9e36c937caae8ec0b816c8ad1cfd
xl: save domain config (userdata) under correct domid/uuid

Recent changes caused the domain config file to be saved under dom0's
filename in /var/lib/xen.  This was due to the config file being saved
before the domain was created and thus before the domid and uuid were
known.

Fix this by moving the saving code to after creation.

Also, change the "default" initialisation of domid in
xl_cmdimpl.c:create_domain to be domid=-1.  That provides a more
obviously wrong value than 0 (which refers to dom0) so that other bugs
of this kind would be more likely to show up.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Tested-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff -r 20b0f709153e -r d839631b6048 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Jan 12 14:14:13 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Thu Jan 13 00:18:35 2011 +0000
@@ -1437,7 +1437,7 @@ static int create_domain(struct domain_c
         printf_info(-1, &d_config, &d_config.dm_info);
 
 start:
-    domid = 0;
+    domid = -1;
 
     rc = acquire_lock();
     if (rc < 0)
@@ -1446,14 +1446,6 @@ start:
     ret = freemem(&d_config.b_info, &d_config.dm_info);
     if (ret < 0) {
         fprintf(stderr, "failed to free memory for the domain\n");
-        ret = ERROR_FAIL;
-        goto error_out;
-    }
-
-    ret = libxl_userdata_store(&ctx, domid, "xl",
-                                    config_data, config_len);
-    if (ret) {
-        perror("cannot save config file");
         ret = ERROR_FAIL;
         goto error_out;
     }
@@ -1474,6 +1466,14 @@ start:
     }
     if ( ret )
         goto error_out;
+
+    ret = libxl_userdata_store(&ctx, domid, "xl",
+                                    config_data, config_len);
+    if (ret) {
+        perror("cannot save config file");
+        ret = ERROR_FAIL;
+        goto error_out;
+    }
 
     release_lock();
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xl: save domain config (userdata) under correct domid/uuid, Xen patchbot-unstable <=