debuggers.hg

changeset 20844:94442ca0423d

libxenlight: initialize enum to 1, to prevent defaulting to the 0
values when structure when not properly initialized by the client.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jan 14 09:40:55 2010 +0000 (2010-01-14)
parents 517364d0823d
children fd8707f8698d
files tools/libxl/libxl.h tools/libxl/libxl_internal.h
line diff
     1.1 --- a/tools/libxl/libxl.h	Thu Jan 14 09:40:01 2010 +0000
     1.2 +++ b/tools/libxl/libxl.h	Thu Jan 14 09:40:55 2010 +0000
     1.3 @@ -104,7 +104,7 @@ typedef struct {
     1.4  } libxl_domain_suspend_info;
     1.5  
     1.6  typedef enum {
     1.7 -    XENFV,
     1.8 +    XENFV = 1,
     1.9      XENPV,
    1.10  } libxl_qemu_machine_type;
    1.11  
    1.12 @@ -169,7 +169,7 @@ typedef struct {
    1.13  } libxl_device_console;
    1.14  
    1.15  typedef enum {
    1.16 -    PHYSTYPE_QCOW,
    1.17 +    PHYSTYPE_QCOW = 1,
    1.18      PHYSTYPE_QCOW2,
    1.19      PHYSTYPE_VHD,
    1.20      PHYSTYPE_AIO,
    1.21 @@ -189,7 +189,7 @@ typedef struct {
    1.22  } libxl_device_disk;
    1.23  
    1.24  typedef enum {
    1.25 -    NICTYPE_IOEMU,
    1.26 +    NICTYPE_IOEMU = 1,
    1.27      NICTYPE_VIF,
    1.28  } libxl_nic_type;
    1.29  
     2.1 --- a/tools/libxl/libxl_internal.h	Thu Jan 14 09:40:01 2010 +0000
     2.2 +++ b/tools/libxl/libxl_internal.h	Thu Jan 14 09:40:55 2010 +0000
     2.3 @@ -59,7 +59,7 @@ void xl_log(struct libxl_ctx *ctx, int e
     2.4  
     2.5  
     2.6  typedef enum {
     2.7 -    DEVICE_VIF,
     2.8 +    DEVICE_VIF = 1,
     2.9      DEVICE_VBD,
    2.10      DEVICE_TAP,
    2.11      DEVICE_PCI,