From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Hanquez Subject: Re: [PATCH] new commands "xl reboot" & "xl shutdown" Date: Wed, 12 May 2010 17:34:16 +0100 Message-ID: <4BEAD888.7070402@eu.citrix.com> References: <4BE4A40C.8050604@flexiant.com> <4BEACFD8.6080601@flexiant.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4BEACFD8.6080601@flexiant.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Gihan Munasinghe Cc: Xen Devel List-Id: xen-devel@lists.xenproject.org On 12/05/10 16:57, Gihan Munasinghe wrote: > The sleep is still needed, if not libxl_* calls fails sometimes. I'll do > more debugging with in the calls it self and see, but for now the > sleep() seems to do the trick. diff -Naur libxl/libxl.c libxl-patch/libxl.c --- libxl/libxl.c 2010-05-11 09:37:50.000000000 +0100 +++ libxl-patch/libxl.c 2010-05-12 16:24:42.000000000 +0100 @@ -538,12 +538,12 @@ shutdown_path = libxl_sprintf(ctx, "%s/control/shutdown", dom_path); xs_write(ctx->xsh, XBT_NULL, shutdown_path, req_table[req], strlen(req_table[req])); - if (/* hvm */ 0) { + if (/* hvm */ 1) { unsigned long acpi_s_state = 0; unsigned long pvdriver = 0; you can't just switch from 0 to 1, otherwise pv domains will just fails (although i see we're not testing xc_get_hvm_param return values either). the if (/* hvm */ 0) is because the function never properly tested if the domain is hvm or not. nowadays you have is_hvm(domid) function that can handily replace the hardcoded value. -- Vincent