[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: fix removal of secondary consoles


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Sat, 28 Jul 2012 03:00:13 +0000
  • Delivery-date: Sat, 28 Jul 2012 03:00:28 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxx>
# Date 1343317648 -3600
# Node ID fece26a64f9e8c8be2b5a5e49f1fd430340eac8c
# Parent  3666e9712eaf6d4908505cab86e2cfd20d1b72f1
libxl: fix removal of secondary consoles

Secondary consoles are processed by libxl with the rest of the
devices by calling libxl__initiate_device_remove that waits for the
device to reach state 6 before procceeding with the removal.

When libxl is destroying the console devices, Qemu is already dead or
dying, and xenconsoled completely ignores the state backend entry for
console devices, since it performs the cleanup based on the result of
reads/writes to the tty.

Since we don't want to execute hotplug scripts for consoles, leave the
behaviour as it was previously, and just nuke the backend/frontend
xenstore entries by calling libxl__device_destroy.

Report: http://markmail.org/message/yqgppcsdip6tnmh6

Reported-by: Ian Campbell <ian.campbell@xxxxxxxxxxxxx>
Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 3666e9712eaf -r fece26a64f9e tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Thu Jul 26 15:58:18 2012 +0100
+++ b/tools/libxl/libxl_device.c        Thu Jul 26 16:47:28 2012 +0100
@@ -81,6 +81,8 @@ static int libxl__num_devices(libxl__gc 
     for (i = 0; i < num_kinds; i++) {
         if (libxl__device_kind_from_string(kinds[i], &kind))
             continue;
+        if (kind == LIBXL__DEVICE_KIND_CONSOLE)
+            continue;
 
         path = GCSPRINTF("/local/domain/%d/device/%s", domid, kinds[i]);
         devs = libxl__xs_directory(gc, XBT_NULL, path, &num_devs);
@@ -522,10 +524,18 @@ void libxl__devices_destroy(libxl__egc *
             path = libxl__xs_read(gc, XBT_NULL, path);
             GCNEW(dev);
             if (path && libxl__parse_backend_path(gc, path, dev) == 0) {
-                aodev = &aodevs->array[numdev];
                 dev->domid = domid;
                 dev->kind = kind;
                 dev->devid = atoi(devs[j]);
+                if (dev->backend_kind == LIBXL__DEVICE_KIND_CONSOLE) {
+                    /* Currently console devices can be destroyed
+                     * synchronously by just removing xenstore entries,
+                     * this is what libxl__device_destroy does.
+                     */
+                    libxl__device_destroy(gc, dev);
+                    continue;
+                }
+                aodev = &aodevs->array[numdev];
                 aodev->action = DEVICE_DISCONNECT;
                 aodev->dev = dev;
                 aodev->callback = libxl__ao_devices_callback;

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.