WARNING - OLD ARCHIVES

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

xen-devel

[Xen-devel] [PATCH 3 of 8] libxl: move type definitions into _libxl_type

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 3 of 8] libxl: move type definitions into _libxl_types.h
From: Ian Campbell <ian.campbell@xxxxxxxxxx>
Date: Tue, 03 Aug 2010 12:00:18 +0100
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
Delivery-date: Tue, 03 Aug 2010 04:05:45 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1280833215@xxxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1280829586 -3600
# Node ID e2888d315d13173ddbd8076b971d71b7deb9ef53
# Parent  81cc53cbda33b5cd4c498c41b3eafd73f16b15e1
libxl: move type definitions into _libxl_types.h

The intention is to autogenerate this file in a future patch. This
pure code motion patch allows for easier before and after comparison
of that patch.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

diff -r 81cc53cbda33 -r e2888d315d13 tools/libxl/Makefile
--- a/tools/libxl/Makefile      Tue Aug 03 10:58:48 2010 +0100
+++ b/tools/libxl/Makefile      Tue Aug 03 10:59:46 2010 +0100
@@ -103,12 +103,15 @@ install: all
        ln -sf libxlutil.so.$(XLUMAJOR).$(XLUMINOR) 
$(DESTDIR)$(LIBDIR)/libxlutil.so.$(XLUMAJOR)
        ln -sf libxlutil.so.$(XLUMAJOR) $(DESTDIR)$(LIBDIR)/libxlutil.so
        $(INSTALL_DATA) libxlutil.a $(DESTDIR)$(LIBDIR)
-       $(INSTALL_DATA) libxl.h $(DESTDIR)$(INCLUDEDIR)
+       $(INSTALL_DATA) libxl.h _libxl_types.h $(DESTDIR)$(INCLUDEDIR)
        $(INSTALL_DATA) bash-completion $(DESTDIR)$(BASH_COMPLETION_DIR)/xl.sh
 
 .PHONY: clean
 clean:
+       # XXX Preserve during transition to autogeneration
+       cp _libxl_types.h SAVED__libxl_types.h
        $(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS)
+       mv SAVED__libxl_types.h _libxl_types.h 
 #      $(RM) -f $(AUTOSRCS) $(AUTOINCS)
 
 distclean: clean
