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-4.1-testing] libxl: Remove frontend and backend dev

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] libxl: Remove frontend and backend devices from xenstore after destroy
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Wed, 31 Aug 2011 09:22:22 +0100
Delivery-date: Wed, 31 Aug 2011 01:25:50 -0700
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 Marek Marczykowski <marmarek@xxxxxxxxxxxx>
# Date 1307285159 -7200
# Node ID d4d0621cf325d8a9efb1c5ea91c2a5a909954932
# Parent  e5dd58f9bee1d7c96f3595c2548ae96366154421
libxl: Remove frontend and backend devices from xenstore after destroy

Cleanup frontend and backend devices from xenstore for all dev types - not only
disks. Because backend cleanup moved to libxl__device_destroy,
libxl__devices_destroy is somehow simpler.

Signed-off-by: Marek Marczykowski <marmarek@xxxxxxxxxxxx>

xen-unstable changest: 23605:ff8d170852b3
Backport-requested-by: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r e5dd58f9bee1 -r d4d0621cf325 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Tue Aug 30 17:23:19 2011 +0100
+++ b/tools/libxl/libxl_device.c        Sun Jun 05 16:45:59 2011 +0200
@@ -269,7 +269,9 @@
     if (!force) {
         xs_watch(ctx->xsh, state_path, be_path);
         rc = 1;
-    }
+    } else {
+               xs_rm(ctx->xsh, XBT_NULL, be_path);
+       }
 out:
     libxl__free_all(&gc);
     return rc;
@@ -310,10 +312,8 @@
     char *path, *be_path, *fe_path;
     unsigned int num1, num2;
     char **l1 = NULL, **l2 = NULL;
-    int i, j, n = 0, n_watches = 0;
-    flexarray_t *toremove;
+    int i, j, n_watches = 0;
 
-    toremove = flexarray_make(16, 1);
     path = libxl__sprintf(&gc, "/local/domain/%d/device", domid);
     l1 = libxl__xs_directory(&gc, XBT_NULL, path, &num1);
     if (!l1) {
@@ -337,7 +337,6 @@
             if (be_path != NULL) {
                 if (libxl__device_destroy(ctx, be_path, force) > 0)
                     n_watches++;
-                flexarray_set(toremove, n++, libxl__dirname(&gc, be_path));
             } else {
                 xs_rm(ctx->xsh, XBT_NULL, path);
             }
@@ -350,7 +349,6 @@
     if (be_path && strcmp(be_path, "")) {
         if (libxl__device_destroy(ctx, be_path, force) > 0)
             n_watches++;
-        flexarray_set(toremove, n++, libxl__dirname(&gc, be_path));
     }
 
     if (!force) {
@@ -370,12 +368,7 @@
             }
         }
     }
-    for (i = 0; i < n; i++) {
-        flexarray_get(toremove, i, (void**) &path);
-        xs_rm(ctx->xsh, XBT_NULL, path);
-    }
 out:
-    flexarray_free(toremove);
     libxl__free_all(&gc);
     return 0;
 }
@@ -401,6 +394,7 @@
         (void)wait_for_dev_destroy(ctx, &tv);
     }
 
+    xs_rm(ctx->xsh, XBT_NULL, libxl__device_frontend_path(&gc, dev));
     rc = 0;
 
 out:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.1-testing] libxl: Remove frontend and backend devices from xenstore after destroy, Xen patchbot-4 . 1-testing <=