From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Hoes Subject: [PATCH 01/28] libxl: Add LIBXL_SHUTDOWN_REASON_UNKNOWN Date: Mon, 25 Mar 2013 14:45:02 +0000 Message-ID: <1364222729-6982-2-git-send-email-rob.hoes@citrix.com> References: <1364222729-6982-1-git-send-email-rob.hoes@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1364222729-6982-1-git-send-email-rob.hoes@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: ian.campbell@citrix.com, Ian Campbell , Rob Hoes List-Id: xen-devel@lists.xenproject.org libxl_dominfo.shutdown_reason is valid iff (shutdown||dying). This is a bit annoying when generating language bindings since it needs all sorts of special casing. Just introduce an explicit value instead. Signed-off-by: Ian Campbell Signed-off-by: Rob Hoes --- tools/libxl/libxl.c | 2 +- tools/libxl/libxl_types.idl | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 572c2c6..9c7886a 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -526,7 +526,7 @@ static void xcinfo2xlinfo(const xc_domaininfo_t *xcinfo, if (xlinfo->shutdown || xlinfo->dying) xlinfo->shutdown_reason = (xcinfo->flags>>XEN_DOMINF_shutdownshift) & XEN_DOMINF_shutdownmask; else - xlinfo->shutdown_reason = ~0; + xlinfo->shutdown_reason = LIBXL_SHUTDOWN_REASON_UNKNOWN; xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages); xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages); diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl index f3c212b..4552ca6 100644 --- a/tools/libxl/libxl_types.idl +++ b/tools/libxl/libxl_types.idl @@ -118,14 +118,15 @@ libxl_scheduler = Enumeration("scheduler", [ (7, "arinc653"), ]) -# Consistent with SHUTDOWN_* in sched.h +# Consistent with SHUTDOWN_* in sched.h (apart from UNKNOWN) libxl_shutdown_reason = Enumeration("shutdown_reason", [ + (-1, "unknown"), (0, "poweroff"), (1, "reboot"), (2, "suspend"), (3, "crash"), (4, "watchdog"), - ]) + ], init_val = "LIBXL_SHUTDOWN_REASON_UNKNOWN") libxl_vga_interface_type = Enumeration("vga_interface_type", [ (1, "CIRRUS"), -- 1.7.10.4