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] libxl: during domain destruction, do not

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: during domain destruction, do not complain if no devices dir to destroy
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 29 Jan 2011 15:06:02 -0800
Delivery-date: Sat, 29 Jan 2011 15:13:35 -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 1296239906 0
# Node ID 29eaad8e388aa23993b144f0002c614c565e8e57
# Parent  5eaf9405ed51debda48b6177fdfa7471d52f7d87
libxl: during domain destruction, do not complain if no devices dir to destroy

Previously calling libxl__devices_destroy on a half-constructed or
half-destroyed domain would sometimes complain along these lines:
  libxl: error: libxl_device.c:327:libxl__devices_destroy 
/local/domain/29/device is empty
This is (a) not a reasonable thing to complain about and (b) not an
accurate description of all the things that that particular failure of
libxl__xs_directory might mean.

Change the code to check errno, so that if errno==ENOENT we silently
continue, not destroying any devices, and if errno!=ENOENT, properly
log the problem and fail.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_device.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff -r 5eaf9405ed51 -r 29eaad8e388a tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Fri Jan 28 18:37:25 2011 +0000
+++ b/tools/libxl/libxl_device.c        Fri Jan 28 18:38:26 2011 +0000
@@ -324,8 +324,12 @@ int libxl__devices_destroy(libxl_ctx *ct
     path = libxl__sprintf(&gc, "/local/domain/%d/device", domid);
     l1 = libxl__xs_directory(&gc, XBT_NULL, path, &num1);
     if (!l1) {
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "%s is empty", path);
-        goto out;
+        if (errno != ENOENT) {
+            LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "unable to get xenstore"
+                             " device listing %s", path);
+            goto out;
+        }
+        num1 = 0;
     }
     for (i = 0; i < num1; i++) {
         if (!strcmp("vfs", l1[i]))

_______________________________________________
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] libxl: during domain destruction, do not complain if no devices dir to destroy, Xen patchbot-unstable <=