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/
Home Products Support Community News


Re: [Xen-devel] [PATCH] new commands "xl reboot" & "xl shutdown"

To: Gihan Munasinghe <GMunasinghe@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] new commands "xl reboot" & "xl shutdown"
From: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
Date: Wed, 12 May 2010 17:34:16 +0100
Cc: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 12 May 2010 09:35:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4BEACFD8.6080601@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4BE4A40C.8050604@xxxxxxxxxxxx> <alpine.DEB.2.00.1005101607020.11380@kaball-desktop> <4BEACFD8.6080601@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100411 Icedove/3.0.4
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.


Xen-devel mailing list