debuggers.hg

changeset 22830:0592d6ca9177

libxl: do not attempt to write "shutdown" dm-command

libxl_domain_destroy writes the command "shutdown" to the xenstore
node with which it communicates with qemu. However:
- qemu does not understand this command and ignores it (printing a
message)
- libxl doesn't wait for the answer and immediately pauses the domain
anyway
- destroy is the ungraceful (force) operation and should not
negotiate with qemu anyway
- even in the graceful shutdown case, there would actually be nothing
that qemu needs to do.

Under some circumstances, this entry in xenstore will survive the
domain's death, ie be leaked.

So remove the erroneous code.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Ian Jackson <ian.jackson@eu.citrix.com>
date Thu Jan 20 16:32:33 2011 +0000 (2011-01-20)
parents 051a1b1b8f8a
children 3a89585d77b1
files tools/libxl/libxl.c
line diff
     1.1 --- a/tools/libxl/libxl.c	Wed Jan 19 18:24:26 2011 +0000
     1.2 +++ b/tools/libxl/libxl.c	Thu Jan 20 16:32:33 2011 +0000
     1.3 @@ -682,11 +682,6 @@ int libxl_domain_destroy(libxl_ctx *ctx,
     1.4  
     1.5      if (libxl_device_pci_shutdown(ctx, domid) < 0)
     1.6          LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "pci shutdown failed for domid %d", domid);
     1.7 -    if (dm_present) {
     1.8 -        xs_write(ctx->xsh, XBT_NULL,
     1.9 -                 libxl__sprintf(&gc, "/local/domain/0/device-model/%d/command", domid),
    1.10 -                 "shutdown", strlen("shutdown"));
    1.11 -    }
    1.12      rc = xc_domain_pause(ctx->xch, domid);
    1.13      if (rc < 0) {
    1.14          LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc, "xc_domain_pause failed for %d", domid);