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] libxenlight: two small fixes

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] libxenlight: two small fixes
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Tue, 1 Dec 2009 16:32:27 +0000
Delivery-date: Tue, 01 Dec 2009 08:29:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)
Hi all,
this patch contains two small fixes:

- set the domid of the guest and not the one of the stubdom in the
libxl_device_model_starting returned to the user;

- check that the length of the two strings matches in
libxl_name_to_domid, otherwise we can get a match for two different
domains that have the same initial part of the name.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

diff -r 0abcf45319ca tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Tue Dec 01 15:58:16 2009 +0000
+++ b/tools/libxl/libxl.c       Tue Dec 01 15:58:43 2009 +0000
@@ -842,7 +842,7 @@
 
     if (starting_r) {
         *starting_r = libxl_calloc(ctx, sizeof(libxl_device_model_starting), 
1);
-        (*starting_r)->domid = domid;
+        (*starting_r)->domid = info->domid;
         (*starting_r)->dom_path = libxl_xs_get_dompath(ctx, info->domid);
         (*starting_r)->for_spawn = NULL;
     }
diff -r 0abcf45319ca tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c Tue Dec 01 15:58:16 2009 +0000
+++ b/tools/libxl/libxl_utils.c Tue Dec 01 15:58:43 2009 +0000
@@ -68,7 +68,7 @@
     for (i = 0; i < num; i++) {
         snprintf(path, sizeof(path), "/local/domain/%s/name", l[i]);
         domname = xs_read(ctx->xsh, XBT_NULL, path, &len);
-        if (domname != NULL && !strncmp(domname, name, len)) {
+        if (domname != NULL && len == strlen(name) && !strncmp(domname, name, 
len)) {
             int domid_i = atoi(l[i]);
             for (j = 0; j < nb_domains; j++) {
                 if (dominfo[j].domid == domid_i) {

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] libxenlight: two small fixes, Stefano Stabellini <=