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] Ensure get_dom_domid() terminates even wh

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Ensure get_dom_domid() terminates even when /local/domain/<foo>/name is
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 24 Aug 2006 14:30:13 +0000
Delivery-date: Thu, 24 Aug 2006 07:30:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 Steven Hand <steven@xxxxxxxxxxxxx>
# Node ID ba3061912d3d92a1d3e5a52f640cbc3e93f41f90
# Parent  1ff4cc298bec6c4fc2a21315f25092ebf3b47117
Ensure get_dom_domid() terminates even when /local/domain/<foo>/name is
not present.

Signed-off-by: Steven Hand <steven@xxxxxxxxxxxxx>
---
 tools/blktap/lib/xs_api.c |    6 +-----
 1 files changed, 1 insertion(+), 5 deletions(-)

diff -r 1ff4cc298bec -r ba3061912d3d tools/blktap/lib/xs_api.c
--- a/tools/blktap/lib/xs_api.c Thu Aug 24 09:49:41 2006 +0100
+++ b/tools/blktap/lib/xs_api.c Thu Aug 24 14:07:01 2006 +0100
@@ -180,8 +180,7 @@ char *get_dom_domid(struct xs_handle *h,
        
        e = xs_directory(h, xth, "/local/domain", &num);
        
-       i = 0;
-       while (i < num) {
+       for (i = 0; (i < num) && (domid == NULL); i++) {
                asprintf(&path, "/local/domain/%s/name", e[i]);
                val = xs_read(h, xth, path, &len);
                free(path);
@@ -192,12 +191,9 @@ char *get_dom_domid(struct xs_handle *h,
                        /* match! */
                        asprintf(&path, "/local/domain/%s/domid", e[i]);
                        domid = xs_read(h, xth, path, &len);
-                       free(val);
                        free(path);
-                       break;
                }
                free(val);
-               i++;
        }
        xs_transaction_end(h, xth, 0);
        

_______________________________________________
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] Ensure get_dom_domid() terminates even when /local/domain/<foo>/name is, Xen patchbot-unstable <=