diff -r 81cc53cbda33 -r e2888d315d13 tools/libxl/_libxl_types.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxl/_libxl_types.h        Tue Aug 03 10:59:46 2010 +0100
@@ -0,0 +1,243 @@
+#ifndef __LIBXL_TYPES_H
+#define __LIBXL_TYPES_H
+
+typedef struct {
+    libxl_uuid uuid;
+    uint32_t domid;
+    uint8_t running:1;
+    uint8_t blocked:1;
+    uint8_t paused:1;
+    uint8_t shutdown:1;
+    uint8_t dying:1;
+
+    /*
+     * Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
+     *
+     * Otherwise set to a value guaranteed not to clash with any valid
+     * SHUTDOWN_* constant.
+     */
+    unsigned int shutdown_reason;
+
+    uint64_t max_memkb;
+    uint64_t cpu_time;
+    uint32_t vcpu_max_id;
+    uint32_t vcpu_online;
+} libxl_dominfo;
+
+typedef struct {
+    uint32_t poolid;
+} libxl_poolinfo;
+
+typedef struct {
+    libxl_uuid uuid;
+    uint32_t domid;
+} libxl_vminfo;
+
+typedef struct {
+    int xen_version_major;
+    int xen_version_minor;
+    char *xen_version_extra;
+    char *compiler;
+    char *compile_by;
+    char *compile_domain;
+    char *compile_date;
+    char *capabilities;
+    char *changeset;
+    unsigned long virt_start;
+    unsigned long pagesize;
+    char *commandline;
+} libxl_version_info;
+
+typedef struct {
+    bool hvm;
+    bool hap;
+    bool oos;
+    int ssidref;
+    char *name;
+    libxl_uuid uuid;
+    char **xsdata;
+    char **platformdata;
+    uint32_t poolid;
+    char *poolname;
+} libxl_domain_create_info;
+
+typedef struct {
+    /*
+     * Path is always set if the file refernece is valid. However if
+     * mapped is true then the actual file may already be unlinked.
+     */
+    char *path;
+    int mapped;
+    void *data;
+    size_t size;
+} libxl_file_reference;
+
+/*
+ * Instances of libxl_file_reference contained in this struct which
+ * have been mapped (with libxl_file_reference_map) will be unmapped
+ * by libxl_domain_build/restore. If either of these are never called
+ * then the user is responsible for calling
+ * libxl_file_reference_unmap.
+ */
+typedef struct {
+    int max_vcpus;
+    int cur_vcpus;
+    int tsc_mode;
+    uint32_t max_memkb;
+    uint32_t target_memkb;
+    uint32_t video_memkb;
+    uint32_t shadow_memkb;
+    bool disable_migrate;
+    libxl_file_reference kernel;
+    int hvm;
+    union {
+        struct {
+            bool pae;
+            bool apic;
+            bool acpi;
+            bool nx;
+            bool viridian;
+            char *timeoffset;
+            bool hpet;
+            bool vpt_align;
+            int timer_mode;
+        } hvm;
+        struct {
+            uint32_t   slack_memkb;
+            const char *bootloader;
+            const char *bootloader_args;
+            char *cmdline;
+            libxl_file_reference ramdisk;
+            const char *features;
+        } pv;
+    } u;
+} libxl_domain_build_info;
+
+typedef struct {
+    uint32_t store_port;
+    unsigned long store_mfn;
+    uint32_t console_port;
+    unsigned long console_mfn;
+} libxl_domain_build_state;
+
+typedef struct {
+    int domid;
+    libxl_uuid uuid; /* this is use only with stubdom, and must be different 
from the domain uuid */
+    char *dom_name;
+    char *device_model;
+    char *saved_state;
+    libxl_qemu_machine_type type;
+    int videoram; /* size of the videoram in MB */
+    bool stdvga; /* stdvga enabled or disabled */
+    bool vnc; /* vnc enabled or disabled */
+    char *vnclisten; /* address:port that should be listened on for the VNC 
server if vnc is set */
+    char *vncpasswd; /* the VNC password */
+    int vncdisplay; /* set VNC display number */
+    bool vncunused; /* try to find an unused port for the VNC server */
+    char *keymap; /* set keyboard layout, default is en-us keyboard */
+    bool sdl; /* sdl enabled or disabled */
+    bool opengl; /* opengl enabled or disabled (if enabled requires sdl 
enabled) */
+    bool nographic; /* no graphics, use serial port */
+    char *serial; /* serial port re-direct to pty deivce */
+    char *boot; /* boot order, for example dca */
+    bool usb; /* usb support enabled or disabled */
+    char *usbdevice; /* enable usb mouse: tablet for absolute mouse, mouse for 
PS/2 protocol relative mouse */
+    char *soundhw; /* enable sound hardware */
+    bool apic; /* apic enabled or disabled */
+    int vcpus; /* max number of vcpus */
+    int vcpu_avail; /* vcpus actually available */
+    int xen_platform_pci; /* enable/disable the xen platform pci device */
+    char **extra; /* extra parameters pass directly to qemu, NULL terminated */
+    /* Network is missing */
+} libxl_device_model_info;
+
+typedef struct {
+    uint32_t backend_domid;
+    uint32_t domid;
+    int devid;
+    bool vnc; /* vnc enabled or disabled */
+    char *vnclisten; /* address:port that should be listened on for the VNC 
server if vnc is set */
+    char *vncpasswd; /* the VNC password */
+    int vncdisplay; /* set VNC display number */
+    bool vncunused; /* try to find an unused port for the VNC server */
+    char *keymap; /* set keyboard layout, default is en-us keyboard */
+    bool sdl; /* sdl enabled or disabled */
+    bool opengl; /* opengl enabled or disabled (if enabled requires sdl 
enabled) */
+    char *display;
+    char *xauthority;
+} libxl_device_vfb;
+
+typedef struct {
+    uint32_t backend_domid;
+    uint32_t domid;
+    int devid;
+} libxl_device_vkb;
+
+typedef struct {
+    uint32_t backend_domid;
+    uint32_t domid;
+    int devid;
+    libxl_console_constype constype;
+    libxl_domain_build_state *build_state;
+} libxl_device_console;
+
+typedef struct {
+    uint32_t backend_domid;
+    uint32_t domid;
+    char *physpath;
+    libxl_disk_phystype phystype;
+    char *virtpath;
+    int unpluggable;
+    int readwrite;
+    int is_cdrom;
+} libxl_device_disk;
+
+typedef struct {
+    uint32_t backend_domid;
+    uint32_t domid;
+    int devid;
+    int mtu;
+    char *model;
+    libxl_mac mac;
+    struct in_addr ip;
+    char *bridge;
+    char *ifname;
+    char *script;
+    libxl_nic_type nictype;
+} libxl_device_nic;
+
+typedef struct {
+    int devid;
+    libxl_mac front_mac;
+    libxl_mac back_mac;
+    uint32_t backend_domid;
+    uint32_t domid;
+    uint32_t trusted:1;
+    uint32_t back_trusted:1;
+    uint32_t filter_mac:1;
+    uint32_t front_filter_mac:1;
+    uint32_t pdev;
+    uint32_t max_bypasses;
+    char *bridge;
+} libxl_device_net2;
+
+typedef struct {
+    union {
+        unsigned int value;
+        struct {
+            unsigned int reserved1:2;
+            unsigned int reg:6;
+            unsigned int func:3;
+            unsigned int dev:5;
+            unsigned int bus:8;
+            unsigned int reserved2:7;
+            unsigned int enable:1;
+        };
+    };
+    unsigned int domain;
+    unsigned int vdevfn;
+    bool msitranslate;
+    bool power_mgmt;
+} libxl_device_pci;
+
+#endif /* __LIBXL_TYPES_H */
diff -r 81cc53cbda33 -r e2888d315d13 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h       Tue Aug 03 10:58:48 2010 +0100
+++ b/tools/libxl/libxl.h       Tue Aug 03 10:59:46 2010 +0100
@@ -26,52 +26,31 @@ typedef uint8_t libxl_uuid[16];
 
 typedef uint8_t libxl_mac[6];
 
