debuggers.hg

changeset 20824:182883d9acbe

libxenlight: initialize domid to -1 in domain_create

prevent call site that doesn't check return values to try to do
operation on domain 0.
instead they use domid -1, which is unlikely to exist.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jan 08 11:48:36 2010 +0000 (2010-01-08)
parents b35974051d7e
children 596f7893b5ac
files tools/libxl/libxl.c
line diff
     1.1 --- a/tools/libxl/libxl.c	Fri Jan 08 11:48:02 2010 +0000
     1.2 +++ b/tools/libxl/libxl.c	Fri Jan 08 11:48:36 2010 +0000
     1.3 @@ -99,7 +99,7 @@ int libxl_domain_make(struct libxl_ctx *
     1.4  
     1.5      flags = info->hvm ? XEN_DOMCTL_CDF_hvm_guest : 0;
     1.6      flags |= info->hap ? XEN_DOMCTL_CDF_hap : 0;
     1.7 -    *domid = 0;
     1.8 +    *domid = -1;
     1.9  
    1.10      /* Ultimately, handle is an array of 16 uint8_t, same as uuid */
    1.11      memcpy(handle, info->uuid, sizeof(xen_domain_handle_t));