-typedef struct {
-    libxl_uuid uuid;
-    uint32_t domid;
-    uint8_t running:1;
-    uint8_t blocked:1;
-    uint8_t paused:1;
-    uint8_t shutdown:1;
-    uint8_t dying:1;
+typedef enum {
+    XENFV = 1,
+    XENPV,
+} libxl_qemu_machine_type;
 
-    /*
-     * Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
-     *
-     * Otherwise set to a value guaranteed not to clash with any valid
-     * SHUTDOWN_* constant.
-     */
-    unsigned int shutdown_reason;
+typedef enum {
+    CONSTYPE_XENCONSOLED,
+    CONSTYPE_IOEMU,
+} libxl_console_constype;
 
-    uint64_t max_memkb;
-    uint64_t cpu_time;
-    uint32_t vcpu_max_id;
-    uint32_t vcpu_online;
-} libxl_dominfo;
+typedef enum {
+    PHYSTYPE_QCOW = 1,
+    PHYSTYPE_QCOW2,
+    PHYSTYPE_VHD,
+    PHYSTYPE_AIO,
+    PHYSTYPE_FILE,
+    PHYSTYPE_PHY,
+} libxl_disk_phystype;
 
-typedef struct {
-    uint32_t poolid;
-} libxl_poolinfo;
+typedef enum {
+    NICTYPE_IOEMU = 1,
+    NICTYPE_VIF,
+} libxl_nic_type;
 
-typedef struct {
-    libxl_uuid uuid;
-    uint32_t domid;
-} libxl_vminfo;
-
-typedef struct {
-    int xen_version_major;
-    int xen_version_minor;
-    char *xen_version_extra;
-    char *compiler;
-    char *compile_by;
-    char *compile_domain;
-    char *compile_date;
-    char *capabilities;
-    char *changeset;
-    unsigned long virt_start;
-    unsigned long pagesize;
-    char *commandline;
-} libxl_version_info;
+#include "_libxl_types.h"
 
 typedef struct {
     xentoollog_logger *lg;
@@ -92,227 +71,11 @@ const libxl_version_info* libxl_get_vers
 const libxl_version_info* libxl_get_version_info(libxl_ctx *ctx);
 
 typedef struct {
-    bool hvm;
-    bool hap;
-    bool oos;
-    int ssidref;
-    char *name;
-    libxl_uuid uuid;
-    char **xsdata;
-    char **platformdata;
-    uint32_t poolid;
-    char *poolname;
-} libxl_domain_create_info;
-
-typedef struct {
-    /*
-     * Path is always set if the file refernece is valid. However if
-     * mapped is true then the actual file may already be unlinked.
-     */
-    char *path;
-    int mapped;
-    void *data;
-    size_t size;
-} libxl_file_reference;
-
-/*
- * Instances of libxl_file_reference contained in this struct which
- * have been mapped (with libxl_file_reference_map) will be unmapped
- * by libxl_domain_build/restore. If either of these are never called
- * then the user is responsible for calling
- * libxl_file_reference_unmap.
- */
-typedef struct {
-    int max_vcpus;
-    int cur_vcpus;
-    int tsc_mode;
-    uint32_t max_memkb;
-    uint32_t target_memkb;
-    uint32_t video_memkb;
-    uint32_t shadow_memkb;
-    bool disable_migrate;
-    libxl_file_reference kernel;
-    int hvm;
-    union {
-        struct {
-            bool pae;
-            bool apic;
-            bool acpi;
-            bool nx;
-            bool viridian;
-            char *timeoffset;
-            bool hpet;
-            bool vpt_align;
-            int timer_mode;
-        } hvm;
-        struct {
-            uint32_t   slack_memkb;
-            const char *bootloader;
-            const char *bootloader_args;
-            char *cmdline;
-            libxl_file_reference ramdisk;
-            const char *features;
-        } pv;
-    } u;
-} libxl_domain_build_info;
-
-typedef struct {
-    uint32_t store_port;
-    unsigned long store_mfn;
-    uint32_t console_port;
-    unsigned long console_mfn;
-} libxl_domain_build_state;
-
-typedef struct {
 #define XL_SUSPEND_DEBUG 1
 #define XL_SUSPEND_LIVE 2
     int flags;
     int (*suspend_callback)(void *, int);
 } libxl_domain_suspend_info;
-
-typedef enum {
-    XENFV = 1,
-    XENPV,
-} libxl_qemu_machine_type;
-
-typedef struct {
-    int domid;
-    libxl_uuid uuid; /* this is use only with stubdom, and must be different 
from the domain uuid */
-    char *dom_name;
-    char *device_model;
-    char *saved_state;
-    libxl_qemu_machine_type type;
-    int videoram; /* size of the videoram in MB */
-    bool stdvga; /* stdvga enabled or disabled */
-    bool vnc; /* vnc enabled or disabled */
-    char *vnclisten; /* address:port that should be listened on for the VNC 
server if vnc is set */
-    char *vncpasswd; /* the VNC password */
-    int vncdisplay; /* set VNC display number */
-    bool vncunused; /* try to find an unused port for the VNC server */
-    char *keymap; /* set keyboard layout, default is en-us keyboard */
-    bool sdl; /* sdl enabled or disabled */
-    bool opengl; /* opengl enabled or disabled (if enabled requires sdl 
enabled) */
-    bool nographic; /* no graphics, use serial port */
-    char *serial; /* serial port re-direct to pty deivce */
-    char *boot; /* boot order, for example dca */
-    bool usb; /* usb support enabled or disabled */
-    char *usbdevice; /* enable usb mouse: tablet for absolute mouse, mouse for 
PS/2 protocol relative mouse */
-    char *soundhw; /* enable sound hardware */
-    bool apic; /* apic enabled or disabled */
-    int vcpus; /* max number of vcpus */
-    int vcpu_avail; /* vcpus actually available */
-    int xen_platform_pci; /* enable/disable the xen platform pci device */
-    char **extra; /* extra parameters pass directly to qemu, NULL terminated */
-    /* Network is missing */
-} libxl_device_model_info;
-
-typedef struct {
-    uint32_t backend_domid;
-    uint32_t domid;
-    int devid;
-    bool vnc; /* vnc enabled or disabled */
-    char *vnclisten; /* address:port that should be listened on for the VNC 
server if vnc is set */
-    char *vncpasswd; /* the VNC password */
-    int vncdisplay; /* set VNC display number */
-    bool vncunused; /* try to find an unused port for the VNC server */
-    char *keymap; /* set keyboard layout, default is en-us keyboard */
-    bool sdl; /* sdl enabled or disabled */
-    bool opengl; /* opengl enabled or disabled (if enabled requires sdl 
enabled) */
-    char *display;
-    char *xauthority;
-} libxl_device_vfb;
-
-typedef struct {
-    uint32_t backend_domid;
-    uint32_t domid;
-    int devid;
-} libxl_device_vkb;
-
-typedef enum {
-    CONSTYPE_XENCONSOLED,
-    CONSTYPE_IOEMU,
-} libxl_console_constype;
-
-typedef struct {
-    uint32_t backend_domid;
-    uint32_t domid;
-    int devid;
-    libxl_console_constype constype;
-    libxl_domain_build_state *build_state;
-} libxl_device_console;
-
-typedef enum {
-    PHYSTYPE_QCOW = 1,
-    PHYSTYPE_QCOW2,
-    PHYSTYPE_VHD,
-    PHYSTYPE_AIO,
-    PHYSTYPE_FILE,
-    PHYSTYPE_PHY,
-} libxl_disk_phystype;
-
-typedef struct {
-    uint32_t backend_domid;
-    uint32_t domid;
-    char *physpath;
-    libxl_disk_phystype phystype;
-    char *virtpath;
-    int unpluggable;
-    int readwrite;
-    int is_cdrom;
-} libxl_device_disk;
-
-typedef enum {
-    NICTYPE_IOEMU = 1,
-    NICTYPE_VIF,
-} libxl_nic_type;
-
-typedef struct {
-    uint32_t backend_domid;
-    uint32_t domid;
-    int devid;
-    int mtu;
-    char *model;
-    libxl_mac mac;
-    struct in_addr ip;
-    char *bridge;
-    char *ifname;
-    char *script;
-    libxl_nic_type nictype;
-} libxl_device_nic;
-
-typedef struct {
-    int devid;
-    libxl_mac front_mac;
-    libxl_mac back_mac;
-    uint32_t backend_domid;
-    uint32_t domid;
-    uint32_t trusted:1;
-    uint32_t back_trusted:1;
-    uint32_t filter_mac:1;
-    uint32_t front_filter_mac:1;
-    uint32_t pdev;
-    uint32_t max_bypasses;
-    char *bridge;
-} libxl_device_net2;
-
-typedef struct {
-    union {
-        unsigned int value;
-        struct {
-            unsigned int reserved1:2;
-            unsigned int reg:6;
-            unsigned int func:3;
-            unsigned int dev:5;
-            unsigned int bus:8;
-            unsigned int reserved2:7;
-            unsigned int enable:1;
-        };
-    };
-    unsigned int domain;
-    unsigned int vdevfn;
-    bool msitranslate;
-    bool power_mgmt;
-} libxl_device_pci;
 
 enum {
     ERROR_VERSION = -1,

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel