ia64/xen-unstable

changeset 14915:605aa81d7341

Merge with xen-ia64-unstable.hg
author Keir Fraser <keir@xensource.com>
date Tue Apr 24 21:39:23 2007 +0100 (2007-04-24)
parents 9313d0ce09f8 c1d3f4fbfacf
children d0ebd5588b28
files tools/libxen/include/xen_common.h tools/libxen/include/xen_console.h tools/libxen/include/xen_console_decl.h tools/libxen/include/xen_console_protocol.h tools/libxen/include/xen_crashdump.h tools/libxen/include/xen_crashdump_decl.h tools/libxen/include/xen_event.h tools/libxen/include/xen_event_decl.h tools/libxen/include/xen_event_operation.h tools/libxen/include/xen_host.h tools/libxen/include/xen_host_cpu.h tools/libxen/include/xen_host_cpu_decl.h tools/libxen/include/xen_host_decl.h tools/libxen/include/xen_host_metrics.h tools/libxen/include/xen_host_metrics_decl.h tools/libxen/include/xen_int_float_map.h tools/libxen/include/xen_int_int_map.h tools/libxen/include/xen_int_string_set_map.h tools/libxen/include/xen_network.h tools/libxen/include/xen_network_decl.h tools/libxen/include/xen_on_crash_behaviour.h tools/libxen/include/xen_on_normal_exit.h tools/libxen/include/xen_pbd.h tools/libxen/include/xen_pbd_decl.h tools/libxen/include/xen_pif.h tools/libxen/include/xen_pif_decl.h tools/libxen/include/xen_pif_metrics.h tools/libxen/include/xen_pif_metrics_decl.h tools/libxen/include/xen_sr.h tools/libxen/include/xen_sr_decl.h tools/libxen/include/xen_string_set.h tools/libxen/include/xen_string_string_map.h tools/libxen/include/xen_user.h tools/libxen/include/xen_user_decl.h tools/libxen/include/xen_vbd.h tools/libxen/include/xen_vbd_decl.h tools/libxen/include/xen_vbd_metrics.h tools/libxen/include/xen_vbd_metrics_decl.h tools/libxen/include/xen_vbd_mode.h tools/libxen/include/xen_vbd_type.h tools/libxen/include/xen_vdi.h tools/libxen/include/xen_vdi_decl.h tools/libxen/include/xen_vdi_type.h tools/libxen/include/xen_vif.h tools/libxen/include/xen_vif_decl.h tools/libxen/include/xen_vif_metrics.h tools/libxen/include/xen_vif_metrics_decl.h tools/libxen/include/xen_vm.h tools/libxen/include/xen_vm_decl.h tools/libxen/include/xen_vm_guest_metrics.h tools/libxen/include/xen_vm_guest_metrics_decl.h tools/libxen/include/xen_vm_metrics.h tools/libxen/include/xen_vm_metrics_decl.h tools/libxen/include/xen_vm_power_state.h tools/libxen/include/xen_vtpm.h tools/libxen/include/xen_vtpm_decl.h tools/libxen/test/test_hvm_bindings.c
line diff
     1.1 --- a/.hgignore	Tue Apr 24 09:26:32 2007 -0600
     1.2 +++ b/.hgignore	Tue Apr 24 21:39:23 2007 +0100
     1.3 @@ -126,6 +126,7 @@
     1.4  ^tools/ioemu/qemu\.1$
     1.5  ^tools/ioemu/qemu\.pod$
     1.6  ^tools/libxc/xen/.*$
     1.7 +^tools/libxen/libxenapi-
     1.8  ^tools/libxen/test/test_bindings$
     1.9  ^tools/libxen/test/test_event_handling$
    1.10  ^tools/libaio/src/.*\.ol$
     2.1 --- a/docs/xen-api/xenapi-coversheet.tex	Tue Apr 24 09:26:32 2007 -0600
     2.2 +++ b/docs/xen-api/xenapi-coversheet.tex	Tue Apr 24 21:39:23 2007 +0100
     2.3 @@ -17,12 +17,12 @@
     2.4  \newcommand{\coversheetlogo}{xen.eps}
     2.5  
     2.6  %% Document date
     2.7 -\newcommand{\datestring}{5th April 2007}
     2.8 +\newcommand{\datestring}{21st April 2007}
     2.9  
    2.10  \newcommand{\releasestatement}{Candidate for Release\\Comments are welcome!}
    2.11  
    2.12  %% Document revision
    2.13 -\newcommand{\revstring}{API Revision 0.9.0}
    2.14 +\newcommand{\revstring}{API Revision 0.9.1}
    2.15  
    2.16  %% Document authors
    2.17  \newcommand{\docauthors}{
     3.1 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Tue Apr 24 09:26:32 2007 -0600
     3.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c	Tue Apr 24 21:39:23 2007 +0100
     3.3 @@ -252,8 +252,11 @@ int netif_be_start_xmit(struct sk_buff *
     3.4  	/*
     3.5  	 * Copy the packet here if it's destined for a flipping interface
     3.6  	 * but isn't flippable (e.g. extra references to data).
     3.7 +	 * XXX For now we also copy skbuffs whose head crosses a page
     3.8 +	 * boundary, because netbk_gop_skb can't handle them.
     3.9  	 */
    3.10 -	if (!netif->copying_receiver) {
    3.11 +	if (!netif->copying_receiver ||
    3.12 +	    ((skb_headlen(skb) + offset_in_page(skb->data)) >= PAGE_SIZE)) {
    3.13  		struct sk_buff *nskb = netbk_copy_skb(skb);
    3.14  		if ( unlikely(nskb == NULL) )
    3.15  			goto drop;
    3.16 @@ -425,8 +428,9 @@ static void netbk_gop_skb(struct sk_buff
    3.17  	}
    3.18  
    3.19  	/*
    3.20 -	 * This must occur at the end to ensure that we don't trash
    3.21 -	 * skb_shinfo until we're done.
    3.22 +	 * This must occur at the end to ensure that we don't trash skb_shinfo
    3.23 +	 * until we're done. We know that the head doesn't cross a page
    3.24 +	 * boundary because such packets get copied in netif_be_start_xmit.
    3.25  	 */
    3.26  	head_meta->id = netbk_gop_frag(netif, head_meta, 0, npo,
    3.27  				       virt_to_page(skb->data),
     4.1 --- a/tools/blktap/drivers/blktapctrl.c	Tue Apr 24 09:26:32 2007 -0600
     4.2 +++ b/tools/blktap/drivers/blktapctrl.c	Tue Apr 24 21:39:23 2007 +0100
     4.3 @@ -177,14 +177,14 @@ static int get_tapdisk_pid(blkif_t *blki
     4.4   *   return 0 on success, -1 on error.
     4.5   */
     4.6  
     4.7 -static int test_path(char *path, char **dev, int *type, blkif_t *blkif)
     4.8 +static int test_path(char *path, char **dev, int *type, blkif_t **blkif)
     4.9  {
    4.10  	char *ptr, handle[10];
    4.11  	int i, size, found = 0;
    4.12  
    4.13  	size = sizeof(dtypes)/sizeof(disk_info_t *);
    4.14  	*type = MAX_DISK_TYPES + 1;
    4.15 -        blkif = NULL;
    4.16 +        *blkif = NULL;
    4.17  
    4.18  	if ( (ptr = strstr(path, ":"))!=NULL) {
    4.19  		memcpy(handle, path, (ptr - path));
    4.20 @@ -207,9 +207,9 @@ static int test_path(char *path, char **
    4.21                                  /* Check whether tapdisk process 
    4.22                                     already exists */
    4.23                                  if (active_disks[dtypes[i]->idnum] == NULL) 
    4.24 -                                        blkif = NULL;
    4.25 +                                        *blkif = NULL;
    4.26                                  else 
    4.27 -                                        blkif = active_disks[dtypes[i]
    4.28 +                                        *blkif = active_disks[dtypes[i]
    4.29                                                               ->idnum]->blkif;
    4.30                          }
    4.31                          return 0;
    4.32 @@ -478,27 +478,30 @@ int blktapctrl_new_blkif(blkif_t *blkif)
    4.33  	char *rdctldev, *wrctldev, *cmd, *ptr;
    4.34  	image_t *image;
    4.35  	blkif_t *exist = NULL;
    4.36 +	static uint16_t next_cookie = 0;
    4.37  
    4.38  	DPRINTF("Received a poll for a new vbd\n");
    4.39  	if ( ((blk=blkif->info) != NULL) && (blk->params != NULL) ) {
    4.40  		if (get_new_dev(&major, &minor, blkif)<0)
    4.41  			return -1;
    4.42  
    4.43 -		if (test_path(blk->params, &ptr, &type, exist) != 0) {
    4.44 +		if (test_path(blk->params, &ptr, &type, &exist) != 0) {
    4.45                          DPRINTF("Error in blktap device string(%s).\n",
    4.46                                  blk->params);
    4.47                          return -1;
    4.48                  }
    4.49  		blkif->drivertype = type;
    4.50 -		blkif->cookie = lrand48() % MAX_RAND_VAL;
    4.51 +		blkif->cookie = next_cookie++;
    4.52  
    4.53  		if (!exist) {
    4.54  			DPRINTF("Process does not exist:\n");
    4.55 -			asprintf(&rdctldev, "/dev/xen/tapctrlread%d", minor);
    4.56 +			asprintf(&rdctldev, 
    4.57 +				 "%s/tapctrlread%d", BLKTAP_DEV_DIR, minor);
    4.58  			blkif->fds[READ] = open_ctrl_socket(rdctldev);
    4.59  
    4.60  
    4.61 -			asprintf(&wrctldev, "/dev/xen/tapctrlwrite%d", minor);
    4.62 +			asprintf(&wrctldev, 
    4.63 +				 "%s/tapctrlwrite%d", BLKTAP_DEV_DIR, minor);
    4.64  			blkif->fds[WRITE] = open_ctrl_socket(wrctldev);
    4.65  			
    4.66  			if (blkif->fds[READ] == -1 || blkif->fds[WRITE] == -1) 
     5.1 --- a/tools/blktap/lib/blktaplib.h	Tue Apr 24 09:26:32 2007 -0600
     5.2 +++ b/tools/blktap/lib/blktaplib.h	Tue Apr 24 21:39:23 2007 +0100
     5.3 @@ -78,7 +78,7 @@ static inline int BLKTAP_MODE_VALID(unsi
     5.4  
     5.5  #define BLKTAP_IOCTL_KICK 1
     5.6  #define MAX_PENDING_REQS	BLK_RING_SIZE
     5.7 -#define BLKTAP_DEV_DIR   "/dev/xen"
     5.8 +#define BLKTAP_DEV_DIR   "/var/run/tap"
     5.9  #define BLKTAP_DEV_NAME  "blktap"
    5.10  #define BLKTAP_DEV_MINOR 0
    5.11  
     6.1 --- a/tools/firmware/hvmloader/util.c	Tue Apr 24 09:26:32 2007 -0600
     6.2 +++ b/tools/firmware/hvmloader/util.c	Tue Apr 24 21:39:23 2007 +0100
     6.3 @@ -295,7 +295,7 @@ static void e820_collapse(void)
     6.4               ((ent[i].addr + ent[i].size) == ent[i+1].addr) )
     6.5          {
     6.6              ent[i].size += ent[i+1].size;
     6.7 -            memcpy(&ent[i+1], &ent[i+2], *E820_MAP_NR - i - 2);
     6.8 +            memcpy(&ent[i+1], &ent[i+2], (*E820_MAP_NR-i-2) * sizeof(*ent));
     6.9              (*E820_MAP_NR)--;
    6.10          }
    6.11          else
    6.12 @@ -322,10 +322,10 @@ uint32_t e820_malloc(uint32_t size)
    6.13               (addr != ent[i].addr) ||     /* starts above 4gb? */
    6.14               ((addr + size) < addr) )     /* ends above 4gb? */
    6.15              continue;
    6.16 -        
    6.17 +
    6.18          if ( ent[i].size != size )
    6.19          {
    6.20 -            memmove(&ent[i+1], &ent[i], (*E820_MAP_NR - i) * sizeof(*ent));
    6.21 +            memmove(&ent[i+1], &ent[i], (*E820_MAP_NR-i) * sizeof(*ent));
    6.22              (*E820_MAP_NR)++;
    6.23              ent[i].size -= size;
    6.24              addr += ent[i].size;
     7.1 --- a/tools/firmware/rombios/32bit/util.c	Tue Apr 24 09:26:32 2007 -0600
     7.2 +++ b/tools/firmware/rombios/32bit/util.c	Tue Apr 24 21:39:23 2007 +0100
     7.3 @@ -394,57 +394,17 @@ int vprintf(const char *fmt, va_list ap)
     7.4      return 0;
     7.5  }
     7.6  
     7.7 -
     7.8 -/*
     7.9 - * sleep by synchronizing with the PIT on channel 2
    7.10 - * http://bochs.sourceforge.net/techspec/intel-82c54-timer.pdf.gz
    7.11 - */
    7.12 -#define PIT_CTR2       0x80
    7.13 -#define PIT_CTR1       0x40
    7.14 -#define PIT_CTR0       0x00
    7.15 -
    7.16 -#define PIT_RW_LSB     0x10
    7.17 -
    7.18 -#define PIT_MODE0      0x0
    7.19 -
    7.20 -#define PIT_CTR_16BIT  0x0
    7.21 -
    7.22 -#define PIT_CMD_LATCH  0x0
    7.23 -
    7.24 -#define PORT_PIT_CMD     0x43
    7.25 -#define PORT_PIT_CTR2    0x42
    7.26 -#define PORT_PIT_CTR1    0x41
    7.27 -#define PORT_PIT_CTR0    0x40
    7.28 -
    7.29 -#define PIT_FREQ         1193182 /* Hz */
    7.30 -
    7.31 -#define PORT_PPI         0x61
    7.32 -
    7.33  void mssleep(uint32_t waittime)
    7.34  {
    7.35 -	long int timeout = 0;
    7.36 -	uint8_t last = 0x0;
    7.37 -	uint8_t old_ppi = inb(PORT_PPI);
    7.38 -
    7.39 -	/* use ctr2; ctr0 is used by the Bochs BIOS */
    7.40 -	/* ctr2 drives speaker -- turn it off */
    7.41 -	outb(PORT_PPI, old_ppi & 0xfc);
    7.42 -
    7.43 -	outb(PORT_PIT_CMD, PIT_CTR2 | PIT_RW_LSB | PIT_MODE0 | PIT_CTR_16BIT);
    7.44 -	outb(PORT_PIT_CTR2, last);         /* start countdown */
    7.45 +    uint32_t i;
    7.46 +    uint8_t  x, y = inb(0x61) & 0x10;
    7.47  
    7.48 -	while (timeout < (waittime * PIT_FREQ / 1000)) {
    7.49 -		uint8_t cur, delta;
    7.50 -		outb(PORT_PIT_CMD, PIT_CTR2 | PIT_CMD_LATCH);
    7.51 -		cur = inb(PORT_PIT_CTR2);
    7.52 -		delta = last - cur;
    7.53 -		timeout += delta;
    7.54 -		last = cur;
    7.55 -	}
    7.56 -	/* turn ctr2 off */
    7.57 -	outb(PORT_PIT_CMD, PIT_CTR2 | PIT_RW_LSB | PIT_MODE0 | PIT_CTR_16BIT);
    7.58 -	outb(PORT_PIT_CTR2, 0xff); /* start countdown */
    7.59 -	outb(PORT_PIT_CTR2, 0x0);  /* stop */
    7.60 -
    7.61 -	outb(PORT_PPI, old_ppi);
    7.62 +    /* Poll the DRAM refresh timer: I/O port 61h, bit 4 toggles every 15us. */
    7.63 +    waittime *= 67; /* Convert milliseconds to multiples of 15us. */
    7.64 +    for ( i = 0; i < waittime; i++ )
    7.65 +    {
    7.66 +        while ( (x = inb(0x61) & 0x10) == y )
    7.67 +            continue;
    7.68 +        y = x;
    7.69 +    }
    7.70  }
     8.1 --- a/tools/firmware/rombios/rombios.c	Tue Apr 24 09:26:32 2007 -0600
     8.2 +++ b/tools/firmware/rombios/rombios.c	Tue Apr 24 21:39:23 2007 +0100
     8.3 @@ -4157,15 +4157,10 @@ BX_DEBUG_INT15("int15 AX=%04x\n",regs.u.
     8.4        DX = regs.u.r16.dx;
     8.5  
     8.6  ASM_START
     8.7 -      sti
     8.8 -
     8.9        ;; Get the count in eax
    8.10 -      mov  bx, sp
    8.11 -      SEG SS
    8.12 -        mov  ax, _int15_function.CX [bx]
    8.13 +      mov  ax, .int15_function32.CX [bp]
    8.14        shl  eax, #16
    8.15 -      SEG SS
    8.16 -        mov  ax, _int15_function.DX [bx]
    8.17 +      mov  ax, .int15_function32.DX [bp]
    8.18  
    8.19        ;; convert to numbers of 15usec ticks
    8.20        mov ebx, #15
     9.1 --- a/tools/ioemu/block.c	Tue Apr 24 09:26:32 2007 -0600
     9.2 +++ b/tools/ioemu/block.c	Tue Apr 24 21:39:23 2007 +0100
     9.3 @@ -420,6 +420,8 @@ int bdrv_read(BlockDriverState *bs, int6
     9.4  
     9.5      if (!bs->inserted)
     9.6          return -1;
     9.7 +    if (sector_num < 0)
     9.8 +	return -1;
     9.9  
    9.10      while (nb_sectors > 0) {
    9.11          if (sector_num == 0 && bs->boot_sector_enabled) {
    9.12 @@ -458,6 +460,8 @@ int bdrv_write(BlockDriverState *bs, int
    9.13          return -1;
    9.14      if (bs->read_only)
    9.15          return -1;
    9.16 +    if (sector_num < 0)
    9.17 +	return -1;
    9.18      if (sector_num == 0 && bs->boot_sector_enabled && nb_sectors > 0) {
    9.19          memcpy(bs->boot_sector_data, buf, 512);   
    9.20      }
    10.1 --- a/tools/ioemu/hw/cirrus_vga.c	Tue Apr 24 09:26:32 2007 -0600
    10.2 +++ b/tools/ioemu/hw/cirrus_vga.c	Tue Apr 24 21:39:23 2007 +0100
    10.3 @@ -601,7 +601,8 @@ static void cirrus_invalidate_region(Cir
    10.4  	off_cur_end = off_cur + bytesperline;
    10.5  	off_cur &= TARGET_PAGE_MASK;
    10.6  	while (off_cur < off_cur_end) {
    10.7 -	    cpu_physical_memory_set_dirty(s->vram_offset + off_cur);
    10.8 +	    cpu_physical_memory_set_dirty(s->vram_offset +
    10.9 +					  (off_cur & s->cirrus_addr_mask));
   10.10  	    off_cur += TARGET_PAGE_SIZE;
   10.11  	}
   10.12  	off_begin += off_pitch;
    11.1 --- a/tools/ioemu/hw/cirrus_vga_rop.h	Tue Apr 24 09:26:32 2007 -0600
    11.2 +++ b/tools/ioemu/hw/cirrus_vga_rop.h	Tue Apr 24 21:39:23 2007 +0100
    11.3 @@ -22,18 +22,36 @@
    11.4   * THE SOFTWARE.
    11.5   */
    11.6  
    11.7 +#define get_base(p, s, b) do { \
    11.8 +    if ((p) >= (s)->vram_ptr && (p) < (s)->vram_ptr + (s)->vram_size) \
    11.9 +	(b) = (s)->vram_ptr; \
   11.10 +    else if ((p) >= &(s)->cirrus_bltbuf[0] && \
   11.11 +	     (p) < &(s)->cirrus_bltbuf[CIRRUS_BLTBUFSIZE]) \
   11.12 +	(b) = &(s)->cirrus_bltbuf[0]; \
   11.13 +    else \
   11.14 +	return; \
   11.15 +} while(0)
   11.16 +
   11.17 +#define m(x) ((x) & s->cirrus_addr_mask)
   11.18 +
   11.19  static void
   11.20  glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s,
   11.21 -                             uint8_t *dst,const uint8_t *src,
   11.22 +                             uint8_t *dst_,const uint8_t *src_,
   11.23                               int dstpitch,int srcpitch,
   11.24                               int bltwidth,int bltheight)
   11.25  {
   11.26      int x,y;
   11.27 +    uint32_t dst, src;
   11.28 +    uint8_t *dst_base, *src_base;
   11.29 +    get_base(dst_, s, dst_base);
   11.30 +    get_base(src_, s, src_base);
   11.31 +    dst = dst_ - dst_base;
   11.32 +    src = src_ - src_base;
   11.33      dstpitch -= bltwidth;
   11.34      srcpitch -= bltwidth;
   11.35      for (y = 0; y < bltheight; y++) {
   11.36          for (x = 0; x < bltwidth; x++) {
   11.37 -            ROP_OP(*dst, *src);
   11.38 +            ROP_OP(*(dst_base + m(dst)), *(src_base + m(src)));
   11.39              dst++;
   11.40              src++;
   11.41          }
   11.42 @@ -44,16 +62,22 @@ glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(C
   11.43  
   11.44  static void
   11.45  glue(cirrus_bitblt_rop_bkwd_, ROP_NAME)(CirrusVGAState *s,
   11.46 -                                        uint8_t *dst,const uint8_t *src,
   11.47 +                                        uint8_t *dst_,const uint8_t *src_,
   11.48                                          int dstpitch,int srcpitch,
   11.49                                          int bltwidth,int bltheight)
   11.50  {
   11.51      int x,y;
   11.52 +    uint32_t dst, src;
   11.53 +    uint8_t *dst_base, *src_base;
   11.54 +    get_base(dst_, s, dst_base);
   11.55 +    get_base(src_, s, src_base);
   11.56 +    dst = dst_ - dst_base;
   11.57 +    src = src_ - src_base;
   11.58      dstpitch += bltwidth;
   11.59      srcpitch += bltwidth;
   11.60      for (y = 0; y < bltheight; y++) {
   11.61          for (x = 0; x < bltwidth; x++) {
   11.62 -            ROP_OP(*dst, *src);
   11.63 +            ROP_OP(*(dst_base + m(dst)), *(src_base + m(src)));
   11.64              dst--;
   11.65              src--;
   11.66          }
   11.67 @@ -76,3 +100,6 @@ glue(cirrus_bitblt_rop_bkwd_, ROP_NAME)(
   11.68  
   11.69  #undef ROP_NAME
   11.70  #undef ROP_OP
   11.71 +
   11.72 +#undef get_base
   11.73 +#undef m
    12.1 --- a/tools/ioemu/hw/cirrus_vga_rop2.h	Tue Apr 24 09:26:32 2007 -0600
    12.2 +++ b/tools/ioemu/hw/cirrus_vga_rop2.h	Tue Apr 24 21:39:23 2007 +0100
    12.3 @@ -23,36 +23,42 @@
    12.4   */
    12.5  
    12.6  #if DEPTH == 8
    12.7 -#define PUTPIXEL()    ROP_OP(d[0], col)
    12.8 +#define PUTPIXEL()    ROP_OP((dst_base + m(d))[0], col)
    12.9  #elif DEPTH == 16
   12.10 -#define PUTPIXEL()    ROP_OP(((uint16_t *)d)[0], col);
   12.11 +#define PUTPIXEL()    ROP_OP(((uint16_t *)(dst_base + m(d)))[0], col);
   12.12  #elif DEPTH == 24
   12.13 -#define PUTPIXEL()    ROP_OP(d[0], col); \
   12.14 -                      ROP_OP(d[1], (col >> 8)); \
   12.15 -                      ROP_OP(d[2], (col >> 16))
   12.16 +#define PUTPIXEL()    ROP_OP((dst_base + m(d))[0], col); \
   12.17 +                      ROP_OP((dst_base + m(d))[1], (col >> 8)); \
   12.18 +                      ROP_OP((dst_base + m(d))[2], (col >> 16))
   12.19  #elif DEPTH == 32
   12.20 -#define PUTPIXEL()    ROP_OP(((uint32_t *)d)[0], col)
   12.21 +#define PUTPIXEL()    ROP_OP(((uint32_t *)(dst_base + m(d)))[0], col)
   12.22  #else
   12.23  #error unsupported DEPTH
   12.24  #endif                
   12.25  
   12.26  static void
   12.27  glue(glue(glue(cirrus_patternfill_, ROP_NAME), _),DEPTH)
   12.28 -     (CirrusVGAState * s, uint8_t * dst,
   12.29 -      const uint8_t * src, 
   12.30 +     (CirrusVGAState * s, uint8_t * dst_,
   12.31 +      const uint8_t * src_, 
   12.32        int dstpitch, int srcpitch, 
   12.33        int bltwidth, int bltheight)
   12.34  {
   12.35 -    uint8_t *d;
   12.36 +    uint8_t *dst_base, *src_base;
   12.37 +    uint32_t src, dst;
   12.38 +    uint32_t d;
   12.39      int x, y, pattern_y, pattern_pitch, pattern_x;
   12.40      unsigned int col;
   12.41 -    const uint8_t *src1;
   12.42 +    uint32_t src1;
   12.43  #if DEPTH == 24
   12.44      int skipleft = s->gr[0x2f] & 0x1f;
   12.45  #else
   12.46      int skipleft = (s->gr[0x2f] & 0x07) * (DEPTH / 8);
   12.47  #endif
   12.48  
   12.49 +    get_base(dst_, s, dst_base);
   12.50 +    get_base(src_, s, src_base);
   12.51 +    dst = dst_ - dst_base;
   12.52 +    src = src_ - src_base;
   12.53  #if DEPTH == 8
   12.54      pattern_pitch = 8;
   12.55  #elif DEPTH == 16
   12.56 @@ -67,19 +73,19 @@ glue(glue(glue(cirrus_patternfill_, ROP_
   12.57          src1 = src + pattern_y * pattern_pitch;
   12.58          for (x = skipleft; x < bltwidth; x += (DEPTH / 8)) {
   12.59  #if DEPTH == 8
   12.60 -            col = src1[pattern_x];
   12.61 +            col = *(src_base + m(src1 + pattern_x));
   12.62              pattern_x = (pattern_x + 1) & 7;
   12.63  #elif DEPTH == 16
   12.64 -            col = ((uint16_t *)(src1 + pattern_x))[0];
   12.65 +            col = *(uint16_t *)(src_base + m(src1 + pattern_x));
   12.66              pattern_x = (pattern_x + 2) & 15;
   12.67  #elif DEPTH == 24
   12.68              {
   12.69 -                const uint8_t *src2 = src1 + pattern_x * 3;
   12.70 +                const uint8_t *src2 = src_base + m(src1 + pattern_x * 3);
   12.71                  col = src2[0] | (src2[1] << 8) | (src2[2] << 16);
   12.72                  pattern_x = (pattern_x + 1) & 7;
   12.73              }
   12.74  #else
   12.75 -            col = ((uint32_t *)(src1 + pattern_x))[0];
   12.76 +            col = *(uint32_t *)(src_base + m(src1 + pattern_x));
   12.77              pattern_x = (pattern_x + 4) & 31;
   12.78  #endif
   12.79              PUTPIXEL();
   12.80 @@ -93,12 +99,14 @@ glue(glue(glue(cirrus_patternfill_, ROP_
   12.81  /* NOTE: srcpitch is ignored */
   12.82  static void
   12.83  glue(glue(glue(cirrus_colorexpand_transp_, ROP_NAME), _),DEPTH)
   12.84 -     (CirrusVGAState * s, uint8_t * dst,
   12.85 -      const uint8_t * src, 
   12.86 +     (CirrusVGAState * s, uint8_t * dst_,
   12.87 +      const uint8_t * src_, 
   12.88        int dstpitch, int srcpitch, 
   12.89        int bltwidth, int bltheight)
   12.90  {
   12.91 -    uint8_t *d;
   12.92 +    uint8_t *dst_base, *src_base;
   12.93 +    uint32_t src, dst;
   12.94 +    uint32_t d;
   12.95      int x, y;
   12.96      unsigned bits, bits_xor;
   12.97      unsigned int col;
   12.98 @@ -112,6 +120,10 @@ glue(glue(glue(cirrus_colorexpand_transp
   12.99      int dstskipleft = srcskipleft * (DEPTH / 8);
  12.100  #endif
  12.101  
  12.102 +    get_base(dst_, s, dst_base);
  12.103 +    get_base(src_, s, src_base);
  12.104 +    dst = dst_ - dst_base;
  12.105 +    src = src_ - src_base;
  12.106      if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_COLOREXPINV) {
  12.107          bits_xor = 0xff;
  12.108          col = s->cirrus_blt_bgcol;
  12.109 @@ -122,12 +134,12 @@ glue(glue(glue(cirrus_colorexpand_transp
  12.110  
  12.111      for(y = 0; y < bltheight; y++) {
  12.112          bitmask = 0x80 >> srcskipleft;
  12.113 -        bits = *src++ ^ bits_xor;
  12.114 +        bits = *(src_base + m(src++)) ^ bits_xor;
  12.115          d = dst + dstskipleft;
  12.116          for (x = dstskipleft; x < bltwidth; x += (DEPTH / 8)) {
  12.117              if ((bitmask & 0xff) == 0) {
  12.118                  bitmask = 0x80;
  12.119 -                bits = *src++ ^ bits_xor;
  12.120 +                bits = *(src_base + m(src++)) ^ bits_xor;
  12.121              }
  12.122              index = (bits & bitmask);
  12.123              if (index) {
  12.124 @@ -142,13 +154,15 @@ glue(glue(glue(cirrus_colorexpand_transp
  12.125  
  12.126  static void
  12.127  glue(glue(glue(cirrus_colorexpand_, ROP_NAME), _),DEPTH)
  12.128 -     (CirrusVGAState * s, uint8_t * dst,
  12.129 -      const uint8_t * src, 
  12.130 +     (CirrusVGAState * s, uint8_t * dst_,
  12.131 +      const uint8_t * src_, 
  12.132        int dstpitch, int srcpitch, 
  12.133        int bltwidth, int bltheight)
  12.134  {
  12.135 +    uint8_t *dst_base, *src_base;
  12.136 +    uint32_t src, dst;
  12.137      uint32_t colors[2];
  12.138 -    uint8_t *d;
  12.139 +    uint32_t d;
  12.140      int x, y;
  12.141      unsigned bits;
  12.142      unsigned int col;
  12.143 @@ -156,16 +170,20 @@ glue(glue(glue(cirrus_colorexpand_, ROP_
  12.144      int srcskipleft = s->gr[0x2f] & 0x07;
  12.145      int dstskipleft = srcskipleft * (DEPTH / 8);
  12.146  
  12.147 +    get_base(dst_, s, dst_base);
  12.148 +    get_base(src_, s, src_base);
  12.149 +    dst = dst_ - dst_base;
  12.150 +    src = src_ - src_base;
  12.151      colors[0] = s->cirrus_blt_bgcol;
  12.152      colors[1] = s->cirrus_blt_fgcol;
  12.153      for(y = 0; y < bltheight; y++) {
  12.154          bitmask = 0x80 >> srcskipleft;
  12.155 -        bits = *src++;
  12.156 +        bits = *(src_base + m(src++));
  12.157          d = dst + dstskipleft;
  12.158          for (x = dstskipleft; x < bltwidth; x += (DEPTH / 8)) {
  12.159              if ((bitmask & 0xff) == 0) {
  12.160                  bitmask = 0x80;
  12.161 -                bits = *src++;
  12.162 +                bits = *(src_base + m(src++));
  12.163              }
  12.164              col = colors[!!(bits & bitmask)];
  12.165              PUTPIXEL();
  12.166 @@ -178,12 +196,14 @@ glue(glue(glue(cirrus_colorexpand_, ROP_
  12.167  
  12.168  static void
  12.169  glue(glue(glue(cirrus_colorexpand_pattern_transp_, ROP_NAME), _),DEPTH)
  12.170 -     (CirrusVGAState * s, uint8_t * dst,
  12.171 -      const uint8_t * src, 
  12.172 +     (CirrusVGAState * s, uint8_t * dst_,
  12.173 +      const uint8_t * src_, 
  12.174        int dstpitch, int srcpitch, 
  12.175        int bltwidth, int bltheight)
  12.176  {
  12.177 -    uint8_t *d;
  12.178 +    uint8_t *dst_base, *src_base;
  12.179 +    uint32_t src, dst;
  12.180 +    uint32_t d;
  12.181      int x, y, bitpos, pattern_y;
  12.182      unsigned int bits, bits_xor;
  12.183      unsigned int col;
  12.184 @@ -195,6 +215,10 @@ glue(glue(glue(cirrus_colorexpand_patter
  12.185      int dstskipleft = srcskipleft * (DEPTH / 8);
  12.186  #endif
  12.187  
  12.188 +    get_base(dst_, s, dst_base);
  12.189 +    get_base(src_, s, src_base);
  12.190 +    dst = dst_ - dst_base;
  12.191 +    src = src_ - src_base;
  12.192      if (s->cirrus_blt_modeext & CIRRUS_BLTMODEEXT_COLOREXPINV) {
  12.193          bits_xor = 0xff;
  12.194          col = s->cirrus_blt_bgcol;
  12.195 @@ -205,7 +229,7 @@ glue(glue(glue(cirrus_colorexpand_patter
  12.196      pattern_y = s->cirrus_blt_srcaddr & 7;
  12.197  
  12.198      for(y = 0; y < bltheight; y++) {
  12.199 -        bits = src[pattern_y] ^ bits_xor;
  12.200 +        bits = *(src_base + m(src + pattern_y)) ^ bits_xor;
  12.201          bitpos = 7 - srcskipleft;
  12.202          d = dst + dstskipleft;
  12.203          for (x = dstskipleft; x < bltwidth; x += (DEPTH / 8)) {
  12.204 @@ -222,25 +246,31 @@ glue(glue(glue(cirrus_colorexpand_patter
  12.205  
  12.206  static void
  12.207  glue(glue(glue(cirrus_colorexpand_pattern_, ROP_NAME), _),DEPTH)
  12.208 -     (CirrusVGAState * s, uint8_t * dst,
  12.209 -      const uint8_t * src, 
  12.210 +     (CirrusVGAState * s, uint8_t * dst_,
  12.211 +      const uint8_t * src_, 
  12.212        int dstpitch, int srcpitch, 
  12.213        int bltwidth, int bltheight)
  12.214  {
  12.215 +    uint8_t *dst_base, *src_base;
  12.216 +    uint32_t src, dst;
  12.217      uint32_t colors[2];
  12.218 -    uint8_t *d;
  12.219 +    uint32_t d;
  12.220      int x, y, bitpos, pattern_y;
  12.221      unsigned int bits;
  12.222      unsigned int col;
  12.223      int srcskipleft = s->gr[0x2f] & 0x07;
  12.224      int dstskipleft = srcskipleft * (DEPTH / 8);
  12.225  
  12.226 +    get_base(dst_, s, dst_base);
  12.227 +    get_base(src_, s, src_base);
  12.228 +    dst = dst_ - dst_base;
  12.229 +    src = src_ - src_base;
  12.230      colors[0] = s->cirrus_blt_bgcol;
  12.231      colors[1] = s->cirrus_blt_fgcol;
  12.232      pattern_y = s->cirrus_blt_srcaddr & 7;
  12.233  
  12.234      for(y = 0; y < bltheight; y++) {
  12.235 -        bits = src[pattern_y];
  12.236 +        bits = *(src_base + m(src + pattern_y));
  12.237          bitpos = 7 - srcskipleft;
  12.238          d = dst + dstskipleft;
  12.239          for (x = dstskipleft; x < bltwidth; x += (DEPTH / 8)) {
  12.240 @@ -257,13 +287,17 @@ glue(glue(glue(cirrus_colorexpand_patter
  12.241  static void 
  12.242  glue(glue(glue(cirrus_fill_, ROP_NAME), _),DEPTH)
  12.243       (CirrusVGAState *s,
  12.244 -      uint8_t *dst, int dst_pitch, 
  12.245 +      uint8_t *dst_, int dst_pitch, 
  12.246        int width, int height)
  12.247  {
  12.248 -    uint8_t *d, *d1;
  12.249 +    uint8_t *dst_base;
  12.250 +    uint32_t dst;
  12.251 +    uint32_t d, d1;
  12.252      uint32_t col;
  12.253      int x, y;
  12.254  
  12.255 +    get_base(dst_, s, dst_base);
  12.256 +    dst = dst_ - dst_base;
  12.257      col = s->cirrus_blt_fgcol;
  12.258  
  12.259      d1 = dst;
    13.1 --- a/tools/ioemu/hw/dma.c	Tue Apr 24 09:26:32 2007 -0600
    13.2 +++ b/tools/ioemu/hw/dma.c	Tue Apr 24 21:39:23 2007 +0100
    13.3 @@ -340,6 +340,8 @@ static void channel_run (int ncont, int 
    13.4  #endif
    13.5  
    13.6      r = dma_controllers[ncont].regs + ichan;
    13.7 +    if (r->transfer_handler == NULL)
    13.8 +	return;
    13.9      n = r->transfer_handler (r->opaque, ichan + (ncont << 2),
   13.10                               r->now[COUNT], (r->base[COUNT] + 1) << ncont);
   13.11      r->now[COUNT] = n;
    14.1 --- a/tools/ioemu/hw/lsi53c895a.c	Tue Apr 24 09:26:32 2007 -0600
    14.2 +++ b/tools/ioemu/hw/lsi53c895a.c	Tue Apr 24 21:39:23 2007 +0100
    14.3 @@ -1071,8 +1071,13 @@ static uint8_t lsi_reg_readb(LSIState *s
    14.4          shift = (offset & 3) * 8;
    14.5          return (s->scratch[n] >> shift) & 0xff;
    14.6      }
    14.7 +#ifndef CONFIG_DM
    14.8      BADF("readb 0x%x\n", offset);
    14.9      exit(1);
   14.10 +#else
   14.11 +    /* XEN: This path can be triggered (e.g. ASPI8DOS.SYS reads 0x8). */
   14.12 +    return 0;
   14.13 +#endif
   14.14  #undef CASE_GET_REG32
   14.15  }
   14.16  
    15.1 --- a/tools/libxen/Makefile	Tue Apr 24 09:26:32 2007 -0600
    15.2 +++ b/tools/libxen/Makefile	Tue Apr 24 21:39:23 2007 +0100
    15.3 @@ -1,5 +1,5 @@
    15.4  #
    15.5 -# Copyright (c) 2006, XenSource Inc.
    15.6 +# Copyright (c) 2006-2007, XenSource Inc.
    15.7  #
    15.8  # This library is free software; you can redistribute it and/or
    15.9  # modify it under the terms of the GNU Lesser General Public
   15.10 @@ -18,20 +18,21 @@
   15.11  XEN_ROOT=../..
   15.12  include $(XEN_ROOT)/tools/Rules.mk
   15.13  
   15.14 -MAJOR = 0.1
   15.15 -MINOR = 0
   15.16 +MAJOR = 0.9
   15.17 +MINOR = 1
   15.18  
   15.19  CFLAGS = -Iinclude                     \
   15.20 -	 $(shell xml2-config --cflags) \
   15.21 +         $(shell xml2-config --cflags) \
   15.22           $(shell curl-config --cflags) \
   15.23           -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
   15.24  
   15.25  LDFLAGS = $(shell xml2-config --libs) \
   15.26            $(shell curl-config --libs)
   15.27  
   15.28 -LIBXENAPI_HDRS = $(wildcard include/*.h)
   15.29 +LIBXENAPI_HDRS = $(wildcard include/xen/api/*.h) include/xen/api/xen_all.h
   15.30  LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
   15.31  
   15.32 +TEST_PROGRAMS = test/test_bindings test/test_event_handling
   15.33  
   15.34  .PHONY: all
   15.35  all: libxenapi.so libxenapi.a
   15.36 @@ -48,13 +49,7 @@ libxenapi.so.$(MAJOR).$(MINOR): $(LIBXEN
   15.37  libxenapi.a: $(LIBXENAPI_OBJS)
   15.38  	$(AR) rcs libxenapi.a $^
   15.39  
   15.40 -test/test_bindings: test/test_bindings.o libxenapi.so
   15.41 -	$(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
   15.42 -
   15.43 -test/test_event_handling: test/test_event_handling.o libxenapi.so
   15.44 -	$(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
   15.45 -
   15.46 -test/test_hvm_bindings: test/test_hvm_bindings.o libxenapi.so
   15.47 +$(TEST_PROGRAMS): test/%: test/%.o libxenapi.so
   15.48  	$(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
   15.49  
   15.50  
   15.51 @@ -70,9 +65,10 @@ install: all
   15.52  	    $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
   15.53  	done
   15.54  
   15.55 +
   15.56  .PHONY: clean
   15.57  clean:
   15.58  	rm -f `find -name *.o`
   15.59  	rm -f libxenapi.so*
   15.60  	rm -f libxenapi.a
   15.61 -	rm -f test/test_bindings
   15.62 +	rm -f $(TEST_PROGRAMS)
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/tools/libxen/Makefile.dist	Tue Apr 24 21:39:23 2007 +0100
    16.3 @@ -0,0 +1,115 @@
    16.4 +#
    16.5 +# Copyright (c) 2006-2007, XenSource Inc.
    16.6 +#
    16.7 +# This library is free software; you can redistribute it and/or
    16.8 +# modify it under the terms of the GNU Lesser General Public
    16.9 +# License as published by the Free Software Foundation; either
   16.10 +# version 2.1 of the License, or (at your option) any later version.
   16.11 +#
   16.12 +# This library is distributed in the hope that it will be useful,
   16.13 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
   16.14 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   16.15 +# Lesser General Public License for more details.
   16.16 +#
   16.17 +# You should have received a copy of the GNU Lesser General Public
   16.18 +# License along with this library; if not, write to the Free Software
   16.19 +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   16.20 +#
   16.21 +
   16.22 +MAJOR = 0.9
   16.23 +MINOR = 1
   16.24 +
   16.25 +CFLAGS = -Iinclude                     \
   16.26 +         $(shell xml2-config --cflags) \
   16.27 +         $(shell curl-config --cflags) \
   16.28 +         -W -Wall -Wmissing-prototypes -Werror -std=c99 -O2 -fPIC
   16.29 +
   16.30 +LDFLAGS = $(shell xml2-config --libs) \
   16.31 +          $(shell curl-config --libs)
   16.32 +
   16.33 +# -h for Solaris
   16.34 +SONAME_LDFLAG ?= -soname
   16.35 +# -R /usr/sfw/$(LIBDIR) -shared for Solaris
   16.36 +SHLIB_CFLAGS ?= -shared
   16.37 +
   16.38 +# ginstall for Solaris
   16.39 +INSTALL      = install
   16.40 +INSTALL_DIR  = $(INSTALL) -d -m0755 -p
   16.41 +INSTALL_DATA = $(INSTALL) -m0644 -p
   16.42 +
   16.43 +LIBXENAPI_HDRS = $(wildcard include/*.h)
   16.44 +LIBXENAPI_OBJS = $(patsubst %.c, %.o, $(wildcard src/*.c))
   16.45 +
   16.46 +TEST_PROGRAMS = test/test_bindings test/test_event_handling
   16.47 +
   16.48 +TARBALL_DEST = libxenapi-$(MAJOR).$(MINOR)
   16.49 +
   16.50 +.PHONY: all
   16.51 +all: $(TEST_PROGRAMS)
   16.52 +
   16.53 +libxenapi.so: libxenapi.so.$(MAJOR)
   16.54 +	ln -sf $< $@
   16.55 +
   16.56 +libxenapi.so.$(MAJOR): libxenapi.so.$(MAJOR).$(MINOR)
   16.57 +	ln -sf $< $@
   16.58 +
   16.59 +libxenapi.so.$(MAJOR).$(MINOR): $(LIBXENAPI_OBJS)
   16.60 +	$(CC) $(CFLAGS) $(LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,libxenapi.so.$(MAJOR) $(SHLIB_CFLAGS) -o $@ $^
   16.61 +
   16.62 +libxenapi.a: $(LIBXENAPI_OBJS)
   16.63 +	$(AR) rcs libxenapi.a $^
   16.64 +
   16.65 +$(TEST_PROGRAMS): test/%: test/%.o libxenapi.so
   16.66 +	$(CC) $(LDFLAGS) -o $@ $< -L . -lxenapi
   16.67 +
   16.68 +
   16.69 +.PHONY: install
   16.70 +install: all
   16.71 +	$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/api
   16.72 +	$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
   16.73 +	$(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   16.74 +	ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so.$(MAJOR)
   16.75 +	ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so
   16.76 +	$(INSTALL_DATA) libxenapi.a $(DESTDIR)/usr/$(LIBDIR)
   16.77 +	for i in $(LIBXENAPI_HDRS); do \
   16.78 +	    $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
   16.79 +	done
   16.80 +
   16.81 +
   16.82 +.PHONY: tarball
   16.83 +tarball: $(TARBALL_DEST).tar.bz2
   16.84 +
   16.85 +$(TARBALL_DEST).tar.bz2: all
   16.86 +	rm -Rf $(TARBALL_DEST)
   16.87 +	mkdir -p $(TARBALL_DEST)/include/xen/api
   16.88 +	mkdir -p $(TARBALL_DEST)/src
   16.89 +	mkdir -p $(TARBALL_DEST)/test
   16.90 +	cp COPYING $(TARBALL_DEST)
   16.91 +	cp Makefile.dist $(TARBALL_DEST)/Makefile
   16.92 +	cp Makefile.dist $(TARBALL_DEST)/Makefile.dist
   16.93 +	cp README $(TARBALL_DEST)
   16.94 +	cp include/*.h $(TARBALL_DEST)/include
   16.95 +	cp include/xen/api/*.h $(TARBALL_DEST)/include/xen/api
   16.96 +	cp src/*.c $(TARBALL_DEST)/src
   16.97 +	cp test/*.c $(TARBALL_DEST)/test
   16.98 +	fakeroot chown root:root -R $(TARBALL_DEST)
   16.99 +	fakeroot tar cjf $(TARBALL_DEST).tar.bz2 $(TARBALL_DEST)
  16.100 +
  16.101 +
  16.102 +.PHONY: clean
  16.103 +clean:
  16.104 +	rm -f `find -name *.o`
  16.105 +	rm -f libxenapi.so*
  16.106 +	rm -f libxenapi.a
  16.107 +	rm -f $(TEST_PROGRAMS)
  16.108 +
  16.109 +
  16.110 +.PHONY: uberheader
  16.111 +uberheader: include/xen/api/xen_all.h
  16.112 +include/xen/api/xen_all.h::
  16.113 +	echo "/* This file is autogenerated */" >$@
  16.114 +	echo "#ifndef XEN_API_XEN_ALL_H" >>$@
  16.115 +	echo "#define XEN_API_XEN_ALL_H" >>$@
  16.116 +	ls include/xen/api/*.h | grep -v xen_all.h | grep -v _decl.h | \
  16.117 +          sed 's,^include/\(.*\)$$,#include <\1>,g' >>$@
  16.118 +	echo "#endif" >>$@
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/tools/libxen/include/xen/api/xen_all.h	Tue Apr 24 21:39:23 2007 +0100
    17.3 @@ -0,0 +1,39 @@
    17.4 +/* This file is autogenerated */
    17.5 +#ifndef XEN_API_XEN_ALL_H
    17.6 +#define XEN_API_XEN_ALL_H
    17.7 +#include <xen/api/xen_common.h>
    17.8 +#include <xen/api/xen_console.h>
    17.9 +#include <xen/api/xen_console_protocol.h>
   17.10 +#include <xen/api/xen_crashdump.h>
   17.11 +#include <xen/api/xen_event.h>
   17.12 +#include <xen/api/xen_event_operation.h>
   17.13 +#include <xen/api/xen_host_cpu.h>
   17.14 +#include <xen/api/xen_host.h>
   17.15 +#include <xen/api/xen_host_metrics.h>
   17.16 +#include <xen/api/xen_int_float_map.h>
   17.17 +#include <xen/api/xen_int_int_map.h>
   17.18 +#include <xen/api/xen_int_string_set_map.h>
   17.19 +#include <xen/api/xen_network.h>
   17.20 +#include <xen/api/xen_on_crash_behaviour.h>
   17.21 +#include <xen/api/xen_on_normal_exit.h>
   17.22 +#include <xen/api/xen_pbd.h>
   17.23 +#include <xen/api/xen_pif.h>
   17.24 +#include <xen/api/xen_pif_metrics.h>
   17.25 +#include <xen/api/xen_sr.h>
   17.26 +#include <xen/api/xen_string_set.h>
   17.27 +#include <xen/api/xen_string_string_map.h>
   17.28 +#include <xen/api/xen_user.h>
   17.29 +#include <xen/api/xen_vbd.h>
   17.30 +#include <xen/api/xen_vbd_metrics.h>
   17.31 +#include <xen/api/xen_vbd_mode.h>
   17.32 +#include <xen/api/xen_vbd_type.h>
   17.33 +#include <xen/api/xen_vdi.h>
   17.34 +#include <xen/api/xen_vdi_type.h>
   17.35 +#include <xen/api/xen_vif.h>
   17.36 +#include <xen/api/xen_vif_metrics.h>
   17.37 +#include <xen/api/xen_vm_guest_metrics.h>
   17.38 +#include <xen/api/xen_vm.h>
   17.39 +#include <xen/api/xen_vm_metrics.h>
   17.40 +#include <xen/api/xen_vm_power_state.h>
   17.41 +#include <xen/api/xen_vtpm.h>
   17.42 +#endif
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/tools/libxen/include/xen/api/xen_common.h	Tue Apr 24 21:39:23 2007 +0100
    18.3 @@ -0,0 +1,211 @@
    18.4 +/*
    18.5 + * Copyright (c) 2006 XenSource, Inc.
    18.6 + *
    18.7 + * This library is free software; you can redistribute it and/or
    18.8 + * modify it under the terms of the GNU Lesser General Public
    18.9 + * License as published by the Free Software Foundation; either
   18.10 + * version 2.1 of the License, or (at your option) any later version.
   18.11 + *
   18.12 + * This library is distributed in the hope that it will be useful,
   18.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   18.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   18.15 + * Lesser General Public License for more details.
   18.16 + *
   18.17 + * You should have received a copy of the GNU Lesser General Public
   18.18 + * License along with this library; if not, write to the Free Software
   18.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   18.20 + */
   18.21 +
   18.22 +#ifndef XEN_COMMON_H
   18.23 +#define XEN_COMMON_H
   18.24 +
   18.25 +
   18.26 +#include <stdbool.h>
   18.27 +#include <stddef.h>
   18.28 +#include <stdint.h>
   18.29 +#include <time.h>
   18.30 +
   18.31 +#include "xen/api/xen_host_decl.h"
   18.32 +
   18.33 +
   18.34 +typedef bool (*xen_result_func)(const void *data, size_t len,
   18.35 +                                void *result_handle);
   18.36 +
   18.37 +
   18.38 +/**
   18.39 + * len does not include a terminating \0.
   18.40 + */
   18.41 +typedef int (*xen_call_func)(const void *, size_t len, void *user_handle,
   18.42 +                             void *result_handle,
   18.43 +                             xen_result_func result_func);
   18.44 +
   18.45 +
   18.46 +typedef struct
   18.47 +{
   18.48 +    xen_call_func call_func;
   18.49 +    void *handle;
   18.50 +    const char *session_id;
   18.51 +    bool ok;
   18.52 +    char **error_description;
   18.53 +    int error_description_count;
   18.54 +} xen_session;
   18.55 +
   18.56 +
   18.57 +typedef struct xen_session_record
   18.58 +{
   18.59 +    char *uuid;
   18.60 +    struct xen_host_record_opt *this_host;
   18.61 +    char *this_user;
   18.62 +    time_t last_active;
   18.63 +} xen_session_record;
   18.64 +
   18.65 +
   18.66 +/**
   18.67 + * Allocate a xen_session_record.
   18.68 + */
   18.69 +extern xen_session_record *
   18.70 +xen_session_record_alloc(void);
   18.71 +
   18.72 +
   18.73 +/**
   18.74 + * Free the given xen_session_record, and all referenced values.  The
   18.75 + * given record must have been allocated by this library.
   18.76 + */
   18.77 +extern void
   18.78 +xen_session_record_free(xen_session_record *record);
   18.79 +
   18.80 +
   18.81 +struct xen_task_;
   18.82 +typedef struct xen_task_ * xen_task_id;
   18.83 +
   18.84 +
   18.85 +typedef struct
   18.86 +{
   18.87 +    int progress;
   18.88 +    long eta;
   18.89 +    /* !!! RESULT */
   18.90 +}  xen_task_status;
   18.91 +
   18.92 +
   18.93 +typedef struct
   18.94 +{
   18.95 +    int major;
   18.96 +    int minor;
   18.97 +    int patch;
   18.98 +    char *extraversion;
   18.99 +} xen_version;
  18.100 +
  18.101 +
  18.102 +/**
  18.103 + * Free the given xen_version, and all referenced values.
  18.104 + */
  18.105 +extern void xen_version_free(xen_version *version);
  18.106 +
  18.107 +
  18.108 +/**
  18.109 + * Return the version of this client-side library.  This will be the major,
  18.110 + * minor, and extraversion of the Xen release with which it was released,
  18.111 + * plus the library's own version as the patch.
  18.112 + */
  18.113 +extern xen_version *xen_get_client_side_version();
  18.114 +
  18.115 +
  18.116 +extern bool
  18.117 +xen_uuid_string_to_bytes(char *uuid, char **bytes);
  18.118 +
  18.119 +
  18.120 +extern bool
  18.121 +xen_uuid_bytes_to_string(char *bytes, char **uuid);
  18.122 +
  18.123 +
  18.124 +extern void
  18.125 +xen_uuid_free(char *uuid);
  18.126 +
  18.127 +
  18.128 +extern void
  18.129 +xen_uuid_bytes_free(char *bytes);
  18.130 +
  18.131 +
  18.132 +/**
  18.133 + * Initialise this library.  Call this before starting to use this library.
  18.134 + * Note that since this library depends upon libxml2, you should also call
  18.135 + * xmlInitParser as appropriate for your program.
  18.136 + */
  18.137 +extern
  18.138 +void xen_init(void);
  18.139 +
  18.140 +
  18.141 +/**
  18.142 + * Clear up this library.  Call when you have finished using this library.
  18.143 + * Note that since this library depends upon libxml2, you should also call
  18.144 + * xmlCleanupParser as appropriate for your program.
  18.145 + */
  18.146 +extern
  18.147 +void xen_fini(void);
  18.148 +
  18.149 +
  18.150 +/**
  18.151 + * Log in at the server, and allocate a xen_session to represent this session.
  18.152 + */
  18.153 +extern xen_session *
  18.154 +xen_session_login_with_password(xen_call_func call_func, void *handle,
  18.155 +                                const char *uname, const char *pwd);
  18.156 +
  18.157 +
  18.158 +/**
  18.159 + * Log out at the server, and free the xen_session.
  18.160 + */
  18.161 +extern void
  18.162 +xen_session_logout(xen_session *session);
  18.163 +
  18.164 +
  18.165 +/**
  18.166 + * Clear any error condition recorded on this session.
  18.167 + */
  18.168 +void
  18.169 +xen_session_clear_error(xen_session *session);
  18.170 +
  18.171 +
  18.172 +/**
  18.173 + * Get the UUID of the second given session.  Set *result to point at a
  18.174 + * string, yours to free.
  18.175 + */
  18.176 +extern bool
  18.177 +xen_session_get_uuid(xen_session *session, char **result,
  18.178 +                     xen_session *self_session);
  18.179 +
  18.180 +
  18.181 +/**
  18.182 + * Get the this_host field of the second given session.  Set *result to be a
  18.183 + * handle to that host.
  18.184 + */
  18.185 +extern bool
  18.186 +xen_session_get_this_host(xen_session *session, xen_host *result,
  18.187 +                          xen_session *self_session);
  18.188 +
  18.189 +
  18.190 +/**
  18.191 + * Get the this_user field of the second given session.  Set *result to point
  18.192 + * at a string, yours to free.
  18.193 + */
  18.194 +extern bool
  18.195 +xen_session_get_this_user(xen_session *session, char **result,
  18.196 +                          xen_session *self_session);
  18.197 +
  18.198 +
  18.199 +/**
  18.200 + * Get the last_active field of the given session, and place it in *result.
  18.201 + */
  18.202 +extern bool
  18.203 +xen_session_get_last_active(xen_session *session, time_t *result,
  18.204 +                            xen_session *self_session);
  18.205 +
  18.206 +/**
  18.207 + * Get a record containing the current state of the second given session.
  18.208 + */
  18.209 +extern bool
  18.210 +xen_session_get_record(xen_session *session, xen_session_record **result,
  18.211 +                       xen_session *self_session);
  18.212 +
  18.213 +
  18.214 +#endif
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/tools/libxen/include/xen/api/xen_console.h	Tue Apr 24 21:39:23 2007 +0100
    19.3 @@ -0,0 +1,247 @@
    19.4 +/*
    19.5 + * Copyright (c) 2006-2007, XenSource Inc.
    19.6 + *
    19.7 + * This library is free software; you can redistribute it and/or
    19.8 + * modify it under the terms of the GNU Lesser General Public
    19.9 + * License as published by the Free Software Foundation; either
   19.10 + * version 2.1 of the License, or (at your option) any later version.
   19.11 + *
   19.12 + * This library is distributed in the hope that it will be useful,
   19.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   19.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   19.15 + * Lesser General Public License for more details.
   19.16 + *
   19.17 + * You should have received a copy of the GNU Lesser General Public
   19.18 + * License along with this library; if not, write to the Free Software
   19.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   19.20 + */
   19.21 +
   19.22 +#ifndef XEN_CONSOLE_H
   19.23 +#define XEN_CONSOLE_H
   19.24 +
   19.25 +#include <xen/api/xen_common.h>
   19.26 +#include <xen/api/xen_console_decl.h>
   19.27 +#include <xen/api/xen_console_protocol.h>
   19.28 +#include <xen/api/xen_string_string_map.h>
   19.29 +#include <xen/api/xen_vm_decl.h>
   19.30 +
   19.31 +
   19.32 +/*
   19.33 + * The console class.
   19.34 + * 
   19.35 + * A console.
   19.36 + */
   19.37 +
   19.38 +
   19.39 +/**
   19.40 + * Free the given xen_console.  The given handle must have been
   19.41 + * allocated by this library.
   19.42 + */
   19.43 +extern void
   19.44 +xen_console_free(xen_console console);
   19.45 +
   19.46 +
   19.47 +typedef struct xen_console_set
   19.48 +{
   19.49 +    size_t size;
   19.50 +    xen_console *contents[];
   19.51 +} xen_console_set;
   19.52 +
   19.53 +/**
   19.54 + * Allocate a xen_console_set of the given size.
   19.55 + */
   19.56 +extern xen_console_set *
   19.57 +xen_console_set_alloc(size_t size);
   19.58 +
   19.59 +/**
   19.60 + * Free the given xen_console_set.  The given set must have been
   19.61 + * allocated by this library.
   19.62 + */
   19.63 +extern void
   19.64 +xen_console_set_free(xen_console_set *set);
   19.65 +
   19.66 +
   19.67 +typedef struct xen_console_record
   19.68 +{
   19.69 +    xen_console handle;
   19.70 +    char *uuid;
   19.71 +    enum xen_console_protocol protocol;
   19.72 +    char *location;
   19.73 +    struct xen_vm_record_opt *vm;
   19.74 +    xen_string_string_map *other_config;
   19.75 +} xen_console_record;
   19.76 +
   19.77 +/**
   19.78 + * Allocate a xen_console_record.
   19.79 + */
   19.80 +extern xen_console_record *
   19.81 +xen_console_record_alloc(void);
   19.82 +
   19.83 +/**
   19.84 + * Free the given xen_console_record, and all referenced values.  The
   19.85 + * given record must have been allocated by this library.
   19.86 + */
   19.87 +extern void
   19.88 +xen_console_record_free(xen_console_record *record);
   19.89 +
   19.90 +
   19.91 +typedef struct xen_console_record_opt
   19.92 +{
   19.93 +    bool is_record;
   19.94 +    union
   19.95 +    {
   19.96 +        xen_console handle;
   19.97 +        xen_console_record *record;
   19.98 +    } u;
   19.99 +} xen_console_record_opt;
  19.100 +
  19.101 +/**
  19.102 + * Allocate a xen_console_record_opt.
  19.103 + */
  19.104 +extern xen_console_record_opt *
  19.105 +xen_console_record_opt_alloc(void);
  19.106 +
  19.107 +/**
  19.108 + * Free the given xen_console_record_opt, and all referenced values. 
  19.109 + * The given record_opt must have been allocated by this library.
  19.110 + */
  19.111 +extern void
  19.112 +xen_console_record_opt_free(xen_console_record_opt *record_opt);
  19.113 +
  19.114 +
  19.115 +typedef struct xen_console_record_set
  19.116 +{
  19.117 +    size_t size;
  19.118 +    xen_console_record *contents[];
  19.119 +} xen_console_record_set;
  19.120 +
  19.121 +/**
  19.122 + * Allocate a xen_console_record_set of the given size.
  19.123 + */
  19.124 +extern xen_console_record_set *
  19.125 +xen_console_record_set_alloc(size_t size);
  19.126 +
  19.127 +/**
  19.128 + * Free the given xen_console_record_set, and all referenced values. 
  19.129 + * The given set must have been allocated by this library.
  19.130 + */
  19.131 +extern void
  19.132 +xen_console_record_set_free(xen_console_record_set *set);
  19.133 +
  19.134 +
  19.135 +
  19.136 +typedef struct xen_console_record_opt_set
  19.137 +{
  19.138 +    size_t size;
  19.139 +    xen_console_record_opt *contents[];
  19.140 +} xen_console_record_opt_set;
  19.141 +
  19.142 +/**
  19.143 + * Allocate a xen_console_record_opt_set of the given size.
  19.144 + */
  19.145 +extern xen_console_record_opt_set *
  19.146 +xen_console_record_opt_set_alloc(size_t size);
  19.147 +
  19.148 +/**
  19.149 + * Free the given xen_console_record_opt_set, and all referenced
  19.150 + * values.  The given set must have been allocated by this library.
  19.151 + */
  19.152 +extern void
  19.153 +xen_console_record_opt_set_free(xen_console_record_opt_set *set);
  19.154 +
  19.155 +
  19.156 +/**
  19.157 + * Get a record containing the current state of the given console.
  19.158 + */
  19.159 +extern bool
  19.160 +xen_console_get_record(xen_session *session, xen_console_record **result, xen_console console);
  19.161 +
  19.162 +
  19.163 +/**
  19.164 + * Get a reference to the console instance with the specified UUID.
  19.165 + */
  19.166 +extern bool
  19.167 +xen_console_get_by_uuid(xen_session *session, xen_console *result, char *uuid);
  19.168 +
  19.169 +
  19.170 +/**
  19.171 + * Create a new console instance, and return its handle.
  19.172 + */
  19.173 +extern bool
  19.174 +xen_console_create(xen_session *session, xen_console *result, xen_console_record *record);
  19.175 +
  19.176 +
  19.177 +/**
  19.178 + * Destroy the specified console instance.
  19.179 + */
  19.180 +extern bool
  19.181 +xen_console_destroy(xen_session *session, xen_console console);
  19.182 +
  19.183 +
  19.184 +/**
  19.185 + * Get the uuid field of the given console.
  19.186 + */
  19.187 +extern bool
  19.188 +xen_console_get_uuid(xen_session *session, char **result, xen_console console);
  19.189 +
  19.190 +
  19.191 +/**
  19.192 + * Get the protocol field of the given console.
  19.193 + */
  19.194 +extern bool
  19.195 +xen_console_get_protocol(xen_session *session, enum xen_console_protocol *result, xen_console console);
  19.196 +
  19.197 +
  19.198 +/**
  19.199 + * Get the location field of the given console.
  19.200 + */
  19.201 +extern bool
  19.202 +xen_console_get_location(xen_session *session, char **result, xen_console console);
  19.203 +
  19.204 +
  19.205 +/**
  19.206 + * Get the VM field of the given console.
  19.207 + */
  19.208 +extern bool
  19.209 +xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
  19.210 +
  19.211 +
  19.212 +/**
  19.213 + * Get the other_config field of the given console.
  19.214 + */
  19.215 +extern bool
  19.216 +xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console);
  19.217 +
  19.218 +
  19.219 +/**
  19.220 + * Set the other_config field of the given console.
  19.221 + */
  19.222 +extern bool
  19.223 +xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config);
  19.224 +
  19.225 +
  19.226 +/**
  19.227 + * Add the given key-value pair to the other_config field of the given
  19.228 + * console.
  19.229 + */
  19.230 +extern bool
  19.231 +xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value);
  19.232 +
  19.233 +
  19.234 +/**
  19.235 + * Remove the given key and its corresponding value from the
  19.236 + * other_config field of the given console.  If the key is not in that Map,
  19.237 + * then do nothing.
  19.238 + */
  19.239 +extern bool
  19.240 +xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key);
  19.241 +
  19.242 +
  19.243 +/**
  19.244 + * Return a list of all the consoles known to the system.
  19.245 + */
  19.246 +extern bool
  19.247 +xen_console_get_all(xen_session *session, struct xen_console_set **result);
  19.248 +
  19.249 +
  19.250 +#endif
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/tools/libxen/include/xen/api/xen_console_decl.h	Tue Apr 24 21:39:23 2007 +0100
    20.3 @@ -0,0 +1,30 @@
    20.4 +/*
    20.5 + * Copyright (c) 2006-2007, XenSource Inc.
    20.6 + *
    20.7 + * This library is free software; you can redistribute it and/or
    20.8 + * modify it under the terms of the GNU Lesser General Public
    20.9 + * License as published by the Free Software Foundation; either
   20.10 + * version 2.1 of the License, or (at your option) any later version.
   20.11 + *
   20.12 + * This library is distributed in the hope that it will be useful,
   20.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   20.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   20.15 + * Lesser General Public License for more details.
   20.16 + *
   20.17 + * You should have received a copy of the GNU Lesser General Public
   20.18 + * License along with this library; if not, write to the Free Software
   20.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   20.20 + */
   20.21 +
   20.22 +#ifndef XEN_CONSOLE_DECL_H
   20.23 +#define XEN_CONSOLE_DECL_H
   20.24 +
   20.25 +typedef void *xen_console;
   20.26 +
   20.27 +struct xen_console_set;
   20.28 +struct xen_console_record;
   20.29 +struct xen_console_record_set;
   20.30 +struct xen_console_record_opt;
   20.31 +struct xen_console_record_opt_set;
   20.32 +
   20.33 +#endif
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/tools/libxen/include/xen/api/xen_console_protocol.h	Tue Apr 24 21:39:23 2007 +0100
    21.3 @@ -0,0 +1,82 @@
    21.4 +/*
    21.5 + * Copyright (c) 2006-2007, XenSource Inc.
    21.6 + *
    21.7 + * This library is free software; you can redistribute it and/or
    21.8 + * modify it under the terms of the GNU Lesser General Public
    21.9 + * License as published by the Free Software Foundation; either
   21.10 + * version 2.1 of the License, or (at your option) any later version.
   21.11 + *
   21.12 + * This library is distributed in the hope that it will be useful,
   21.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   21.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   21.15 + * Lesser General Public License for more details.
   21.16 + *
   21.17 + * You should have received a copy of the GNU Lesser General Public
   21.18 + * License along with this library; if not, write to the Free Software
   21.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   21.20 + */
   21.21 +
   21.22 +#ifndef XEN_CONSOLE_PROTOCOL_H
   21.23 +#define XEN_CONSOLE_PROTOCOL_H
   21.24 +
   21.25 +
   21.26 +#include <xen/api/xen_common.h>
   21.27 +
   21.28 +
   21.29 +enum xen_console_protocol
   21.30 +{
   21.31 +    /**
   21.32 +     * VT100 terminal
   21.33 +     */
   21.34 +    XEN_CONSOLE_PROTOCOL_VT100,
   21.35 +
   21.36 +    /**
   21.37 +     * Remote FrameBuffer protocol (as used in VNC)
   21.38 +     */
   21.39 +    XEN_CONSOLE_PROTOCOL_RFB,
   21.40 +
   21.41 +    /**
   21.42 +     * Remote Desktop Protocol
   21.43 +     */
   21.44 +    XEN_CONSOLE_PROTOCOL_RDP
   21.45 +};
   21.46 +
   21.47 +
   21.48 +typedef struct xen_console_protocol_set
   21.49 +{
   21.50 +    size_t size;
   21.51 +    enum xen_console_protocol contents[];
   21.52 +} xen_console_protocol_set;
   21.53 +
   21.54 +/**
   21.55 + * Allocate a xen_console_protocol_set of the given size.
   21.56 + */
   21.57 +extern xen_console_protocol_set *
   21.58 +xen_console_protocol_set_alloc(size_t size);
   21.59 +
   21.60 +/**
   21.61 + * Free the given xen_console_protocol_set.  The given set must have
   21.62 + * been allocated by this library.
   21.63 + */
   21.64 +extern void
   21.65 +xen_console_protocol_set_free(xen_console_protocol_set *set);
   21.66 +
   21.67 +
   21.68 +/**
   21.69 + * Return the name corresponding to the given code.  This string must
   21.70 + * not be modified or freed.
   21.71 + */
   21.72 +extern const char *
   21.73 +xen_console_protocol_to_string(enum xen_console_protocol val);
   21.74 +
   21.75 +
   21.76 +/**
   21.77 + * Return the correct code for the given string, or set the session
   21.78 + * object to failure and return an undefined value if the given string does
   21.79 + * not match a known code.
   21.80 + */
   21.81 +extern enum xen_console_protocol
   21.82 +xen_console_protocol_from_string(xen_session *session, const char *str);
   21.83 +
   21.84 +
   21.85 +#endif
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/tools/libxen/include/xen/api/xen_crashdump.h	Tue Apr 24 21:39:23 2007 +0100
    22.3 @@ -0,0 +1,199 @@
    22.4 +/*
    22.5 + * Copyright (c) 2006-2007, XenSource Inc.
    22.6 + *
    22.7 + * This library is free software; you can redistribute it and/or
    22.8 + * modify it under the terms of the GNU Lesser General Public
    22.9 + * License as published by the Free Software Foundation; either
   22.10 + * version 2.1 of the License, or (at your option) any later version.
   22.11 + *
   22.12 + * This library is distributed in the hope that it will be useful,
   22.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   22.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   22.15 + * Lesser General Public License for more details.
   22.16 + *
   22.17 + * You should have received a copy of the GNU Lesser General Public
   22.18 + * License along with this library; if not, write to the Free Software
   22.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   22.20 + */
   22.21 +
   22.22 +#ifndef XEN_CRASHDUMP_H
   22.23 +#define XEN_CRASHDUMP_H
   22.24 +
   22.25 +#include <xen/api/xen_common.h>
   22.26 +#include <xen/api/xen_crashdump_decl.h>
   22.27 +#include <xen/api/xen_vdi_decl.h>
   22.28 +#include <xen/api/xen_vm_decl.h>
   22.29 +
   22.30 +
   22.31 +/*
   22.32 + * The crashdump class.
   22.33 + * 
   22.34 + * A VM crashdump.
   22.35 + */
   22.36 +
   22.37 +
   22.38 +/**
   22.39 + * Free the given xen_crashdump.  The given handle must have been
   22.40 + * allocated by this library.
   22.41 + */
   22.42 +extern void
   22.43 +xen_crashdump_free(xen_crashdump crashdump);
   22.44 +
   22.45 +
   22.46 +typedef struct xen_crashdump_set
   22.47 +{
   22.48 +    size_t size;
   22.49 +    xen_crashdump *contents[];
   22.50 +} xen_crashdump_set;
   22.51 +
   22.52 +/**
   22.53 + * Allocate a xen_crashdump_set of the given size.
   22.54 + */
   22.55 +extern xen_crashdump_set *
   22.56 +xen_crashdump_set_alloc(size_t size);
   22.57 +
   22.58 +/**
   22.59 + * Free the given xen_crashdump_set.  The given set must have been
   22.60 + * allocated by this library.
   22.61 + */
   22.62 +extern void
   22.63 +xen_crashdump_set_free(xen_crashdump_set *set);
   22.64 +
   22.65 +
   22.66 +typedef struct xen_crashdump_record
   22.67 +{
   22.68 +    xen_crashdump handle;
   22.69 +    char *uuid;
   22.70 +    struct xen_vm_record_opt *vm;
   22.71 +    struct xen_vdi_record_opt *vdi;
   22.72 +} xen_crashdump_record;
   22.73 +
   22.74 +/**
   22.75 + * Allocate a xen_crashdump_record.
   22.76 + */
   22.77 +extern xen_crashdump_record *
   22.78 +xen_crashdump_record_alloc(void);
   22.79 +
   22.80 +/**
   22.81 + * Free the given xen_crashdump_record, and all referenced values.  The
   22.82 + * given record must have been allocated by this library.
   22.83 + */
   22.84 +extern void
   22.85 +xen_crashdump_record_free(xen_crashdump_record *record);
   22.86 +
   22.87 +
   22.88 +typedef struct xen_crashdump_record_opt
   22.89 +{
   22.90 +    bool is_record;
   22.91 +    union
   22.92 +    {
   22.93 +        xen_crashdump handle;
   22.94 +        xen_crashdump_record *record;
   22.95 +    } u;
   22.96 +} xen_crashdump_record_opt;
   22.97 +
   22.98 +/**
   22.99 + * Allocate a xen_crashdump_record_opt.
  22.100 + */
  22.101 +extern xen_crashdump_record_opt *
  22.102 +xen_crashdump_record_opt_alloc(void);
  22.103 +
  22.104 +/**
  22.105 + * Free the given xen_crashdump_record_opt, and all referenced values. 
  22.106 + * The given record_opt must have been allocated by this library.
  22.107 + */
  22.108 +extern void
  22.109 +xen_crashdump_record_opt_free(xen_crashdump_record_opt *record_opt);
  22.110 +
  22.111 +
  22.112 +typedef struct xen_crashdump_record_set
  22.113 +{
  22.114 +    size_t size;
  22.115 +    xen_crashdump_record *contents[];
  22.116 +} xen_crashdump_record_set;
  22.117 +
  22.118 +/**
  22.119 + * Allocate a xen_crashdump_record_set of the given size.
  22.120 + */
  22.121 +extern xen_crashdump_record_set *
  22.122 +xen_crashdump_record_set_alloc(size_t size);
  22.123 +
  22.124 +/**
  22.125 + * Free the given xen_crashdump_record_set, and all referenced values. 
  22.126 + * The given set must have been allocated by this library.
  22.127 + */
  22.128 +extern void
  22.129 +xen_crashdump_record_set_free(xen_crashdump_record_set *set);
  22.130 +
  22.131 +
  22.132 +
  22.133 +typedef struct xen_crashdump_record_opt_set
  22.134 +{
  22.135 +    size_t size;
  22.136 +    xen_crashdump_record_opt *contents[];
  22.137 +} xen_crashdump_record_opt_set;
  22.138 +
  22.139 +/**
  22.140 + * Allocate a xen_crashdump_record_opt_set of the given size.
  22.141 + */
  22.142 +extern xen_crashdump_record_opt_set *
  22.143 +xen_crashdump_record_opt_set_alloc(size_t size);
  22.144 +
  22.145 +/**
  22.146 + * Free the given xen_crashdump_record_opt_set, and all referenced
  22.147 + * values.  The given set must have been allocated by this library.
  22.148 + */
  22.149 +extern void
  22.150 +xen_crashdump_record_opt_set_free(xen_crashdump_record_opt_set *set);
  22.151 +
  22.152 +
  22.153 +/**
  22.154 + * Get a record containing the current state of the given crashdump.
  22.155 + */
  22.156 +extern bool
  22.157 +xen_crashdump_get_record(xen_session *session, xen_crashdump_record **result, xen_crashdump crashdump);
  22.158 +
  22.159 +
  22.160 +/**
  22.161 + * Get a reference to the crashdump instance with the specified UUID.
  22.162 + */
  22.163 +extern bool
  22.164 +xen_crashdump_get_by_uuid(xen_session *session, xen_crashdump *result, char *uuid);
  22.165 +
  22.166 +
  22.167 +/**
  22.168 + * Get the uuid field of the given crashdump.
  22.169 + */
  22.170 +extern bool
  22.171 +xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump);
  22.172 +
  22.173 +
  22.174 +/**
  22.175 + * Get the VM field of the given crashdump.
  22.176 + */
  22.177 +extern bool
  22.178 +xen_crashdump_get_vm(xen_session *session, xen_vm *result, xen_crashdump crashdump);
  22.179 +
  22.180 +
  22.181 +/**
  22.182 + * Get the VDI field of the given crashdump.
  22.183 + */
  22.184 +extern bool
  22.185 +xen_crashdump_get_vdi(xen_session *session, xen_vdi *result, xen_crashdump crashdump);
  22.186 +
  22.187 +
  22.188 +/**
  22.189 + * Destroy the specified crashdump.
  22.190 + */
  22.191 +extern bool
  22.192 +xen_crashdump_destroy(xen_session *session, xen_crashdump self);
  22.193 +
  22.194 +
  22.195 +/**
  22.196 + * Return a list of all the crashdumps known to the system.
  22.197 + */
  22.198 +extern bool
  22.199 +xen_crashdump_get_all(xen_session *session, struct xen_crashdump_set **result);
  22.200 +
  22.201 +
  22.202 +#endif
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/tools/libxen/include/xen/api/xen_crashdump_decl.h	Tue Apr 24 21:39:23 2007 +0100
    23.3 @@ -0,0 +1,30 @@
    23.4 +/*
    23.5 + * Copyright (c) 2006-2007, XenSource Inc.
    23.6 + *
    23.7 + * This library is free software; you can redistribute it and/or
    23.8 + * modify it under the terms of the GNU Lesser General Public
    23.9 + * License as published by the Free Software Foundation; either
   23.10 + * version 2.1 of the License, or (at your option) any later version.
   23.11 + *
   23.12 + * This library is distributed in the hope that it will be useful,
   23.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   23.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   23.15 + * Lesser General Public License for more details.
   23.16 + *
   23.17 + * You should have received a copy of the GNU Lesser General Public
   23.18 + * License along with this library; if not, write to the Free Software
   23.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   23.20 + */
   23.21 +
   23.22 +#ifndef XEN_CRASHDUMP_DECL_H
   23.23 +#define XEN_CRASHDUMP_DECL_H
   23.24 +
   23.25 +typedef void *xen_crashdump;
   23.26 +
   23.27 +struct xen_crashdump_set;
   23.28 +struct xen_crashdump_record;
   23.29 +struct xen_crashdump_record_set;
   23.30 +struct xen_crashdump_record_opt;
   23.31 +struct xen_crashdump_record_opt_set;
   23.32 +
   23.33 +#endif
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/tools/libxen/include/xen/api/xen_event.h	Tue Apr 24 21:39:23 2007 +0100
    24.3 @@ -0,0 +1,102 @@
    24.4 +/*
    24.5 + * Copyright (c) 2006-2007, XenSource Inc.
    24.6 + *
    24.7 + * This library is free software; you can redistribute it and/or
    24.8 + * modify it under the terms of the GNU Lesser General Public
    24.9 + * License as published by the Free Software Foundation; either
   24.10 + * version 2.1 of the License, or (at your option) any later version.
   24.11 + *
   24.12 + * This library is distributed in the hope that it will be useful,
   24.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   24.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   24.15 + * Lesser General Public License for more details.
   24.16 + *
   24.17 + * You should have received a copy of the GNU Lesser General Public
   24.18 + * License along with this library; if not, write to the Free Software
   24.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   24.20 + */
   24.21 +
   24.22 +#ifndef XEN_EVENT_H
   24.23 +#define XEN_EVENT_H
   24.24 +
   24.25 +#include <xen/api/xen_common.h>
   24.26 +#include <xen/api/xen_event_decl.h>
   24.27 +#include <xen/api/xen_event_operation.h>
   24.28 +#include <xen/api/xen_string_set.h>
   24.29 +
   24.30 +
   24.31 +/*
   24.32 + * The event class.
   24.33 + * 
   24.34 + * Asynchronous event registration and handling.
   24.35 + */
   24.36 +
   24.37 +
   24.38 +
   24.39 +typedef struct xen_event_record
   24.40 +{
   24.41 +    int64_t id;
   24.42 +    time_t timestamp;
   24.43 +    char *class;
   24.44 +    enum xen_event_operation operation;
   24.45 +    char *ref;
   24.46 +    char *obj_uuid;
   24.47 +} xen_event_record;
   24.48 +
   24.49 +/**
   24.50 + * Allocate a xen_event_record.
   24.51 + */
   24.52 +extern xen_event_record *
   24.53 +xen_event_record_alloc(void);
   24.54 +
   24.55 +/**
   24.56 + * Free the given xen_event_record, and all referenced values.  The
   24.57 + * given record must have been allocated by this library.
   24.58 + */
   24.59 +extern void
   24.60 +xen_event_record_free(xen_event_record *record);
   24.61 +
   24.62 +
   24.63 +typedef struct xen_event_record_set
   24.64 +{
   24.65 +    size_t size;
   24.66 +    xen_event_record *contents[];
   24.67 +} xen_event_record_set;
   24.68 +
   24.69 +/**
   24.70 + * Allocate a xen_event_record_set of the given size.
   24.71 + */
   24.72 +extern xen_event_record_set *
   24.73 +xen_event_record_set_alloc(size_t size);
   24.74 +
   24.75 +/**
   24.76 + * Free the given xen_event_record_set, and all referenced values.  The
   24.77 + * given set must have been allocated by this library.
   24.78 + */
   24.79 +extern void
   24.80 +xen_event_record_set_free(xen_event_record_set *set);
   24.81 +
   24.82 +
   24.83 +/**
   24.84 + * Registers this session with the event system.  Specifying the empty
   24.85 + * list will register for all classes.
   24.86 + */
   24.87 +extern bool
   24.88 +xen_event_register(xen_session *session, struct xen_string_set *classes);
   24.89 +
   24.90 +
   24.91 +/**
   24.92 + * Unregisters this session with the event system.
   24.93 + */
   24.94 +extern bool
   24.95 +xen_event_unregister(xen_session *session, struct xen_string_set *classes);
   24.96 +
   24.97 +
   24.98 +/**
   24.99 + * Blocking call which returns a (possibly empty) batch of events.
  24.100 + */
  24.101 +extern bool
  24.102 +xen_event_next(xen_session *session, struct xen_event_record_set **result);
  24.103 +
  24.104 +
  24.105 +#endif
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/tools/libxen/include/xen/api/xen_event_decl.h	Tue Apr 24 21:39:23 2007 +0100
    25.3 @@ -0,0 +1,25 @@
    25.4 +/*
    25.5 + * Copyright (c) 2006-2007, XenSource Inc.
    25.6 + *
    25.7 + * This library is free software; you can redistribute it and/or
    25.8 + * modify it under the terms of the GNU Lesser General Public
    25.9 + * License as published by the Free Software Foundation; either
   25.10 + * version 2.1 of the License, or (at your option) any later version.
   25.11 + *
   25.12 + * This library is distributed in the hope that it will be useful,
   25.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   25.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   25.15 + * Lesser General Public License for more details.
   25.16 + *
   25.17 + * You should have received a copy of the GNU Lesser General Public
   25.18 + * License along with this library; if not, write to the Free Software
   25.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   25.20 + */
   25.21 +
   25.22 +#ifndef XEN_EVENT_DECL_H
   25.23 +#define XEN_EVENT_DECL_H
   25.24 +
   25.25 +struct xen_event_record;
   25.26 +struct xen_event_record_set;
   25.27 +
   25.28 +#endif
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/tools/libxen/include/xen/api/xen_event_operation.h	Tue Apr 24 21:39:23 2007 +0100
    26.3 @@ -0,0 +1,82 @@
    26.4 +/*
    26.5 + * Copyright (c) 2006-2007, XenSource Inc.
    26.6 + *
    26.7 + * This library is free software; you can redistribute it and/or
    26.8 + * modify it under the terms of the GNU Lesser General Public
    26.9 + * License as published by the Free Software Foundation; either
   26.10 + * version 2.1 of the License, or (at your option) any later version.
   26.11 + *
   26.12 + * This library is distributed in the hope that it will be useful,
   26.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   26.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   26.15 + * Lesser General Public License for more details.
   26.16 + *
   26.17 + * You should have received a copy of the GNU Lesser General Public
   26.18 + * License along with this library; if not, write to the Free Software
   26.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   26.20 + */
   26.21 +
   26.22 +#ifndef XEN_EVENT_OPERATION_H
   26.23 +#define XEN_EVENT_OPERATION_H
   26.24 +
   26.25 +
   26.26 +#include <xen/api/xen_common.h>
   26.27 +
   26.28 +
   26.29 +enum xen_event_operation
   26.30 +{
   26.31 +    /**
   26.32 +     * An object has been created
   26.33 +     */
   26.34 +    XEN_EVENT_OPERATION_ADD,
   26.35 +
   26.36 +    /**
   26.37 +     * An object has been deleted
   26.38 +     */
   26.39 +    XEN_EVENT_OPERATION_DEL,
   26.40 +
   26.41 +    /**
   26.42 +     * An object has been modified
   26.43 +     */
   26.44 +    XEN_EVENT_OPERATION_MOD
   26.45 +};
   26.46 +
   26.47 +
   26.48 +typedef struct xen_event_operation_set
   26.49 +{
   26.50 +    size_t size;
   26.51 +    enum xen_event_operation contents[];
   26.52 +} xen_event_operation_set;
   26.53 +
   26.54 +/**
   26.55 + * Allocate a xen_event_operation_set of the given size.
   26.56 + */
   26.57 +extern xen_event_operation_set *
   26.58 +xen_event_operation_set_alloc(size_t size);
   26.59 +
   26.60 +/**
   26.61 + * Free the given xen_event_operation_set.  The given set must have
   26.62 + * been allocated by this library.
   26.63 + */
   26.64 +extern void
   26.65 +xen_event_operation_set_free(xen_event_operation_set *set);
   26.66 +
   26.67 +
   26.68 +/**
   26.69 + * Return the name corresponding to the given code.  This string must
   26.70 + * not be modified or freed.
   26.71 + */
   26.72 +extern const char *
   26.73 +xen_event_operation_to_string(enum xen_event_operation val);
   26.74 +
   26.75 +
   26.76 +/**
   26.77 + * Return the correct code for the given string, or set the session
   26.78 + * object to failure and return an undefined value if the given string does
   26.79 + * not match a known code.
   26.80 + */
   26.81 +extern enum xen_event_operation
   26.82 +xen_event_operation_from_string(xen_session *session, const char *str);
   26.83 +
   26.84 +
   26.85 +#endif
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/tools/libxen/include/xen/api/xen_host.h	Tue Apr 24 21:39:23 2007 +0100
    27.3 @@ -0,0 +1,497 @@
    27.4 +/*
    27.5 + * Copyright (c) 2006-2007, XenSource Inc.
    27.6 + *
    27.7 + * This library is free software; you can redistribute it and/or
    27.8 + * modify it under the terms of the GNU Lesser General Public
    27.9 + * License as published by the Free Software Foundation; either
   27.10 + * version 2.1 of the License, or (at your option) any later version.
   27.11 + *
   27.12 + * This library is distributed in the hope that it will be useful,
   27.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   27.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   27.15 + * Lesser General Public License for more details.
   27.16 + *
   27.17 + * You should have received a copy of the GNU Lesser General Public
   27.18 + * License along with this library; if not, write to the Free Software
   27.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   27.20 + */
   27.21 +
   27.22 +#ifndef XEN_HOST_H
   27.23 +#define XEN_HOST_H
   27.24 +
   27.25 +#include <xen/api/xen_common.h>
   27.26 +#include <xen/api/xen_host_cpu_decl.h>
   27.27 +#include <xen/api/xen_host_decl.h>
   27.28 +#include <xen/api/xen_host_metrics_decl.h>
   27.29 +#include <xen/api/xen_pbd_decl.h>
   27.30 +#include <xen/api/xen_pif_decl.h>
   27.31 +#include <xen/api/xen_sr_decl.h>
   27.32 +#include <xen/api/xen_string_set.h>
   27.33 +#include <xen/api/xen_string_string_map.h>
   27.34 +#include <xen/api/xen_vm_decl.h>
   27.35 +
   27.36 +
   27.37 +/*
   27.38 + * The host class.
   27.39 + * 
   27.40 + * A physical host.
   27.41 + */
   27.42 +
   27.43 +
   27.44 +/**
   27.45 + * Free the given xen_host.  The given handle must have been allocated
   27.46 + * by this library.
   27.47 + */
   27.48 +extern void
   27.49 +xen_host_free(xen_host host);
   27.50 +
   27.51 +
   27.52 +typedef struct xen_host_set
   27.53 +{
   27.54 +    size_t size;
   27.55 +    xen_host *contents[];
   27.56 +} xen_host_set;
   27.57 +
   27.58 +/**
   27.59 + * Allocate a xen_host_set of the given size.
   27.60 + */
   27.61 +extern xen_host_set *
   27.62 +xen_host_set_alloc(size_t size);
   27.63 +
   27.64 +/**
   27.65 + * Free the given xen_host_set.  The given set must have been allocated
   27.66 + * by this library.
   27.67 + */
   27.68 +extern void
   27.69 +xen_host_set_free(xen_host_set *set);
   27.70 +
   27.71 +
   27.72 +typedef struct xen_host_record
   27.73 +{
   27.74 +    xen_host handle;
   27.75 +    char *uuid;
   27.76 +    char *name_label;
   27.77 +    char *name_description;
   27.78 +    int64_t api_version_major;
   27.79 +    int64_t api_version_minor;
   27.80 +    char *api_version_vendor;
   27.81 +    xen_string_string_map *api_version_vendor_implementation;
   27.82 +    bool enabled;
   27.83 +    xen_string_string_map *software_version;
   27.84 +    xen_string_string_map *other_config;
   27.85 +    struct xen_string_set *capabilities;
   27.86 +    xen_string_string_map *cpu_configuration;
   27.87 +    char *sched_policy;
   27.88 +    struct xen_string_set *supported_bootloaders;
   27.89 +    struct xen_vm_record_opt_set *resident_vms;
   27.90 +    xen_string_string_map *logging;
   27.91 +    struct xen_pif_record_opt_set *pifs;
   27.92 +    struct xen_sr_record_opt *suspend_image_sr;
   27.93 +    struct xen_sr_record_opt *crash_dump_sr;
   27.94 +    struct xen_pbd_record_opt_set *pbds;
   27.95 +    struct xen_host_cpu_record_opt_set *host_cpus;
   27.96 +    struct xen_host_metrics_record_opt *metrics;
   27.97 +} xen_host_record;
   27.98 +
   27.99 +/**
  27.100 + * Allocate a xen_host_record.
  27.101 + */
  27.102 +extern xen_host_record *
  27.103 +xen_host_record_alloc(void);
  27.104 +
  27.105 +/**
  27.106 + * Free the given xen_host_record, and all referenced values.  The
  27.107 + * given record must have been allocated by this library.
  27.108 + */
  27.109 +extern void
  27.110 +xen_host_record_free(xen_host_record *record);
  27.111 +
  27.112 +
  27.113 +typedef struct xen_host_record_opt
  27.114 +{
  27.115 +    bool is_record;
  27.116 +    union
  27.117 +    {
  27.118 +        xen_host handle;
  27.119 +        xen_host_record *record;
  27.120 +    } u;
  27.121 +} xen_host_record_opt;
  27.122 +
  27.123 +/**
  27.124 + * Allocate a xen_host_record_opt.
  27.125 + */
  27.126 +extern xen_host_record_opt *
  27.127 +xen_host_record_opt_alloc(void);
  27.128 +
  27.129 +/**
  27.130 + * Free the given xen_host_record_opt, and all referenced values.  The
  27.131 + * given record_opt must have been allocated by this library.
  27.132 + */
  27.133 +extern void
  27.134 +xen_host_record_opt_free(xen_host_record_opt *record_opt);
  27.135 +
  27.136 +
  27.137 +typedef struct xen_host_record_set
  27.138 +{
  27.139 +    size_t size;
  27.140 +    xen_host_record *contents[];
  27.141 +} xen_host_record_set;
  27.142 +
  27.143 +/**
  27.144 + * Allocate a xen_host_record_set of the given size.
  27.145 + */
  27.146 +extern xen_host_record_set *
  27.147 +xen_host_record_set_alloc(size_t size);
  27.148 +
  27.149 +/**
  27.150 + * Free the given xen_host_record_set, and all referenced values.  The
  27.151 + * given set must have been allocated by this library.
  27.152 + */
  27.153 +extern void
  27.154 +xen_host_record_set_free(xen_host_record_set *set);
  27.155 +
  27.156 +
  27.157 +
  27.158 +typedef struct xen_host_record_opt_set
  27.159 +{
  27.160 +    size_t size;
  27.161 +    xen_host_record_opt *contents[];
  27.162 +} xen_host_record_opt_set;
  27.163 +
  27.164 +/**
  27.165 + * Allocate a xen_host_record_opt_set of the given size.
  27.166 + */
  27.167 +extern xen_host_record_opt_set *
  27.168 +xen_host_record_opt_set_alloc(size_t size);
  27.169 +
  27.170 +/**
  27.171 + * Free the given xen_host_record_opt_set, and all referenced values. 
  27.172 + * The given set must have been allocated by this library.
  27.173 + */
  27.174 +extern void
  27.175 +xen_host_record_opt_set_free(xen_host_record_opt_set *set);
  27.176 +
  27.177 +
  27.178 +/**
  27.179 + * Get a record containing the current state of the given host.
  27.180 + */
  27.181 +extern bool
  27.182 +xen_host_get_record(xen_session *session, xen_host_record **result, xen_host host);
  27.183 +
  27.184 +
  27.185 +/**
  27.186 + * Get a reference to the host instance with the specified UUID.
  27.187 + */
  27.188 +extern bool
  27.189 +xen_host_get_by_uuid(xen_session *session, xen_host *result, char *uuid);
  27.190 +
  27.191 +
  27.192 +/**
  27.193 + * Get all the host instances with the given label.
  27.194 + */
  27.195 +extern bool
  27.196 +xen_host_get_by_name_label(xen_session *session, struct xen_host_set **result, char *label);
  27.197 +
  27.198 +
  27.199 +/**
  27.200 + * Get the uuid field of the given host.
  27.201 + */
  27.202 +extern bool
  27.203 +xen_host_get_uuid(xen_session *session, char **result, xen_host host);
  27.204 +
  27.205 +
  27.206 +/**
  27.207 + * Get the name/label field of the given host.
  27.208 + */
  27.209 +extern bool
  27.210 +xen_host_get_name_label(xen_session *session, char **result, xen_host host);
  27.211 +
  27.212 +
  27.213 +/**
  27.214 + * Get the name/description field of the given host.
  27.215 + */
  27.216 +extern bool
  27.217 +xen_host_get_name_description(xen_session *session, char **result, xen_host host);
  27.218 +
  27.219 +
  27.220 +/**
  27.221 + * Get the API_version/major field of the given host.
  27.222 + */
  27.223 +extern bool
  27.224 +xen_host_get_api_version_major(xen_session *session, int64_t *result, xen_host host);
  27.225 +
  27.226 +
  27.227 +/**
  27.228 + * Get the API_version/minor field of the given host.
  27.229 + */
  27.230 +extern bool
  27.231 +xen_host_get_api_version_minor(xen_session *session, int64_t *result, xen_host host);
  27.232 +
  27.233 +
  27.234 +/**
  27.235 + * Get the API_version/vendor field of the given host.
  27.236 + */
  27.237 +extern bool
  27.238 +xen_host_get_api_version_vendor(xen_session *session, char **result, xen_host host);
  27.239 +
  27.240 +
  27.241 +/**
  27.242 + * Get the API_version/vendor_implementation field of the given host.
  27.243 + */
  27.244 +extern bool
  27.245 +xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_string_map **result, xen_host host);
  27.246 +
  27.247 +
  27.248 +/**
  27.249 + * Get the enabled field of the given host.
  27.250 + */
  27.251 +extern bool
  27.252 +xen_host_get_enabled(xen_session *session, bool *result, xen_host host);
  27.253 +
  27.254 +
  27.255 +/**
  27.256 + * Get the software_version field of the given host.
  27.257 + */
  27.258 +extern bool
  27.259 +xen_host_get_software_version(xen_session *session, xen_string_string_map **result, xen_host host);
  27.260 +
  27.261 +
  27.262 +/**
  27.263 + * Get the other_config field of the given host.
  27.264 + */
  27.265 +extern bool
  27.266 +xen_host_get_other_config(xen_session *session, xen_string_string_map **result, xen_host host);
  27.267 +
  27.268 +
  27.269 +/**
  27.270 + * Get the capabilities field of the given host.
  27.271 + */
  27.272 +extern bool
  27.273 +xen_host_get_capabilities(xen_session *session, struct xen_string_set **result, xen_host host);
  27.274 +
  27.275 +
  27.276 +/**
  27.277 + * Get the cpu_configuration field of the given host.
  27.278 + */
  27.279 +extern bool
  27.280 +xen_host_get_cpu_configuration(xen_session *session, xen_string_string_map **result, xen_host host);
  27.281 +
  27.282 +
  27.283 +/**
  27.284 + * Get the sched_policy field of the given host.
  27.285 + */
  27.286 +extern bool
  27.287 +xen_host_get_sched_policy(xen_session *session, char **result, xen_host host);
  27.288 +
  27.289 +
  27.290 +/**
  27.291 + * Get the supported_bootloaders field of the given host.
  27.292 + */
  27.293 +extern bool
  27.294 +xen_host_get_supported_bootloaders(xen_session *session, struct xen_string_set **result, xen_host host);
  27.295 +
  27.296 +
  27.297 +/**
  27.298 + * Get the resident_VMs field of the given host.
  27.299 + */
  27.300 +extern bool
  27.301 +xen_host_get_resident_vms(xen_session *session, struct xen_vm_set **result, xen_host host);
  27.302 +
  27.303 +
  27.304 +/**
  27.305 + * Get the logging field of the given host.
  27.306 + */
  27.307 +extern bool
  27.308 +xen_host_get_logging(xen_session *session, xen_string_string_map **result, xen_host host);
  27.309 +
  27.310 +
  27.311 +/**
  27.312 + * Get the PIFs field of the given host.
  27.313 + */
  27.314 +extern bool
  27.315 +xen_host_get_pifs(xen_session *session, struct xen_pif_set **result, xen_host host);
  27.316 +
  27.317 +
  27.318 +/**
  27.319 + * Get the suspend_image_sr field of the given host.
  27.320 + */
  27.321 +extern bool
  27.322 +xen_host_get_suspend_image_sr(xen_session *session, xen_sr *result, xen_host host);
  27.323 +
  27.324 +
  27.325 +/**
  27.326 + * Get the crash_dump_sr field of the given host.
  27.327 + */
  27.328 +extern bool
  27.329 +xen_host_get_crash_dump_sr(xen_session *session, xen_sr *result, xen_host host);
  27.330 +
  27.331 +
  27.332 +/**
  27.333 + * Get the PBDs field of the given host.
  27.334 + */
  27.335 +extern bool
  27.336 +xen_host_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_host host);
  27.337 +
  27.338 +
  27.339 +/**
  27.340 + * Get the host_CPUs field of the given host.
  27.341 + */
  27.342 +extern bool
  27.343 +xen_host_get_host_cpus(xen_session *session, struct xen_host_cpu_set **result, xen_host host);
  27.344 +
  27.345 +
  27.346 +/**
  27.347 + * Get the metrics field of the given host.
  27.348 + */
  27.349 +extern bool
  27.350 +xen_host_get_metrics(xen_session *session, xen_host_metrics *result, xen_host host);
  27.351 +
  27.352 +
  27.353 +/**
  27.354 + * Set the name/label field of the given host.
  27.355 + */
  27.356 +extern bool
  27.357 +xen_host_set_name_label(xen_session *session, xen_host host, char *label);
  27.358 +
  27.359 +
  27.360 +/**
  27.361 + * Set the name/description field of the given host.
  27.362 + */
  27.363 +extern bool
  27.364 +xen_host_set_name_description(xen_session *session, xen_host host, char *description);
  27.365 +
  27.366 +
  27.367 +/**
  27.368 + * Set the other_config field of the given host.
  27.369 + */
  27.370 +extern bool
  27.371 +xen_host_set_other_config(xen_session *session, xen_host host, xen_string_string_map *other_config);
  27.372 +
  27.373 +
  27.374 +/**
  27.375 + * Add the given key-value pair to the other_config field of the given
  27.376 + * host.
  27.377 + */
  27.378 +extern bool
  27.379 +xen_host_add_to_other_config(xen_session *session, xen_host host, char *key, char *value);
  27.380 +
  27.381 +
  27.382 +/**
  27.383 + * Remove the given key and its corresponding value from the
  27.384 + * other_config field of the given host.  If the key is not in that Map, then
  27.385 + * do nothing.
  27.386 + */
  27.387 +extern bool
  27.388 +xen_host_remove_from_other_config(xen_session *session, xen_host host, char *key);
  27.389 +
  27.390 +
  27.391 +/**
  27.392 + * Set the logging field of the given host.
  27.393 + */
  27.394 +extern bool
  27.395 +xen_host_set_logging(xen_session *session, xen_host host, xen_string_string_map *logging);
  27.396 +
  27.397 +
  27.398 +/**
  27.399 + * Add the given key-value pair to the logging field of the given host.
  27.400 + */
  27.401 +extern bool
  27.402 +xen_host_add_to_logging(xen_session *session, xen_host host, char *key, char *value);
  27.403 +
  27.404 +
  27.405 +/**
  27.406 + * Remove the given key and its corresponding value from the logging
  27.407 + * field of the given host.  If the key is not in that Map, then do nothing.
  27.408 + */
  27.409 +extern bool
  27.410 +xen_host_remove_from_logging(xen_session *session, xen_host host, char *key);
  27.411 +
  27.412 +
  27.413 +/**
  27.414 + * Set the suspend_image_sr field of the given host.
  27.415 + */
  27.416 +extern bool
  27.417 +xen_host_set_suspend_image_sr(xen_session *session, xen_host host, xen_sr suspend_image_sr);
  27.418 +
  27.419 +
  27.420 +/**
  27.421 + * Set the crash_dump_sr field of the given host.
  27.422 + */
  27.423 +extern bool
  27.424 +xen_host_set_crash_dump_sr(xen_session *session, xen_host host, xen_sr crash_dump_sr);
  27.425 +
  27.426 +
  27.427 +/**
  27.428 + * Puts the host into a state in which no new VMs can be started.
  27.429 + * Currently active VMs on the host continue to execute.
  27.430 + */
  27.431 +extern bool
  27.432 +xen_host_disable(xen_session *session, xen_host host);
  27.433 +
  27.434 +
  27.435 +/**
  27.436 + * Puts the host into a state in which new VMs can be started.
  27.437 + */
  27.438 +extern bool
  27.439 +xen_host_enable(xen_session *session, xen_host host);
  27.440 +
  27.441 +
  27.442 +/**
  27.443 + * Shutdown the host. (This function can only be called if there are no
  27.444 + * currently running VMs on the host and it is disabled.).
  27.445 + */
  27.446 +extern bool
  27.447 +xen_host_shutdown(xen_session *session, xen_host host);
  27.448 +
  27.449 +
  27.450 +/**
  27.451 + * Reboot the host. (This function can only be called if there are no
  27.452 + * currently running VMs on the host and it is disabled.).
  27.453 + */
  27.454 +extern bool
  27.455 +xen_host_reboot(xen_session *session, xen_host host);
  27.456 +
  27.457 +
  27.458 +/**
  27.459 + * Get the host xen dmesg.
  27.460 + */
  27.461 +extern bool
  27.462 +xen_host_dmesg(xen_session *session, char **result, xen_host host);
  27.463 +
  27.464 +
  27.465 +/**
  27.466 + * Get the host xen dmesg, and clear the buffer.
  27.467 + */
  27.468 +extern bool
  27.469 +xen_host_dmesg_clear(xen_session *session, char **result, xen_host host);
  27.470 +
  27.471 +
  27.472 +/**
  27.473 + * Get the host's log file.
  27.474 + */
  27.475 +extern bool
  27.476 +xen_host_get_log(xen_session *session, char **result, xen_host host);
  27.477 +
  27.478 +
  27.479 +/**
  27.480 + * Inject the given string as debugging keys into Xen.
  27.481 + */
  27.482 +extern bool
  27.483 +xen_host_send_debug_keys(xen_session *session, xen_host host, char *keys);
  27.484 +
  27.485 +
  27.486 +/**
  27.487 + * List all supported methods.
  27.488 + */
  27.489 +extern bool
  27.490 +xen_host_list_methods(xen_session *session, struct xen_string_set **result);
  27.491 +
  27.492 +
  27.493 +/**
  27.494 + * Return a list of all the hosts known to the system.
  27.495 + */
  27.496 +extern bool
  27.497 +xen_host_get_all(xen_session *session, struct xen_host_set **result);
  27.498 +
  27.499 +
  27.500 +#endif
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/tools/libxen/include/xen/api/xen_host_cpu.h	Tue Apr 24 21:39:23 2007 +0100
    28.3 @@ -0,0 +1,247 @@
    28.4 +/*
    28.5 + * Copyright (c) 2006-2007, XenSource Inc.
    28.6 + *
    28.7 + * This library is free software; you can redistribute it and/or
    28.8 + * modify it under the terms of the GNU Lesser General Public
    28.9 + * License as published by the Free Software Foundation; either
   28.10 + * version 2.1 of the License, or (at your option) any later version.
   28.11 + *
   28.12 + * This library is distributed in the hope that it will be useful,
   28.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   28.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   28.15 + * Lesser General Public License for more details.
   28.16 + *
   28.17 + * You should have received a copy of the GNU Lesser General Public
   28.18 + * License along with this library; if not, write to the Free Software
   28.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   28.20 + */
   28.21 +
   28.22 +#ifndef XEN_HOST_CPU_H
   28.23 +#define XEN_HOST_CPU_H
   28.24 +
   28.25 +#include <xen/api/xen_common.h>
   28.26 +#include <xen/api/xen_host_cpu_decl.h>
   28.27 +#include <xen/api/xen_host_decl.h>
   28.28 +
   28.29 +
   28.30 +/*
   28.31 + * The host_cpu class.
   28.32 + * 
   28.33 + * A physical CPU.
   28.34 + */
   28.35 +
   28.36 +
   28.37 +/**
   28.38 + * Free the given xen_host_cpu.  The given handle must have been
   28.39 + * allocated by this library.
   28.40 + */
   28.41 +extern void
   28.42 +xen_host_cpu_free(xen_host_cpu host_cpu);
   28.43 +
   28.44 +
   28.45 +typedef struct xen_host_cpu_set
   28.46 +{
   28.47 +    size_t size;
   28.48 +    xen_host_cpu *contents[];
   28.49 +} xen_host_cpu_set;
   28.50 +
   28.51 +/**
   28.52 + * Allocate a xen_host_cpu_set of the given size.
   28.53 + */
   28.54 +extern xen_host_cpu_set *
   28.55 +xen_host_cpu_set_alloc(size_t size);
   28.56 +
   28.57 +/**
   28.58 + * Free the given xen_host_cpu_set.  The given set must have been
   28.59 + * allocated by this library.
   28.60 + */
   28.61 +extern void
   28.62 +xen_host_cpu_set_free(xen_host_cpu_set *set);
   28.63 +
   28.64 +
   28.65 +typedef struct xen_host_cpu_record
   28.66 +{
   28.67 +    xen_host_cpu handle;
   28.68 +    char *uuid;
   28.69 +    struct xen_host_record_opt *host;
   28.70 +    int64_t number;
   28.71 +    char *vendor;
   28.72 +    int64_t speed;
   28.73 +    char *modelname;
   28.74 +    char *stepping;
   28.75 +    char *flags;
   28.76 +    char *features;
   28.77 +    double utilisation;
   28.78 +} xen_host_cpu_record;
   28.79 +
   28.80 +/**
   28.81 + * Allocate a xen_host_cpu_record.
   28.82 + */
   28.83 +extern xen_host_cpu_record *
   28.84 +xen_host_cpu_record_alloc(void);
   28.85 +
   28.86 +/**
   28.87 + * Free the given xen_host_cpu_record, and all referenced values.  The
   28.88 + * given record must have been allocated by this library.
   28.89 + */
   28.90 +extern void
   28.91 +xen_host_cpu_record_free(xen_host_cpu_record *record);
   28.92 +
   28.93 +
   28.94 +typedef struct xen_host_cpu_record_opt
   28.95 +{
   28.96 +    bool is_record;
   28.97 +    union
   28.98 +    {
   28.99 +        xen_host_cpu handle;
  28.100 +        xen_host_cpu_record *record;
  28.101 +    } u;
  28.102 +} xen_host_cpu_record_opt;
  28.103 +
  28.104 +/**
  28.105 + * Allocate a xen_host_cpu_record_opt.
  28.106 + */
  28.107 +extern xen_host_cpu_record_opt *
  28.108 +xen_host_cpu_record_opt_alloc(void);
  28.109 +
  28.110 +/**
  28.111 + * Free the given xen_host_cpu_record_opt, and all referenced values. 
  28.112 + * The given record_opt must have been allocated by this library.
  28.113 + */
  28.114 +extern void
  28.115 +xen_host_cpu_record_opt_free(xen_host_cpu_record_opt *record_opt);
  28.116 +
  28.117 +
  28.118 +typedef struct xen_host_cpu_record_set
  28.119 +{
  28.120 +    size_t size;
  28.121 +    xen_host_cpu_record *contents[];
  28.122 +} xen_host_cpu_record_set;
  28.123 +
  28.124 +/**
  28.125 + * Allocate a xen_host_cpu_record_set of the given size.
  28.126 + */
  28.127 +extern xen_host_cpu_record_set *
  28.128 +xen_host_cpu_record_set_alloc(size_t size);
  28.129 +
  28.130 +/**
  28.131 + * Free the given xen_host_cpu_record_set, and all referenced values. 
  28.132 + * The given set must have been allocated by this library.
  28.133 + */
  28.134 +extern void
  28.135 +xen_host_cpu_record_set_free(xen_host_cpu_record_set *set);
  28.136 +
  28.137 +
  28.138 +
  28.139 +typedef struct xen_host_cpu_record_opt_set
  28.140 +{
  28.141 +    size_t size;
  28.142 +    xen_host_cpu_record_opt *contents[];
  28.143 +} xen_host_cpu_record_opt_set;
  28.144 +
  28.145 +/**
  28.146 + * Allocate a xen_host_cpu_record_opt_set of the given size.
  28.147 + */
  28.148 +extern xen_host_cpu_record_opt_set *
  28.149 +xen_host_cpu_record_opt_set_alloc(size_t size);
  28.150 +
  28.151 +/**
  28.152 + * Free the given xen_host_cpu_record_opt_set, and all referenced
  28.153 + * values.  The given set must have been allocated by this library.
  28.154 + */
  28.155 +extern void
  28.156 +xen_host_cpu_record_opt_set_free(xen_host_cpu_record_opt_set *set);
  28.157 +
  28.158 +
  28.159 +/**
  28.160 + * Get a record containing the current state of the given host_cpu.
  28.161 + */
  28.162 +extern bool
  28.163 +xen_host_cpu_get_record(xen_session *session, xen_host_cpu_record **result, xen_host_cpu host_cpu);
  28.164 +
  28.165 +
  28.166 +/**
  28.167 + * Get a reference to the host_cpu instance with the specified UUID.
  28.168 + */
  28.169 +extern bool
  28.170 +xen_host_cpu_get_by_uuid(xen_session *session, xen_host_cpu *result, char *uuid);
  28.171 +
  28.172 +
  28.173 +/**
  28.174 + * Get the uuid field of the given host_cpu.
  28.175 + */
  28.176 +extern bool
  28.177 +xen_host_cpu_get_uuid(xen_session *session, char **result, xen_host_cpu host_cpu);
  28.178 +
  28.179 +
  28.180 +/**
  28.181 + * Get the host field of the given host_cpu.
  28.182 + */
  28.183 +extern bool
  28.184 +xen_host_cpu_get_host(xen_session *session, xen_host *result, xen_host_cpu host_cpu);
  28.185 +
  28.186 +
  28.187 +/**
  28.188 + * Get the number field of the given host_cpu.
  28.189 + */
  28.190 +extern bool
  28.191 +xen_host_cpu_get_number(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
  28.192 +
  28.193 +
  28.194 +/**
  28.195 + * Get the vendor field of the given host_cpu.
  28.196 + */
  28.197 +extern bool
  28.198 +xen_host_cpu_get_vendor(xen_session *session, char **result, xen_host_cpu host_cpu);
  28.199 +
  28.200 +
  28.201 +/**
  28.202 + * Get the speed field of the given host_cpu.
  28.203 + */
  28.204 +extern bool
  28.205 +xen_host_cpu_get_speed(xen_session *session, int64_t *result, xen_host_cpu host_cpu);
  28.206 +
  28.207 +
  28.208 +/**
  28.209 + * Get the modelname field of the given host_cpu.
  28.210 + */
  28.211 +extern bool
  28.212 +xen_host_cpu_get_modelname(xen_session *session, char **result, xen_host_cpu host_cpu);
  28.213 +
  28.214 +
  28.215 +/**
  28.216 + * Get the stepping field of the given host_cpu.
  28.217 + */
  28.218 +extern bool
  28.219 +xen_host_cpu_get_stepping(xen_session *session, char **result, xen_host_cpu host_cpu);
  28.220 +
  28.221 +
  28.222 +/**
  28.223 + * Get the flags field of the given host_cpu.
  28.224 + */
  28.225 +extern bool
  28.226 +xen_host_cpu_get_flags(xen_session *session, char **result, xen_host_cpu host_cpu);
  28.227 +
  28.228 +
  28.229 +/**
  28.230 + * Get the features field of the given host_cpu.
  28.231 + */
  28.232 +extern bool
  28.233 +xen_host_cpu_get_features(xen_session *session, char **result, xen_host_cpu host_cpu);
  28.234 +
  28.235 +
  28.236 +/**
  28.237 + * Get the utilisation field of the given host_cpu.
  28.238 + */
  28.239 +extern bool
  28.240 +xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu);
  28.241 +
  28.242 +
  28.243 +/**
  28.244 + * Return a list of all the host_cpus known to the system.
  28.245 + */
  28.246 +extern bool
  28.247 +xen_host_cpu_get_all(xen_session *session, struct xen_host_cpu_set **result);
  28.248 +
  28.249 +
  28.250 +#endif
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/tools/libxen/include/xen/api/xen_host_cpu_decl.h	Tue Apr 24 21:39:23 2007 +0100
    29.3 @@ -0,0 +1,30 @@
    29.4 +/*
    29.5 + * Copyright (c) 2006-2007, XenSource Inc.
    29.6 + *
    29.7 + * This library is free software; you can redistribute it and/or
    29.8 + * modify it under the terms of the GNU Lesser General Public
    29.9 + * License as published by the Free Software Foundation; either
   29.10 + * version 2.1 of the License, or (at your option) any later version.
   29.11 + *
   29.12 + * This library is distributed in the hope that it will be useful,
   29.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   29.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   29.15 + * Lesser General Public License for more details.
   29.16 + *
   29.17 + * You should have received a copy of the GNU Lesser General Public
   29.18 + * License along with this library; if not, write to the Free Software
   29.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   29.20 + */
   29.21 +
   29.22 +#ifndef XEN_HOST_CPU_DECL_H
   29.23 +#define XEN_HOST_CPU_DECL_H
   29.24 +
   29.25 +typedef void *xen_host_cpu;
   29.26 +
   29.27 +struct xen_host_cpu_set;
   29.28 +struct xen_host_cpu_record;
   29.29 +struct xen_host_cpu_record_set;
   29.30 +struct xen_host_cpu_record_opt;
   29.31 +struct xen_host_cpu_record_opt_set;
   29.32 +
   29.33 +#endif
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/tools/libxen/include/xen/api/xen_host_decl.h	Tue Apr 24 21:39:23 2007 +0100
    30.3 @@ -0,0 +1,30 @@
    30.4 +/*
    30.5 + * Copyright (c) 2006-2007, XenSource Inc.
    30.6 + *
    30.7 + * This library is free software; you can redistribute it and/or
    30.8 + * modify it under the terms of the GNU Lesser General Public
    30.9 + * License as published by the Free Software Foundation; either
   30.10 + * version 2.1 of the License, or (at your option) any later version.
   30.11 + *
   30.12 + * This library is distributed in the hope that it will be useful,
   30.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   30.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   30.15 + * Lesser General Public License for more details.
   30.16 + *
   30.17 + * You should have received a copy of the GNU Lesser General Public
   30.18 + * License along with this library; if not, write to the Free Software
   30.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   30.20 + */
   30.21 +
   30.22 +#ifndef XEN_HOST_DECL_H
   30.23 +#define XEN_HOST_DECL_H
   30.24 +
   30.25 +typedef void *xen_host;
   30.26 +
   30.27 +struct xen_host_set;
   30.28 +struct xen_host_record;
   30.29 +struct xen_host_record_set;
   30.30 +struct xen_host_record_opt;
   30.31 +struct xen_host_record_opt_set;
   30.32 +
   30.33 +#endif
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/tools/libxen/include/xen/api/xen_host_metrics.h	Tue Apr 24 21:39:23 2007 +0100
    31.3 @@ -0,0 +1,199 @@
    31.4 +/*
    31.5 + * Copyright (c) 2006-2007, XenSource Inc.
    31.6 + *
    31.7 + * This library is free software; you can redistribute it and/or
    31.8 + * modify it under the terms of the GNU Lesser General Public
    31.9 + * License as published by the Free Software Foundation; either
   31.10 + * version 2.1 of the License, or (at your option) any later version.
   31.11 + *
   31.12 + * This library is distributed in the hope that it will be useful,
   31.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   31.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   31.15 + * Lesser General Public License for more details.
   31.16 + *
   31.17 + * You should have received a copy of the GNU Lesser General Public
   31.18 + * License along with this library; if not, write to the Free Software
   31.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   31.20 + */
   31.21 +
   31.22 +#ifndef XEN_HOST_METRICS_H
   31.23 +#define XEN_HOST_METRICS_H
   31.24 +
   31.25 +#include <xen/api/xen_common.h>
   31.26 +#include <xen/api/xen_host_metrics_decl.h>
   31.27 +
   31.28 +
   31.29 +/*
   31.30 + * The host_metrics class.
   31.31 + * 
   31.32 + * The metrics associated with a host.
   31.33 + */
   31.34 +
   31.35 +
   31.36 +/**
   31.37 + * Free the given xen_host_metrics.  The given handle must have been
   31.38 + * allocated by this library.
   31.39 + */
   31.40 +extern void
   31.41 +xen_host_metrics_free(xen_host_metrics host_metrics);
   31.42 +
   31.43 +
   31.44 +typedef struct xen_host_metrics_set
   31.45 +{
   31.46 +    size_t size;
   31.47 +    xen_host_metrics *contents[];
   31.48 +} xen_host_metrics_set;
   31.49 +
   31.50 +/**
   31.51 + * Allocate a xen_host_metrics_set of the given size.
   31.52 + */
   31.53 +extern xen_host_metrics_set *
   31.54 +xen_host_metrics_set_alloc(size_t size);
   31.55 +
   31.56 +/**
   31.57 + * Free the given xen_host_metrics_set.  The given set must have been
   31.58 + * allocated by this library.
   31.59 + */
   31.60 +extern void
   31.61 +xen_host_metrics_set_free(xen_host_metrics_set *set);
   31.62 +
   31.63 +
   31.64 +typedef struct xen_host_metrics_record
   31.65 +{
   31.66 +    xen_host_metrics handle;
   31.67 +    char *uuid;
   31.68 +    int64_t memory_total;
   31.69 +    int64_t memory_free;
   31.70 +    time_t last_updated;
   31.71 +} xen_host_metrics_record;
   31.72 +
   31.73 +/**
   31.74 + * Allocate a xen_host_metrics_record.
   31.75 + */
   31.76 +extern xen_host_metrics_record *
   31.77 +xen_host_metrics_record_alloc(void);
   31.78 +
   31.79 +/**
   31.80 + * Free the given xen_host_metrics_record, and all referenced values. 
   31.81 + * The given record must have been allocated by this library.
   31.82 + */
   31.83 +extern void
   31.84 +xen_host_metrics_record_free(xen_host_metrics_record *record);
   31.85 +
   31.86 +
   31.87 +typedef struct xen_host_metrics_record_opt
   31.88 +{
   31.89 +    bool is_record;
   31.90 +    union
   31.91 +    {
   31.92 +        xen_host_metrics handle;
   31.93 +        xen_host_metrics_record *record;
   31.94 +    } u;
   31.95 +} xen_host_metrics_record_opt;
   31.96 +
   31.97 +/**
   31.98 + * Allocate a xen_host_metrics_record_opt.
   31.99 + */
  31.100 +extern xen_host_metrics_record_opt *
  31.101 +xen_host_metrics_record_opt_alloc(void);
  31.102 +
  31.103 +/**
  31.104 + * Free the given xen_host_metrics_record_opt, and all referenced
  31.105 + * values.  The given record_opt must have been allocated by this library.
  31.106 + */
  31.107 +extern void
  31.108 +xen_host_metrics_record_opt_free(xen_host_metrics_record_opt *record_opt);
  31.109 +
  31.110 +
  31.111 +typedef struct xen_host_metrics_record_set
  31.112 +{
  31.113 +    size_t size;
  31.114 +    xen_host_metrics_record *contents[];
  31.115 +} xen_host_metrics_record_set;
  31.116 +
  31.117 +/**
  31.118 + * Allocate a xen_host_metrics_record_set of the given size.
  31.119 + */
  31.120 +extern xen_host_metrics_record_set *
  31.121 +xen_host_metrics_record_set_alloc(size_t size);
  31.122 +
  31.123 +/**
  31.124 + * Free the given xen_host_metrics_record_set, and all referenced
  31.125 + * values.  The given set must have been allocated by this library.
  31.126 + */
  31.127 +extern void
  31.128 +xen_host_metrics_record_set_free(xen_host_metrics_record_set *set);
  31.129 +
  31.130 +
  31.131 +
  31.132 +typedef struct xen_host_metrics_record_opt_set
  31.133 +{
  31.134 +    size_t size;
  31.135 +    xen_host_metrics_record_opt *contents[];
  31.136 +} xen_host_metrics_record_opt_set;
  31.137 +
  31.138 +/**
  31.139 + * Allocate a xen_host_metrics_record_opt_set of the given size.
  31.140 + */
  31.141 +extern xen_host_metrics_record_opt_set *
  31.142 +xen_host_metrics_record_opt_set_alloc(size_t size);
  31.143 +
  31.144 +/**
  31.145 + * Free the given xen_host_metrics_record_opt_set, and all referenced
  31.146 + * values.  The given set must have been allocated by this library.
  31.147 + */
  31.148 +extern void
  31.149 +xen_host_metrics_record_opt_set_free(xen_host_metrics_record_opt_set *set);
  31.150 +
  31.151 +
  31.152 +/**
  31.153 + * Get a record containing the current state of the given host_metrics.
  31.154 + */
  31.155 +extern bool
  31.156 +xen_host_metrics_get_record(xen_session *session, xen_host_metrics_record **result, xen_host_metrics host_metrics);
  31.157 +
  31.158 +
  31.159 +/**
  31.160 + * Get a reference to the host_metrics instance with the specified
  31.161 + * UUID.
  31.162 + */
  31.163 +extern bool
  31.164 +xen_host_metrics_get_by_uuid(xen_session *session, xen_host_metrics *result, char *uuid);
  31.165 +
  31.166 +
  31.167 +/**
  31.168 + * Get the uuid field of the given host_metrics.
  31.169 + */
  31.170 +extern bool
  31.171 +xen_host_metrics_get_uuid(xen_session *session, char **result, xen_host_metrics host_metrics);
  31.172 +
  31.173 +
  31.174 +/**
  31.175 + * Get the memory/total field of the given host_metrics.
  31.176 + */
  31.177 +extern bool
  31.178 +xen_host_metrics_get_memory_total(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
  31.179 +
  31.180 +
  31.181 +/**
  31.182 + * Get the memory/free field of the given host_metrics.
  31.183 + */
  31.184 +extern bool
  31.185 +xen_host_metrics_get_memory_free(xen_session *session, int64_t *result, xen_host_metrics host_metrics);
  31.186 +
  31.187 +
  31.188 +/**
  31.189 + * Get the last_updated field of the given host_metrics.
  31.190 + */
  31.191 +extern bool
  31.192 +xen_host_metrics_get_last_updated(xen_session *session, time_t *result, xen_host_metrics host_metrics);
  31.193 +
  31.194 +
  31.195 +/**
  31.196 + * Return a list of all the host_metrics instances known to the system.
  31.197 + */
  31.198 +extern bool
  31.199 +xen_host_metrics_get_all(xen_session *session, struct xen_host_metrics_set **result);
  31.200 +
  31.201 +
  31.202 +#endif
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/tools/libxen/include/xen/api/xen_host_metrics_decl.h	Tue Apr 24 21:39:23 2007 +0100
    32.3 @@ -0,0 +1,30 @@
    32.4 +/*
    32.5 + * Copyright (c) 2006-2007, XenSource Inc.
    32.6 + *
    32.7 + * This library is free software; you can redistribute it and/or
    32.8 + * modify it under the terms of the GNU Lesser General Public
    32.9 + * License as published by the Free Software Foundation; either
   32.10 + * version 2.1 of the License, or (at your option) any later version.
   32.11 + *
   32.12 + * This library is distributed in the hope that it will be useful,
   32.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   32.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   32.15 + * Lesser General Public License for more details.
   32.16 + *
   32.17 + * You should have received a copy of the GNU Lesser General Public
   32.18 + * License along with this library; if not, write to the Free Software
   32.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   32.20 + */
   32.21 +
   32.22 +#ifndef XEN_HOST_METRICS_DECL_H
   32.23 +#define XEN_HOST_METRICS_DECL_H
   32.24 +
   32.25 +typedef void *xen_host_metrics;
   32.26 +
   32.27 +struct xen_host_metrics_set;
   32.28 +struct xen_host_metrics_record;
   32.29 +struct xen_host_metrics_record_set;
   32.30 +struct xen_host_metrics_record_opt;
   32.31 +struct xen_host_metrics_record_opt_set;
   32.32 +
   32.33 +#endif
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/tools/libxen/include/xen/api/xen_int_float_map.h	Tue Apr 24 21:39:23 2007 +0100
    33.3 @@ -0,0 +1,53 @@
    33.4 +/*
    33.5 + * Copyright (c) 2006-2007, XenSource Inc.
    33.6 + *
    33.7 + * This library is free software; you can redistribute it and/or
    33.8 + * modify it under the terms of the GNU Lesser General Public
    33.9 + * License as published by the Free Software Foundation; either
   33.10 + * version 2.1 of the License, or (at your option) any later version.
   33.11 + *
   33.12 + * This library is distributed in the hope that it will be useful,
   33.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   33.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   33.15 + * Lesser General Public License for more details.
   33.16 + *
   33.17 + * You should have received a copy of the GNU Lesser General Public
   33.18 + * License along with this library; if not, write to the Free Software
   33.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   33.20 + */
   33.21 +
   33.22 +#ifndef XEN_INT_FLOAT_MAP_H
   33.23 +#define XEN_INT_FLOAT_MAP_H
   33.24 +
   33.25 +
   33.26 +#include <xen/api/xen_common.h>
   33.27 +
   33.28 +
   33.29 +typedef struct xen_int_float_map_contents
   33.30 +{
   33.31 +  int64_t key;
   33.32 +  double val;
   33.33 +} xen_int_float_map_contents;
   33.34 +
   33.35 +
   33.36 +typedef struct xen_int_float_map
   33.37 +{
   33.38 +    size_t size;
   33.39 +    xen_int_float_map_contents contents[];
   33.40 +} xen_int_float_map;
   33.41 +
   33.42 +/**
   33.43 + * Allocate a xen_int_float_map of the given size.
   33.44 + */
   33.45 +extern xen_int_float_map *
   33.46 +xen_int_float_map_alloc(size_t size);
   33.47 +
   33.48 +/**
   33.49 + * Free the given xen_int_float_map, and all referenced values.  The
   33.50 + * given map must have been allocated by this library.
   33.51 + */
   33.52 +extern void
   33.53 +xen_int_float_map_free(xen_int_float_map *map);
   33.54 +
   33.55 +
   33.56 +#endif
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/tools/libxen/include/xen/api/xen_int_int_map.h	Tue Apr 24 21:39:23 2007 +0100
    34.3 @@ -0,0 +1,53 @@
    34.4 +/*
    34.5 + * Copyright (c) 2006-2007, XenSource Inc.
    34.6 + *
    34.7 + * This library is free software; you can redistribute it and/or
    34.8 + * modify it under the terms of the GNU Lesser General Public
    34.9 + * License as published by the Free Software Foundation; either
   34.10 + * version 2.1 of the License, or (at your option) any later version.
   34.11 + *
   34.12 + * This library is distributed in the hope that it will be useful,
   34.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   34.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   34.15 + * Lesser General Public License for more details.
   34.16 + *
   34.17 + * You should have received a copy of the GNU Lesser General Public
   34.18 + * License along with this library; if not, write to the Free Software
   34.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   34.20 + */
   34.21 +
   34.22 +#ifndef XEN_INT_INT_MAP_H
   34.23 +#define XEN_INT_INT_MAP_H
   34.24 +
   34.25 +
   34.26 +#include <xen/api/xen_common.h>
   34.27 +
   34.28 +
   34.29 +typedef struct xen_int_int_map_contents
   34.30 +{
   34.31 +  int64_t key;
   34.32 +  int64_t val;
   34.33 +} xen_int_int_map_contents;
   34.34 +
   34.35 +
   34.36 +typedef struct xen_int_int_map
   34.37 +{
   34.38 +    size_t size;
   34.39 +    xen_int_int_map_contents contents[];
   34.40 +} xen_int_int_map;
   34.41 +
   34.42 +/**
   34.43 + * Allocate a xen_int_int_map of the given size.
   34.44 + */
   34.45 +extern xen_int_int_map *
   34.46 +xen_int_int_map_alloc(size_t size);
   34.47 +
   34.48 +/**
   34.49 + * Free the given xen_int_int_map, and all referenced values.  The
   34.50 + * given map must have been allocated by this library.
   34.51 + */
   34.52 +extern void
   34.53 +xen_int_int_map_free(xen_int_int_map *map);
   34.54 +
   34.55 +
   34.56 +#endif
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/tools/libxen/include/xen/api/xen_int_string_set_map.h	Tue Apr 24 21:39:23 2007 +0100
    35.3 @@ -0,0 +1,53 @@
    35.4 +/*
    35.5 + * Copyright (c) 2006-2007, XenSource Inc.
    35.6 + *
    35.7 + * This library is free software; you can redistribute it and/or
    35.8 + * modify it under the terms of the GNU Lesser General Public
    35.9 + * License as published by the Free Software Foundation; either
   35.10 + * version 2.1 of the License, or (at your option) any later version.
   35.11 + *
   35.12 + * This library is distributed in the hope that it will be useful,
   35.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   35.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   35.15 + * Lesser General Public License for more details.
   35.16 + *
   35.17 + * You should have received a copy of the GNU Lesser General Public
   35.18 + * License along with this library; if not, write to the Free Software
   35.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   35.20 + */
   35.21 +
   35.22 +#ifndef XEN_INT_STRING_SET_MAP_H
   35.23 +#define XEN_INT_STRING_SET_MAP_H
   35.24 +
   35.25 +
   35.26 +#include <xen/api/xen_common.h>
   35.27 +
   35.28 +
   35.29 +typedef struct xen_int_string_set_map_contents
   35.30 +{
   35.31 +  int64_t key;
   35.32 +  struct xen_string_set *val;
   35.33 +} xen_int_string_set_map_contents;
   35.34 +
   35.35 +
   35.36 +typedef struct xen_int_string_set_map
   35.37 +{
   35.38 +    size_t size;
   35.39 +    xen_int_string_set_map_contents contents[];
   35.40 +} xen_int_string_set_map;
   35.41 +
   35.42 +/**
   35.43 + * Allocate a xen_int_string_set_map of the given size.
   35.44 + */
   35.45 +extern xen_int_string_set_map *
   35.46 +xen_int_string_set_map_alloc(size_t size);
   35.47 +
   35.48 +/**
   35.49 + * Free the given xen_int_string_set_map, and all referenced values. 
   35.50 + * The given map must have been allocated by this library.
   35.51 + */
   35.52 +extern void
   35.53 +xen_int_string_set_map_free(xen_int_string_set_map *map);
   35.54 +
   35.55 +
   35.56 +#endif
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/tools/libxen/include/xen/api/xen_network.h	Tue Apr 24 21:39:23 2007 +0100
    36.3 @@ -0,0 +1,276 @@
    36.4 +/*
    36.5 + * Copyright (c) 2006-2007, XenSource Inc.
    36.6 + *
    36.7 + * This library is free software; you can redistribute it and/or
    36.8 + * modify it under the terms of the GNU Lesser General Public
    36.9 + * License as published by the Free Software Foundation; either
   36.10 + * version 2.1 of the License, or (at your option) any later version.
   36.11 + *
   36.12 + * This library is distributed in the hope that it will be useful,
   36.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   36.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   36.15 + * Lesser General Public License for more details.
   36.16 + *
   36.17 + * You should have received a copy of the GNU Lesser General Public
   36.18 + * License along with this library; if not, write to the Free Software
   36.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   36.20 + */
   36.21 +
   36.22 +#ifndef XEN_NETWORK_H
   36.23 +#define XEN_NETWORK_H
   36.24 +
   36.25 +#include <xen/api/xen_common.h>
   36.26 +#include <xen/api/xen_network_decl.h>
   36.27 +#include <xen/api/xen_pif_decl.h>
   36.28 +#include <xen/api/xen_string_string_map.h>
   36.29 +#include <xen/api/xen_vif_decl.h>
   36.30 +
   36.31 +
   36.32 +/*
   36.33 + * The network class.
   36.34 + * 
   36.35 + * A virtual network.
   36.36 + */
   36.37 +
   36.38 +
   36.39 +/**
   36.40 + * Free the given xen_network.  The given handle must have been
   36.41 + * allocated by this library.
   36.42 + */
   36.43 +extern void
   36.44 +xen_network_free(xen_network network);
   36.45 +
   36.46 +
   36.47 +typedef struct xen_network_set
   36.48 +{
   36.49 +    size_t size;
   36.50 +    xen_network *contents[];
   36.51 +} xen_network_set;
   36.52 +
   36.53 +/**
   36.54 + * Allocate a xen_network_set of the given size.
   36.55 + */
   36.56 +extern xen_network_set *
   36.57 +xen_network_set_alloc(size_t size);
   36.58 +
   36.59 +/**
   36.60 + * Free the given xen_network_set.  The given set must have been
   36.61 + * allocated by this library.
   36.62 + */
   36.63 +extern void
   36.64 +xen_network_set_free(xen_network_set *set);
   36.65 +
   36.66 +
   36.67 +typedef struct xen_network_record
   36.68 +{
   36.69 +    xen_network handle;
   36.70 +    char *uuid;
   36.71 +    char *name_label;
   36.72 +    char *name_description;
   36.73 +    struct xen_vif_record_opt_set *vifs;
   36.74 +    struct xen_pif_record_opt_set *pifs;
   36.75 +    xen_string_string_map *other_config;
   36.76 +} xen_network_record;
   36.77 +
   36.78 +/**
   36.79 + * Allocate a xen_network_record.
   36.80 + */
   36.81 +extern xen_network_record *
   36.82 +xen_network_record_alloc(void);
   36.83 +
   36.84 +/**
   36.85 + * Free the given xen_network_record, and all referenced values.  The
   36.86 + * given record must have been allocated by this library.
   36.87 + */
   36.88 +extern void
   36.89 +xen_network_record_free(xen_network_record *record);
   36.90 +
   36.91 +
   36.92 +typedef struct xen_network_record_opt
   36.93 +{
   36.94 +    bool is_record;
   36.95 +    union
   36.96 +    {
   36.97 +        xen_network handle;
   36.98 +        xen_network_record *record;
   36.99 +    } u;
  36.100 +} xen_network_record_opt;
  36.101 +
  36.102 +/**
  36.103 + * Allocate a xen_network_record_opt.
  36.104 + */
  36.105 +extern xen_network_record_opt *
  36.106 +xen_network_record_opt_alloc(void);
  36.107 +
  36.108 +/**
  36.109 + * Free the given xen_network_record_opt, and all referenced values. 
  36.110 + * The given record_opt must have been allocated by this library.
  36.111 + */
  36.112 +extern void
  36.113 +xen_network_record_opt_free(xen_network_record_opt *record_opt);
  36.114 +
  36.115 +
  36.116 +typedef struct xen_network_record_set
  36.117 +{
  36.118 +    size_t size;
  36.119 +    xen_network_record *contents[];
  36.120 +} xen_network_record_set;
  36.121 +
  36.122 +/**
  36.123 + * Allocate a xen_network_record_set of the given size.
  36.124 + */
  36.125 +extern xen_network_record_set *
  36.126 +xen_network_record_set_alloc(size_t size);
  36.127 +
  36.128 +/**
  36.129 + * Free the given xen_network_record_set, and all referenced values. 
  36.130 + * The given set must have been allocated by this library.
  36.131 + */
  36.132 +extern void
  36.133 +xen_network_record_set_free(xen_network_record_set *set);
  36.134 +
  36.135 +
  36.136 +
  36.137 +typedef struct xen_network_record_opt_set
  36.138 +{
  36.139 +    size_t size;
  36.140 +    xen_network_record_opt *contents[];
  36.141 +} xen_network_record_opt_set;
  36.142 +
  36.143 +/**
  36.144 + * Allocate a xen_network_record_opt_set of the given size.
  36.145 + */
  36.146 +extern xen_network_record_opt_set *
  36.147 +xen_network_record_opt_set_alloc(size_t size);
  36.148 +
  36.149 +/**
  36.150 + * Free the given xen_network_record_opt_set, and all referenced
  36.151 + * values.  The given set must have been allocated by this library.
  36.152 + */
  36.153 +extern void
  36.154 +xen_network_record_opt_set_free(xen_network_record_opt_set *set);
  36.155 +
  36.156 +
  36.157 +/**
  36.158 + * Get a record containing the current state of the given network.
  36.159 + */
  36.160 +extern bool
  36.161 +xen_network_get_record(xen_session *session, xen_network_record **result, xen_network network);
  36.162 +
  36.163 +
  36.164 +/**
  36.165 + * Get a reference to the network instance with the specified UUID.
  36.166 + */
  36.167 +extern bool
  36.168 +xen_network_get_by_uuid(xen_session *session, xen_network *result, char *uuid);
  36.169 +
  36.170 +
  36.171 +/**
  36.172 + * Create a new network instance, and return its handle.
  36.173 + */
  36.174 +extern bool
  36.175 +xen_network_create(xen_session *session, xen_network *result, xen_network_record *record);
  36.176 +
  36.177 +
  36.178 +/**
  36.179 + * Destroy the specified network instance.
  36.180 + */
  36.181 +extern bool
  36.182 +xen_network_destroy(xen_session *session, xen_network network);
  36.183 +
  36.184 +
  36.185 +/**
  36.186 + * Get all the network instances with the given label.
  36.187 + */
  36.188 +extern bool
  36.189 +xen_network_get_by_name_label(xen_session *session, struct xen_network_set **result, char *label);
  36.190 +
  36.191 +
  36.192 +/**
  36.193 + * Get the uuid field of the given network.
  36.194 + */
  36.195 +extern bool
  36.196 +xen_network_get_uuid(xen_session *session, char **result, xen_network network);
  36.197 +
  36.198 +
  36.199 +/**
  36.200 + * Get the name/label field of the given network.
  36.201 + */
  36.202 +extern bool
  36.203 +xen_network_get_name_label(xen_session *session, char **result, xen_network network);
  36.204 +
  36.205 +
  36.206 +/**
  36.207 + * Get the name/description field of the given network.
  36.208 + */
  36.209 +extern bool
  36.210 +xen_network_get_name_description(xen_session *session, char **result, xen_network network);
  36.211 +
  36.212 +
  36.213 +/**
  36.214 + * Get the VIFs field of the given network.
  36.215 + */
  36.216 +extern bool
  36.217 +xen_network_get_vifs(xen_session *session, struct xen_vif_set **result, xen_network network);
  36.218 +
  36.219 +
  36.220 +/**
  36.221 + * Get the PIFs field of the given network.
  36.222 + */
  36.223 +extern bool
  36.224 +xen_network_get_pifs(xen_session *session, struct xen_pif_set **result, xen_network network);
  36.225 +
  36.226 +
  36.227 +/**
  36.228 + * Get the other_config field of the given network.
  36.229 + */
  36.230 +extern bool
  36.231 +xen_network_get_other_config(xen_session *session, xen_string_string_map **result, xen_network network);
  36.232 +
  36.233 +
  36.234 +/**
  36.235 + * Set the name/label field of the given network.
  36.236 + */
  36.237 +extern bool
  36.238 +xen_network_set_name_label(xen_session *session, xen_network network, char *label);
  36.239 +
  36.240 +
  36.241 +/**
  36.242 + * Set the name/description field of the given network.
  36.243 + */
  36.244 +extern bool
  36.245 +xen_network_set_name_description(xen_session *session, xen_network network, char *description);
  36.246 +
  36.247 +
  36.248 +/**
  36.249 + * Set the other_config field of the given network.
  36.250 + */
  36.251 +extern bool
  36.252 +xen_network_set_other_config(xen_session *session, xen_network network, xen_string_string_map *other_config);
  36.253 +
  36.254 +
  36.255 +/**
  36.256 + * Add the given key-value pair to the other_config field of the given
  36.257 + * network.
  36.258 + */
  36.259 +extern bool
  36.260 +xen_network_add_to_other_config(xen_session *session, xen_network network, char *key, char *value);
  36.261 +
  36.262 +
  36.263 +/**
  36.264 + * Remove the given key and its corresponding value from the
  36.265 + * other_config field of the given network.  If the key is not in that Map,
  36.266 + * then do nothing.
  36.267 + */
  36.268 +extern bool
  36.269 +xen_network_remove_from_other_config(xen_session *session, xen_network network, char *key);
  36.270 +
  36.271 +
  36.272 +/**
  36.273 + * Return a list of all the networks known to the system.
  36.274 + */
  36.275 +extern bool
  36.276 +xen_network_get_all(xen_session *session, struct xen_network_set **result);
  36.277 +
  36.278 +
  36.279 +#endif
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/tools/libxen/include/xen/api/xen_network_decl.h	Tue Apr 24 21:39:23 2007 +0100
    37.3 @@ -0,0 +1,30 @@
    37.4 +/*
    37.5 + * Copyright (c) 2006-2007, XenSource Inc.
    37.6 + *
    37.7 + * This library is free software; you can redistribute it and/or
    37.8 + * modify it under the terms of the GNU Lesser General Public
    37.9 + * License as published by the Free Software Foundation; either
   37.10 + * version 2.1 of the License, or (at your option) any later version.
   37.11 + *
   37.12 + * This library is distributed in the hope that it will be useful,
   37.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   37.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   37.15 + * Lesser General Public License for more details.
   37.16 + *
   37.17 + * You should have received a copy of the GNU Lesser General Public
   37.18 + * License along with this library; if not, write to the Free Software
   37.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   37.20 + */
   37.21 +
   37.22 +#ifndef XEN_NETWORK_DECL_H
   37.23 +#define XEN_NETWORK_DECL_H
   37.24 +
   37.25 +typedef void *xen_network;
   37.26 +
   37.27 +struct xen_network_set;
   37.28 +struct xen_network_record;
   37.29 +struct xen_network_record_set;
   37.30 +struct xen_network_record_opt;
   37.31 +struct xen_network_record_opt_set;
   37.32 +
   37.33 +#endif
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/tools/libxen/include/xen/api/xen_on_crash_behaviour.h	Tue Apr 24 21:39:23 2007 +0100
    38.3 @@ -0,0 +1,97 @@
    38.4 +/*
    38.5 + * Copyright (c) 2006-2007, XenSource Inc.
    38.6 + *
    38.7 + * This library is free software; you can redistribute it and/or
    38.8 + * modify it under the terms of the GNU Lesser General Public
    38.9 + * License as published by the Free Software Foundation; either
   38.10 + * version 2.1 of the License, or (at your option) any later version.
   38.11 + *
   38.12 + * This library is distributed in the hope that it will be useful,
   38.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   38.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   38.15 + * Lesser General Public License for more details.
   38.16 + *
   38.17 + * You should have received a copy of the GNU Lesser General Public
   38.18 + * License along with this library; if not, write to the Free Software
   38.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   38.20 + */
   38.21 +
   38.22 +#ifndef XEN_ON_CRASH_BEHAVIOUR_H
   38.23 +#define XEN_ON_CRASH_BEHAVIOUR_H
   38.24 +
   38.25 +
   38.26 +#include <xen/api/xen_common.h>
   38.27 +
   38.28 +
   38.29 +enum xen_on_crash_behaviour
   38.30 +{
   38.31 +    /**
   38.32 +     * destroy the VM state
   38.33 +     */
   38.34 +    XEN_ON_CRASH_BEHAVIOUR_DESTROY,
   38.35 +
   38.36 +    /**
   38.37 +     * record a coredump and then destroy the VM state
   38.38 +     */
   38.39 +    XEN_ON_CRASH_BEHAVIOUR_COREDUMP_AND_DESTROY,
   38.40 +
   38.41 +    /**
   38.42 +     * restart the VM
   38.43 +     */
   38.44 +    XEN_ON_CRASH_BEHAVIOUR_RESTART,
   38.45 +
   38.46 +    /**
   38.47 +     * record a coredump and then restart the VM
   38.48 +     */
   38.49 +    XEN_ON_CRASH_BEHAVIOUR_COREDUMP_AND_RESTART,
   38.50 +
   38.51 +    /**
   38.52 +     * leave the crashed VM as-is
   38.53 +     */
   38.54 +    XEN_ON_CRASH_BEHAVIOUR_PRESERVE,
   38.55 +
   38.56 +    /**
   38.57 +     * rename the crashed VM and start a new copy
   38.58 +     */
   38.59 +    XEN_ON_CRASH_BEHAVIOUR_RENAME_RESTART
   38.60 +};
   38.61 +
   38.62 +
   38.63 +typedef struct xen_on_crash_behaviour_set
   38.64 +{
   38.65 +    size_t size;
   38.66 +    enum xen_on_crash_behaviour contents[];
   38.67 +} xen_on_crash_behaviour_set;
   38.68 +
   38.69 +/**
   38.70 + * Allocate a xen_on_crash_behaviour_set of the given size.
   38.71 + */
   38.72 +extern xen_on_crash_behaviour_set *
   38.73 +xen_on_crash_behaviour_set_alloc(size_t size);
   38.74 +
   38.75 +/**
   38.76 + * Free the given xen_on_crash_behaviour_set.  The given set must have
   38.77 + * been allocated by this library.
   38.78 + */
   38.79 +extern void
   38.80 +xen_on_crash_behaviour_set_free(xen_on_crash_behaviour_set *set);
   38.81 +
   38.82 +
   38.83 +/**
   38.84 + * Return the name corresponding to the given code.  This string must
   38.85 + * not be modified or freed.
   38.86 + */
   38.87 +extern const char *
   38.88 +xen_on_crash_behaviour_to_string(enum xen_on_crash_behaviour val);
   38.89 +
   38.90 +
   38.91 +/**
   38.92 + * Return the correct code for the given string, or set the session
   38.93 + * object to failure and return an undefined value if the given string does
   38.94 + * not match a known code.
   38.95 + */
   38.96 +extern enum xen_on_crash_behaviour
   38.97 +xen_on_crash_behaviour_from_string(xen_session *session, const char *str);
   38.98 +
   38.99 +
  38.100 +#endif
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/tools/libxen/include/xen/api/xen_on_normal_exit.h	Tue Apr 24 21:39:23 2007 +0100
    39.3 @@ -0,0 +1,77 @@
    39.4 +/*
    39.5 + * Copyright (c) 2006-2007, XenSource Inc.
    39.6 + *
    39.7 + * This library is free software; you can redistribute it and/or
    39.8 + * modify it under the terms of the GNU Lesser General Public
    39.9 + * License as published by the Free Software Foundation; either
   39.10 + * version 2.1 of the License, or (at your option) any later version.
   39.11 + *
   39.12 + * This library is distributed in the hope that it will be useful,
   39.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   39.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   39.15 + * Lesser General Public License for more details.
   39.16 + *
   39.17 + * You should have received a copy of the GNU Lesser General Public
   39.18 + * License along with this library; if not, write to the Free Software
   39.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   39.20 + */
   39.21 +
   39.22 +#ifndef XEN_ON_NORMAL_EXIT_H
   39.23 +#define XEN_ON_NORMAL_EXIT_H
   39.24 +
   39.25 +
   39.26 +#include <xen/api/xen_common.h>
   39.27 +
   39.28 +
   39.29 +enum xen_on_normal_exit
   39.30 +{
   39.31 +    /**
   39.32 +     * destroy the VM state
   39.33 +     */
   39.34 +    XEN_ON_NORMAL_EXIT_DESTROY,
   39.35 +
   39.36 +    /**
   39.37 +     * restart the VM
   39.38 +     */
   39.39 +    XEN_ON_NORMAL_EXIT_RESTART
   39.40 +};
   39.41 +
   39.42 +
   39.43 +typedef struct xen_on_normal_exit_set
   39.44 +{
   39.45 +    size_t size;
   39.46 +    enum xen_on_normal_exit contents[];
   39.47 +} xen_on_normal_exit_set;
   39.48 +
   39.49 +/**
   39.50 + * Allocate a xen_on_normal_exit_set of the given size.
   39.51 + */
   39.52 +extern xen_on_normal_exit_set *
   39.53 +xen_on_normal_exit_set_alloc(size_t size);
   39.54 +
   39.55 +/**
   39.56 + * Free the given xen_on_normal_exit_set.  The given set must have been
   39.57 + * allocated by this library.
   39.58 + */
   39.59 +extern void
   39.60 +xen_on_normal_exit_set_free(xen_on_normal_exit_set *set);
   39.61 +
   39.62 +
   39.63 +/**
   39.64 + * Return the name corresponding to the given code.  This string must
   39.65 + * not be modified or freed.
   39.66 + */
   39.67 +extern const char *
   39.68 +xen_on_normal_exit_to_string(enum xen_on_normal_exit val);
   39.69 +
   39.70 +
   39.71 +/**
   39.72 + * Return the correct code for the given string, or set the session
   39.73 + * object to failure and return an undefined value if the given string does
   39.74 + * not match a known code.
   39.75 + */
   39.76 +extern enum xen_on_normal_exit
   39.77 +xen_on_normal_exit_from_string(xen_session *session, const char *str);
   39.78 +
   39.79 +
   39.80 +#endif
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/tools/libxen/include/xen/api/xen_pbd.h	Tue Apr 24 21:39:23 2007 +0100
    40.3 @@ -0,0 +1,223 @@
    40.4 +/*
    40.5 + * Copyright (c) 2006-2007, XenSource Inc.
    40.6 + *
    40.7 + * This library is free software; you can redistribute it and/or
    40.8 + * modify it under the terms of the GNU Lesser General Public
    40.9 + * License as published by the Free Software Foundation; either
   40.10 + * version 2.1 of the License, or (at your option) any later version.
   40.11 + *
   40.12 + * This library is distributed in the hope that it will be useful,
   40.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   40.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   40.15 + * Lesser General Public License for more details.
   40.16 + *
   40.17 + * You should have received a copy of the GNU Lesser General Public
   40.18 + * License along with this library; if not, write to the Free Software
   40.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   40.20 + */
   40.21 +
   40.22 +#ifndef XEN_PBD_H
   40.23 +#define XEN_PBD_H
   40.24 +
   40.25 +#include <xen/api/xen_common.h>
   40.26 +#include <xen/api/xen_host_decl.h>
   40.27 +#include <xen/api/xen_pbd_decl.h>
   40.28 +#include <xen/api/xen_sr_decl.h>
   40.29 +#include <xen/api/xen_string_string_map.h>
   40.30 +
   40.31 +
   40.32 +/*
   40.33 + * The PBD class.
   40.34 + * 
   40.35 + * The physical block devices through which hosts access SRs.
   40.36 + */
   40.37 +
   40.38 +
   40.39 +/**
   40.40 + * Free the given xen_pbd.  The given handle must have been allocated
   40.41 + * by this library.
   40.42 + */
   40.43 +extern void
   40.44 +xen_pbd_free(xen_pbd pbd);
   40.45 +
   40.46 +
   40.47 +typedef struct xen_pbd_set
   40.48 +{
   40.49 +    size_t size;
   40.50 +    xen_pbd *contents[];
   40.51 +} xen_pbd_set;
   40.52 +
   40.53 +/**
   40.54 + * Allocate a xen_pbd_set of the given size.
   40.55 + */
   40.56 +extern xen_pbd_set *
   40.57 +xen_pbd_set_alloc(size_t size);
   40.58 +
   40.59 +/**
   40.60 + * Free the given xen_pbd_set.  The given set must have been allocated
   40.61 + * by this library.
   40.62 + */
   40.63 +extern void
   40.64 +xen_pbd_set_free(xen_pbd_set *set);
   40.65 +
   40.66 +
   40.67 +typedef struct xen_pbd_record
   40.68 +{
   40.69 +    xen_pbd handle;
   40.70 +    char *uuid;
   40.71 +    struct xen_host_record_opt *host;
   40.72 +    struct xen_sr_record_opt *sr;
   40.73 +    xen_string_string_map *device_config;
   40.74 +    bool currently_attached;
   40.75 +} xen_pbd_record;
   40.76 +
   40.77 +/**
   40.78 + * Allocate a xen_pbd_record.
   40.79 + */
   40.80 +extern xen_pbd_record *
   40.81 +xen_pbd_record_alloc(void);
   40.82 +
   40.83 +/**
   40.84 + * Free the given xen_pbd_record, and all referenced values.  The given
   40.85 + * record must have been allocated by this library.
   40.86 + */
   40.87 +extern void
   40.88 +xen_pbd_record_free(xen_pbd_record *record);
   40.89 +
   40.90 +
   40.91 +typedef struct xen_pbd_record_opt
   40.92 +{
   40.93 +    bool is_record;
   40.94 +    union
   40.95 +    {
   40.96 +        xen_pbd handle;
   40.97 +        xen_pbd_record *record;
   40.98 +    } u;
   40.99 +} xen_pbd_record_opt;
  40.100 +
  40.101 +/**
  40.102 + * Allocate a xen_pbd_record_opt.
  40.103 + */
  40.104 +extern xen_pbd_record_opt *
  40.105 +xen_pbd_record_opt_alloc(void);
  40.106 +
  40.107 +/**
  40.108 + * Free the given xen_pbd_record_opt, and all referenced values.  The
  40.109 + * given record_opt must have been allocated by this library.
  40.110 + */
  40.111 +extern void
  40.112 +xen_pbd_record_opt_free(xen_pbd_record_opt *record_opt);
  40.113 +
  40.114 +
  40.115 +typedef struct xen_pbd_record_set
  40.116 +{
  40.117 +    size_t size;
  40.118 +    xen_pbd_record *contents[];
  40.119 +} xen_pbd_record_set;
  40.120 +
  40.121 +/**
  40.122 + * Allocate a xen_pbd_record_set of the given size.
  40.123 + */
  40.124 +extern xen_pbd_record_set *
  40.125 +xen_pbd_record_set_alloc(size_t size);
  40.126 +
  40.127 +/**
  40.128 + * Free the given xen_pbd_record_set, and all referenced values.  The
  40.129 + * given set must have been allocated by this library.
  40.130 + */
  40.131 +extern void
  40.132 +xen_pbd_record_set_free(xen_pbd_record_set *set);
  40.133 +
  40.134 +
  40.135 +
  40.136 +typedef struct xen_pbd_record_opt_set
  40.137 +{
  40.138 +    size_t size;
  40.139 +    xen_pbd_record_opt *contents[];
  40.140 +} xen_pbd_record_opt_set;
  40.141 +
  40.142 +/**
  40.143 + * Allocate a xen_pbd_record_opt_set of the given size.
  40.144 + */
  40.145 +extern xen_pbd_record_opt_set *
  40.146 +xen_pbd_record_opt_set_alloc(size_t size);
  40.147 +
  40.148 +/**
  40.149 + * Free the given xen_pbd_record_opt_set, and all referenced values. 
  40.150 + * The given set must have been allocated by this library.
  40.151 + */
  40.152 +extern void
  40.153 +xen_pbd_record_opt_set_free(xen_pbd_record_opt_set *set);
  40.154 +
  40.155 +
  40.156 +/**
  40.157 + * Get a record containing the current state of the given PBD.
  40.158 + */
  40.159 +extern bool
  40.160 +xen_pbd_get_record(xen_session *session, xen_pbd_record **result, xen_pbd pbd);
  40.161 +
  40.162 +
  40.163 +/**
  40.164 + * Get a reference to the PBD instance with the specified UUID.
  40.165 + */
  40.166 +extern bool
  40.167 +xen_pbd_get_by_uuid(xen_session *session, xen_pbd *result, char *uuid);
  40.168 +
  40.169 +
  40.170 +/**
  40.171 + * Create a new PBD instance, and return its handle.
  40.172 + */
  40.173 +extern bool
  40.174 +xen_pbd_create(xen_session *session, xen_pbd *result, xen_pbd_record *record);
  40.175 +
  40.176 +
  40.177 +/**
  40.178 + * Destroy the specified PBD instance.
  40.179 + */
  40.180 +extern bool
  40.181 +xen_pbd_destroy(xen_session *session, xen_pbd pbd);
  40.182 +
  40.183 +
  40.184 +/**
  40.185 + * Get the uuid field of the given PBD.
  40.186 + */
  40.187 +extern bool
  40.188 +xen_pbd_get_uuid(xen_session *session, char **result, xen_pbd pbd);
  40.189 +
  40.190 +
  40.191 +/**
  40.192 + * Get the host field of the given PBD.
  40.193 + */
  40.194 +extern bool
  40.195 +xen_pbd_get_host(xen_session *session, xen_host *result, xen_pbd pbd);
  40.196 +
  40.197 +
  40.198 +/**
  40.199 + * Get the SR field of the given PBD.
  40.200 + */
  40.201 +extern bool
  40.202 +xen_pbd_get_sr(xen_session *session, xen_sr *result, xen_pbd pbd);
  40.203 +
  40.204 +
  40.205 +/**
  40.206 + * Get the device_config field of the given PBD.
  40.207 + */
  40.208 +extern bool
  40.209 +xen_pbd_get_device_config(xen_session *session, xen_string_string_map **result, xen_pbd pbd);
  40.210 +
  40.211 +
  40.212 +/**
  40.213 + * Get the currently_attached field of the given PBD.
  40.214 + */
  40.215 +extern bool
  40.216 +xen_pbd_get_currently_attached(xen_session *session, bool *result, xen_pbd pbd);
  40.217 +
  40.218 +
  40.219 +/**
  40.220 + * Return a list of all the PBDs known to the system.
  40.221 + */
  40.222 +extern bool
  40.223 +xen_pbd_get_all(xen_session *session, struct xen_pbd_set **result);
  40.224 +
  40.225 +
  40.226 +#endif
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/tools/libxen/include/xen/api/xen_pbd_decl.h	Tue Apr 24 21:39:23 2007 +0100
    41.3 @@ -0,0 +1,30 @@
    41.4 +/*
    41.5 + * Copyright (c) 2006-2007, XenSource Inc.
    41.6 + *
    41.7 + * This library is free software; you can redistribute it and/or
    41.8 + * modify it under the terms of the GNU Lesser General Public
    41.9 + * License as published by the Free Software Foundation; either
   41.10 + * version 2.1 of the License, or (at your option) any later version.
   41.11 + *
   41.12 + * This library is distributed in the hope that it will be useful,
   41.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   41.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   41.15 + * Lesser General Public License for more details.
   41.16 + *
   41.17 + * You should have received a copy of the GNU Lesser General Public
   41.18 + * License along with this library; if not, write to the Free Software
   41.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   41.20 + */
   41.21 +
   41.22 +#ifndef XEN_PBD_DECL_H
   41.23 +#define XEN_PBD_DECL_H
   41.24 +
   41.25 +typedef void *xen_pbd;
   41.26 +
   41.27 +struct xen_pbd_set;
   41.28 +struct xen_pbd_record;
   41.29 +struct xen_pbd_record_set;
   41.30 +struct xen_pbd_record_opt;
   41.31 +struct xen_pbd_record_opt_set;
   41.32 +
   41.33 +#endif
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/tools/libxen/include/xen/api/xen_pif.h	Tue Apr 24 21:39:23 2007 +0100
    42.3 @@ -0,0 +1,277 @@
    42.4 +/*
    42.5 + * Copyright (c) 2006-2007, XenSource Inc.
    42.6 + *
    42.7 + * This library is free software; you can redistribute it and/or
    42.8 + * modify it under the terms of the GNU Lesser General Public
    42.9 + * License as published by the Free Software Foundation; either
   42.10 + * version 2.1 of the License, or (at your option) any later version.
   42.11 + *
   42.12 + * This library is distributed in the hope that it will be useful,
   42.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   42.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   42.15 + * Lesser General Public License for more details.
   42.16 + *
   42.17 + * You should have received a copy of the GNU Lesser General Public
   42.18 + * License along with this library; if not, write to the Free Software
   42.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   42.20 + */
   42.21 +
   42.22 +#ifndef XEN_PIF_H
   42.23 +#define XEN_PIF_H
   42.24 +
   42.25 +#include <xen/api/xen_common.h>
   42.26 +#include <xen/api/xen_host_decl.h>
   42.27 +#include <xen/api/xen_network_decl.h>
   42.28 +#include <xen/api/xen_pif_decl.h>
   42.29 +#include <xen/api/xen_pif_metrics_decl.h>
   42.30 +
   42.31 +
   42.32 +/*
   42.33 + * The PIF class.
   42.34 + * 
   42.35 + * A physical network interface (note separate VLANs are represented as
   42.36 + * several PIFs).
   42.37 + */
   42.38 +
   42.39 +
   42.40 +/**
   42.41 + * Free the given xen_pif.  The given handle must have been allocated
   42.42 + * by this library.
   42.43 + */
   42.44 +extern void
   42.45 +xen_pif_free(xen_pif pif);
   42.46 +
   42.47 +
   42.48 +typedef struct xen_pif_set
   42.49 +{
   42.50 +    size_t size;
   42.51 +    xen_pif *contents[];
   42.52 +} xen_pif_set;
   42.53 +
   42.54 +/**
   42.55 + * Allocate a xen_pif_set of the given size.
   42.56 + */
   42.57 +extern xen_pif_set *
   42.58 +xen_pif_set_alloc(size_t size);
   42.59 +
   42.60 +/**
   42.61 + * Free the given xen_pif_set.  The given set must have been allocated
   42.62 + * by this library.
   42.63 + */
   42.64 +extern void
   42.65 +xen_pif_set_free(xen_pif_set *set);
   42.66 +
   42.67 +
   42.68 +typedef struct xen_pif_record
   42.69 +{
   42.70 +    xen_pif handle;
   42.71 +    char *uuid;
   42.72 +    char *device;
   42.73 +    struct xen_network_record_opt *network;
   42.74 +    struct xen_host_record_opt *host;
   42.75 +    char *mac;
   42.76 +    int64_t mtu;
   42.77 +    int64_t vlan;
   42.78 +    struct xen_pif_metrics_record_opt *metrics;
   42.79 +} xen_pif_record;
   42.80 +
   42.81 +/**
   42.82 + * Allocate a xen_pif_record.
   42.83 + */
   42.84 +extern xen_pif_record *
   42.85 +xen_pif_record_alloc(void);
   42.86 +
   42.87 +/**
   42.88 + * Free the given xen_pif_record, and all referenced values.  The given
   42.89 + * record must have been allocated by this library.
   42.90 + */
   42.91 +extern void
   42.92 +xen_pif_record_free(xen_pif_record *record);
   42.93 +
   42.94 +
   42.95 +typedef struct xen_pif_record_opt
   42.96 +{
   42.97 +    bool is_record;
   42.98 +    union
   42.99 +    {
  42.100 +        xen_pif handle;
  42.101 +        xen_pif_record *record;
  42.102 +    } u;
  42.103 +} xen_pif_record_opt;
  42.104 +
  42.105 +/**
  42.106 + * Allocate a xen_pif_record_opt.
  42.107 + */
  42.108 +extern xen_pif_record_opt *
  42.109 +xen_pif_record_opt_alloc(void);
  42.110 +
  42.111 +/**
  42.112 + * Free the given xen_pif_record_opt, and all referenced values.  The
  42.113 + * given record_opt must have been allocated by this library.
  42.114 + */
  42.115 +extern void
  42.116 +xen_pif_record_opt_free(xen_pif_record_opt *record_opt);
  42.117 +
  42.118 +
  42.119 +typedef struct xen_pif_record_set
  42.120 +{
  42.121 +    size_t size;
  42.122 +    xen_pif_record *contents[];
  42.123 +} xen_pif_record_set;
  42.124 +
  42.125 +/**
  42.126 + * Allocate a xen_pif_record_set of the given size.
  42.127 + */
  42.128 +extern xen_pif_record_set *
  42.129 +xen_pif_record_set_alloc(size_t size);
  42.130 +
  42.131 +/**
  42.132 + * Free the given xen_pif_record_set, and all referenced values.  The
  42.133 + * given set must have been allocated by this library.
  42.134 + */
  42.135 +extern void
  42.136 +xen_pif_record_set_free(xen_pif_record_set *set);
  42.137 +
  42.138 +
  42.139 +
  42.140 +typedef struct xen_pif_record_opt_set
  42.141 +{
  42.142 +    size_t size;
  42.143 +    xen_pif_record_opt *contents[];
  42.144 +} xen_pif_record_opt_set;
  42.145 +
  42.146 +/**
  42.147 + * Allocate a xen_pif_record_opt_set of the given size.
  42.148 + */
  42.149 +extern xen_pif_record_opt_set *
  42.150 +xen_pif_record_opt_set_alloc(size_t size);
  42.151 +
  42.152 +/**
  42.153 + * Free the given xen_pif_record_opt_set, and all referenced values. 
  42.154 + * The given set must have been allocated by this library.
  42.155 + */
  42.156 +extern void
  42.157 +xen_pif_record_opt_set_free(xen_pif_record_opt_set *set);
  42.158 +
  42.159 +
  42.160 +/**
  42.161 + * Get a record containing the current state of the given PIF.
  42.162 + */
  42.163 +extern bool
  42.164 +xen_pif_get_record(xen_session *session, xen_pif_record **result, xen_pif pif);
  42.165 +
  42.166 +
  42.167 +/**
  42.168 + * Get a reference to the PIF instance with the specified UUID.
  42.169 + */
  42.170 +extern bool
  42.171 +xen_pif_get_by_uuid(xen_session *session, xen_pif *result, char *uuid);
  42.172 +
  42.173 +
  42.174 +/**
  42.175 + * Get the uuid field of the given PIF.
  42.176 + */
  42.177 +extern bool
  42.178 +xen_pif_get_uuid(xen_session *session, char **result, xen_pif pif);
  42.179 +
  42.180 +
  42.181 +/**
  42.182 + * Get the device field of the given PIF.
  42.183 + */
  42.184 +extern bool
  42.185 +xen_pif_get_device(xen_session *session, char **result, xen_pif pif);
  42.186 +
  42.187 +
  42.188 +/**
  42.189 + * Get the network field of the given PIF.
  42.190 + */
  42.191 +extern bool
  42.192 +xen_pif_get_network(xen_session *session, xen_network *result, xen_pif pif);
  42.193 +
  42.194 +
  42.195 +/**
  42.196 + * Get the host field of the given PIF.
  42.197 + */
  42.198 +extern bool
  42.199 +xen_pif_get_host(xen_session *session, xen_host *result, xen_pif pif);
  42.200 +
  42.201 +
  42.202 +/**
  42.203 + * Get the MAC field of the given PIF.
  42.204 + */
  42.205 +extern bool
  42.206 +xen_pif_get_mac(xen_session *session, char **result, xen_pif pif);
  42.207 +
  42.208 +
  42.209 +/**
  42.210 + * Get the MTU field of the given PIF.
  42.211 + */
  42.212 +extern bool
  42.213 +xen_pif_get_mtu(xen_session *session, int64_t *result, xen_pif pif);
  42.214 +
  42.215 +
  42.216 +/**
  42.217 + * Get the VLAN field of the given PIF.
  42.218 + */
  42.219 +extern bool
  42.220 +xen_pif_get_vlan(xen_session *session, int64_t *result, xen_pif pif);
  42.221 +
  42.222 +
  42.223 +/**
  42.224 + * Get the metrics field of the given PIF.
  42.225 + */
  42.226 +extern bool
  42.227 +xen_pif_get_metrics(xen_session *session, xen_pif_metrics *result, xen_pif pif);
  42.228 +
  42.229 +
  42.230 +/**
  42.231 + * Set the device field of the given PIF.
  42.232 + */
  42.233 +extern bool
  42.234 +xen_pif_set_device(xen_session *session, xen_pif pif, char *device);
  42.235 +
  42.236 +
  42.237 +/**
  42.238 + * Set the MAC field of the given PIF.
  42.239 + */
  42.240 +extern bool
  42.241 +xen_pif_set_mac(xen_session *session, xen_pif pif, char *mac);
  42.242 +
  42.243 +
  42.244 +/**
  42.245 + * Set the MTU field of the given PIF.
  42.246 + */
  42.247 +extern bool
  42.248 +xen_pif_set_mtu(xen_session *session, xen_pif pif, int64_t mtu);
  42.249 +
  42.250 +
  42.251 +/**
  42.252 + * Set the VLAN field of the given PIF.
  42.253 + */
  42.254 +extern bool
  42.255 +xen_pif_set_vlan(xen_session *session, xen_pif pif, int64_t vlan);
  42.256 +
  42.257 +
  42.258 +/**
  42.259 + * Create a VLAN interface from an existing physical interface.
  42.260 + */
  42.261 +extern bool
  42.262 +xen_pif_create_vlan(xen_session *session, xen_pif *result, char *device, xen_network network, xen_host host, int64_t vlan);
  42.263 +
  42.264 +
  42.265 +/**
  42.266 + * Destroy the interface (provided it is a synthetic interface like a
  42.267 + * VLAN; fail if it is a physical interface).
  42.268 + */
  42.269 +extern bool
  42.270 +xen_pif_destroy(xen_session *session, xen_pif self);
  42.271 +
  42.272 +
  42.273 +/**
  42.274 + * Return a list of all the PIFs known to the system.
  42.275 + */
  42.276 +extern bool
  42.277 +xen_pif_get_all(xen_session *session, struct xen_pif_set **result);
  42.278 +
  42.279 +
  42.280 +#endif
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/tools/libxen/include/xen/api/xen_pif_decl.h	Tue Apr 24 21:39:23 2007 +0100
    43.3 @@ -0,0 +1,30 @@
    43.4 +/*
    43.5 + * Copyright (c) 2006-2007, XenSource Inc.
    43.6 + *
    43.7 + * This library is free software; you can redistribute it and/or
    43.8 + * modify it under the terms of the GNU Lesser General Public
    43.9 + * License as published by the Free Software Foundation; either
   43.10 + * version 2.1 of the License, or (at your option) any later version.
   43.11 + *
   43.12 + * This library is distributed in the hope that it will be useful,
   43.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   43.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   43.15 + * Lesser General Public License for more details.
   43.16 + *
   43.17 + * You should have received a copy of the GNU Lesser General Public
   43.18 + * License along with this library; if not, write to the Free Software
   43.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   43.20 + */
   43.21 +
   43.22 +#ifndef XEN_PIF_DECL_H
   43.23 +#define XEN_PIF_DECL_H
   43.24 +
   43.25 +typedef void *xen_pif;
   43.26 +
   43.27 +struct xen_pif_set;
   43.28 +struct xen_pif_record;
   43.29 +struct xen_pif_record_set;
   43.30 +struct xen_pif_record_opt;
   43.31 +struct xen_pif_record_opt_set;
   43.32 +
   43.33 +#endif
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/tools/libxen/include/xen/api/xen_pif_metrics.h	Tue Apr 24 21:39:23 2007 +0100
    44.3 @@ -0,0 +1,198 @@
    44.4 +/*
    44.5 + * Copyright (c) 2006-2007, XenSource Inc.
    44.6 + *
    44.7 + * This library is free software; you can redistribute it and/or
    44.8 + * modify it under the terms of the GNU Lesser General Public
    44.9 + * License as published by the Free Software Foundation; either
   44.10 + * version 2.1 of the License, or (at your option) any later version.
   44.11 + *
   44.12 + * This library is distributed in the hope that it will be useful,
   44.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   44.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   44.15 + * Lesser General Public License for more details.
   44.16 + *
   44.17 + * You should have received a copy of the GNU Lesser General Public
   44.18 + * License along with this library; if not, write to the Free Software
   44.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   44.20 + */
   44.21 +
   44.22 +#ifndef XEN_PIF_METRICS_H
   44.23 +#define XEN_PIF_METRICS_H
   44.24 +
   44.25 +#include <xen/api/xen_common.h>
   44.26 +#include <xen/api/xen_pif_metrics_decl.h>
   44.27 +
   44.28 +
   44.29 +/*
   44.30 + * The PIF_metrics class.
   44.31 + * 
   44.32 + * The metrics associated with a physical network interface.
   44.33 + */
   44.34 +
   44.35 +
   44.36 +/**
   44.37 + * Free the given xen_pif_metrics.  The given handle must have been
   44.38 + * allocated by this library.
   44.39 + */
   44.40 +extern void
   44.41 +xen_pif_metrics_free(xen_pif_metrics pif_metrics);
   44.42 +
   44.43 +
   44.44 +typedef struct xen_pif_metrics_set
   44.45 +{
   44.46 +    size_t size;
   44.47 +    xen_pif_metrics *contents[];
   44.48 +} xen_pif_metrics_set;
   44.49 +
   44.50 +/**
   44.51 + * Allocate a xen_pif_metrics_set of the given size.
   44.52 + */
   44.53 +extern xen_pif_metrics_set *
   44.54 +xen_pif_metrics_set_alloc(size_t size);
   44.55 +
   44.56 +/**
   44.57 + * Free the given xen_pif_metrics_set.  The given set must have been
   44.58 + * allocated by this library.
   44.59 + */
   44.60 +extern void
   44.61 +xen_pif_metrics_set_free(xen_pif_metrics_set *set);
   44.62 +
   44.63 +
   44.64 +typedef struct xen_pif_metrics_record
   44.65 +{
   44.66 +    xen_pif_metrics handle;
   44.67 +    char *uuid;
   44.68 +    double io_read_kbs;
   44.69 +    double io_write_kbs;
   44.70 +    time_t last_updated;
   44.71 +} xen_pif_metrics_record;
   44.72 +
   44.73 +/**
   44.74 + * Allocate a xen_pif_metrics_record.
   44.75 + */
   44.76 +extern xen_pif_metrics_record *
   44.77 +xen_pif_metrics_record_alloc(void);
   44.78 +
   44.79 +/**
   44.80 + * Free the given xen_pif_metrics_record, and all referenced values. 
   44.81 + * The given record must have been allocated by this library.
   44.82 + */
   44.83 +extern void
   44.84 +xen_pif_metrics_record_free(xen_pif_metrics_record *record);
   44.85 +
   44.86 +
   44.87 +typedef struct xen_pif_metrics_record_opt
   44.88 +{
   44.89 +    bool is_record;
   44.90 +    union
   44.91 +    {
   44.92 +        xen_pif_metrics handle;
   44.93 +        xen_pif_metrics_record *record;
   44.94 +    } u;
   44.95 +} xen_pif_metrics_record_opt;
   44.96 +
   44.97 +/**
   44.98 + * Allocate a xen_pif_metrics_record_opt.
   44.99 + */
  44.100 +extern xen_pif_metrics_record_opt *
  44.101 +xen_pif_metrics_record_opt_alloc(void);
  44.102 +
  44.103 +/**
  44.104 + * Free the given xen_pif_metrics_record_opt, and all referenced
  44.105 + * values.  The given record_opt must have been allocated by this library.
  44.106 + */
  44.107 +extern void
  44.108 +xen_pif_metrics_record_opt_free(xen_pif_metrics_record_opt *record_opt);
  44.109 +
  44.110 +
  44.111 +typedef struct xen_pif_metrics_record_set
  44.112 +{
  44.113 +    size_t size;
  44.114 +    xen_pif_metrics_record *contents[];
  44.115 +} xen_pif_metrics_record_set;
  44.116 +
  44.117 +/**
  44.118 + * Allocate a xen_pif_metrics_record_set of the given size.
  44.119 + */
  44.120 +extern xen_pif_metrics_record_set *
  44.121 +xen_pif_metrics_record_set_alloc(size_t size);
  44.122 +
  44.123 +/**
  44.124 + * Free the given xen_pif_metrics_record_set, and all referenced
  44.125 + * values.  The given set must have been allocated by this library.
  44.126 + */
  44.127 +extern void
  44.128 +xen_pif_metrics_record_set_free(xen_pif_metrics_record_set *set);
  44.129 +
  44.130 +
  44.131 +
  44.132 +typedef struct xen_pif_metrics_record_opt_set
  44.133 +{
  44.134 +    size_t size;
  44.135 +    xen_pif_metrics_record_opt *contents[];
  44.136 +} xen_pif_metrics_record_opt_set;
  44.137 +
  44.138 +/**
  44.139 + * Allocate a xen_pif_metrics_record_opt_set of the given size.
  44.140 + */
  44.141 +extern xen_pif_metrics_record_opt_set *
  44.142 +xen_pif_metrics_record_opt_set_alloc(size_t size);
  44.143 +
  44.144 +/**
  44.145 + * Free the given xen_pif_metrics_record_opt_set, and all referenced
  44.146 + * values.  The given set must have been allocated by this library.
  44.147 + */
  44.148 +extern void
  44.149 +xen_pif_metrics_record_opt_set_free(xen_pif_metrics_record_opt_set *set);
  44.150 +
  44.151 +
  44.152 +/**
  44.153 + * Get a record containing the current state of the given PIF_metrics.
  44.154 + */
  44.155 +extern bool
  44.156 +xen_pif_metrics_get_record(xen_session *session, xen_pif_metrics_record **result, xen_pif_metrics pif_metrics);
  44.157 +
  44.158 +
  44.159 +/**
  44.160 + * Get a reference to the PIF_metrics instance with the specified UUID.
  44.161 + */
  44.162 +extern bool
  44.163 +xen_pif_metrics_get_by_uuid(xen_session *session, xen_pif_metrics *result, char *uuid);
  44.164 +
  44.165 +
  44.166 +/**
  44.167 + * Get the uuid field of the given PIF_metrics.
  44.168 + */
  44.169 +extern bool
  44.170 +xen_pif_metrics_get_uuid(xen_session *session, char **result, xen_pif_metrics pif_metrics);
  44.171 +
  44.172 +
  44.173 +/**
  44.174 + * Get the io/read_kbs field of the given PIF_metrics.
  44.175 + */
  44.176 +extern bool
  44.177 +xen_pif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics);
  44.178 +
  44.179 +
  44.180 +/**
  44.181 + * Get the io/write_kbs field of the given PIF_metrics.
  44.182 + */
  44.183 +extern bool
  44.184 +xen_pif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics);
  44.185 +
  44.186 +
  44.187 +/**
  44.188 + * Get the last_updated field of the given PIF_metrics.
  44.189 + */
  44.190 +extern bool
  44.191 +xen_pif_metrics_get_last_updated(xen_session *session, time_t *result, xen_pif_metrics pif_metrics);
  44.192 +
  44.193 +
  44.194 +/**
  44.195 + * Return a list of all the PIF_metrics instances known to the system.
  44.196 + */
  44.197 +extern bool
  44.198 +xen_pif_metrics_get_all(xen_session *session, struct xen_pif_metrics_set **result);
  44.199 +
  44.200 +
  44.201 +#endif
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/tools/libxen/include/xen/api/xen_pif_metrics_decl.h	Tue Apr 24 21:39:23 2007 +0100
    45.3 @@ -0,0 +1,30 @@
    45.4 +/*
    45.5 + * Copyright (c) 2006-2007, XenSource Inc.
    45.6 + *
    45.7 + * This library is free software; you can redistribute it and/or
    45.8 + * modify it under the terms of the GNU Lesser General Public
    45.9 + * License as published by the Free Software Foundation; either
   45.10 + * version 2.1 of the License, or (at your option) any later version.
   45.11 + *
   45.12 + * This library is distributed in the hope that it will be useful,
   45.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   45.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   45.15 + * Lesser General Public License for more details.
   45.16 + *
   45.17 + * You should have received a copy of the GNU Lesser General Public
   45.18 + * License along with this library; if not, write to the Free Software
   45.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   45.20 + */
   45.21 +
   45.22 +#ifndef XEN_PIF_METRICS_DECL_H
   45.23 +#define XEN_PIF_METRICS_DECL_H
   45.24 +
   45.25 +typedef void *xen_pif_metrics;
   45.26 +
   45.27 +struct xen_pif_metrics_set;
   45.28 +struct xen_pif_metrics_record;
   45.29 +struct xen_pif_metrics_record_set;
   45.30 +struct xen_pif_metrics_record_opt;
   45.31 +struct xen_pif_metrics_record_opt_set;
   45.32 +
   45.33 +#endif
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/tools/libxen/include/xen/api/xen_sr.h	Tue Apr 24 21:39:23 2007 +0100
    46.3 @@ -0,0 +1,277 @@
    46.4 +/*
    46.5 + * Copyright (c) 2006-2007, XenSource Inc.
    46.6 + *
    46.7 + * This library is free software; you can redistribute it and/or
    46.8 + * modify it under the terms of the GNU Lesser General Public
    46.9 + * License as published by the Free Software Foundation; either
   46.10 + * version 2.1 of the License, or (at your option) any later version.
   46.11 + *
   46.12 + * This library is distributed in the hope that it will be useful,
   46.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   46.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   46.15 + * Lesser General Public License for more details.
   46.16 + *
   46.17 + * You should have received a copy of the GNU Lesser General Public
   46.18 + * License along with this library; if not, write to the Free Software
   46.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   46.20 + */
   46.21 +
   46.22 +#ifndef XEN_SR_H
   46.23 +#define XEN_SR_H
   46.24 +
   46.25 +#include <xen/api/xen_common.h>
   46.26 +#include <xen/api/xen_pbd_decl.h>
   46.27 +#include <xen/api/xen_sr_decl.h>
   46.28 +#include <xen/api/xen_string_set.h>
   46.29 +#include <xen/api/xen_vdi_decl.h>
   46.30 +
   46.31 +
   46.32 +/*
   46.33 + * The SR class.
   46.34 + * 
   46.35 + * A storage repository.
   46.36 + */
   46.37 +
   46.38 +
   46.39 +/**
   46.40 + * Free the given xen_sr.  The given handle must have been allocated by
   46.41 + * this library.
   46.42 + */
   46.43 +extern void
   46.44 +xen_sr_free(xen_sr sr);
   46.45 +
   46.46 +
   46.47 +typedef struct xen_sr_set
   46.48 +{
   46.49 +    size_t size;
   46.50 +    xen_sr *contents[];
   46.51 +} xen_sr_set;
   46.52 +
   46.53 +/**
   46.54 + * Allocate a xen_sr_set of the given size.
   46.55 + */
   46.56 +extern xen_sr_set *
   46.57 +xen_sr_set_alloc(size_t size);
   46.58 +
   46.59 +/**
   46.60 + * Free the given xen_sr_set.  The given set must have been allocated
   46.61 + * by this library.
   46.62 + */
   46.63 +extern void
   46.64 +xen_sr_set_free(xen_sr_set *set);
   46.65 +
   46.66 +
   46.67 +typedef struct xen_sr_record
   46.68 +{
   46.69 +    xen_sr handle;
   46.70 +    char *uuid;
   46.71 +    char *name_label;
   46.72 +    char *name_description;
   46.73 +    struct xen_vdi_record_opt_set *vdis;
   46.74 +    struct xen_pbd_record_opt_set *pbds;
   46.75 +    int64_t virtual_allocation;
   46.76 +    int64_t physical_utilisation;
   46.77 +    int64_t physical_size;
   46.78 +    char *type;
   46.79 +    char *content_type;
   46.80 +} xen_sr_record;
   46.81 +
   46.82 +/**
   46.83 + * Allocate a xen_sr_record.
   46.84 + */
   46.85 +extern xen_sr_record *
   46.86 +xen_sr_record_alloc(void);
   46.87 +
   46.88 +/**
   46.89 + * Free the given xen_sr_record, and all referenced values.  The given
   46.90 + * record must have been allocated by this library.
   46.91 + */
   46.92 +extern void
   46.93 +xen_sr_record_free(xen_sr_record *record);
   46.94 +
   46.95 +
   46.96 +typedef struct xen_sr_record_opt
   46.97 +{
   46.98 +    bool is_record;
   46.99 +    union
  46.100 +    {
  46.101 +        xen_sr handle;
  46.102 +        xen_sr_record *record;
  46.103 +    } u;
  46.104 +} xen_sr_record_opt;
  46.105 +
  46.106 +/**
  46.107 + * Allocate a xen_sr_record_opt.
  46.108 + */
  46.109 +extern xen_sr_record_opt *
  46.110 +xen_sr_record_opt_alloc(void);
  46.111 +
  46.112 +/**
  46.113 + * Free the given xen_sr_record_opt, and all referenced values.  The
  46.114 + * given record_opt must have been allocated by this library.
  46.115 + */
  46.116 +extern void
  46.117 +xen_sr_record_opt_free(xen_sr_record_opt *record_opt);
  46.118 +
  46.119 +
  46.120 +typedef struct xen_sr_record_set
  46.121 +{
  46.122 +    size_t size;
  46.123 +    xen_sr_record *contents[];
  46.124 +} xen_sr_record_set;
  46.125 +
  46.126 +/**
  46.127 + * Allocate a xen_sr_record_set of the given size.
  46.128 + */
  46.129 +extern xen_sr_record_set *
  46.130 +xen_sr_record_set_alloc(size_t size);
  46.131 +
  46.132 +/**
  46.133 + * Free the given xen_sr_record_set, and all referenced values.  The
  46.134 + * given set must have been allocated by this library.
  46.135 + */
  46.136 +extern void
  46.137 +xen_sr_record_set_free(xen_sr_record_set *set);
  46.138 +
  46.139 +
  46.140 +
  46.141 +typedef struct xen_sr_record_opt_set
  46.142 +{
  46.143 +    size_t size;
  46.144 +    xen_sr_record_opt *contents[];
  46.145 +} xen_sr_record_opt_set;
  46.146 +
  46.147 +/**
  46.148 + * Allocate a xen_sr_record_opt_set of the given size.
  46.149 + */
  46.150 +extern xen_sr_record_opt_set *
  46.151 +xen_sr_record_opt_set_alloc(size_t size);
  46.152 +
  46.153 +/**
  46.154 + * Free the given xen_sr_record_opt_set, and all referenced values. 
  46.155 + * The given set must have been allocated by this library.
  46.156 + */
  46.157 +extern void
  46.158 +xen_sr_record_opt_set_free(xen_sr_record_opt_set *set);
  46.159 +
  46.160 +
  46.161 +/**
  46.162 + * Get a record containing the current state of the given SR.
  46.163 + */
  46.164 +extern bool
  46.165 +xen_sr_get_record(xen_session *session, xen_sr_record **result, xen_sr sr);
  46.166 +
  46.167 +
  46.168 +/**
  46.169 + * Get a reference to the SR instance with the specified UUID.
  46.170 + */
  46.171 +extern bool
  46.172 +xen_sr_get_by_uuid(xen_session *session, xen_sr *result, char *uuid);
  46.173 +
  46.174 +
  46.175 +/**
  46.176 + * Get all the SR instances with the given label.
  46.177 + */
  46.178 +extern bool
  46.179 +xen_sr_get_by_name_label(xen_session *session, struct xen_sr_set **result, char *label);
  46.180 +
  46.181 +
  46.182 +/**
  46.183 + * Get the uuid field of the given SR.
  46.184 + */
  46.185 +extern bool
  46.186 +xen_sr_get_uuid(xen_session *session, char **result, xen_sr sr);
  46.187 +
  46.188 +
  46.189 +/**
  46.190 + * Get the name/label field of the given SR.
  46.191 + */
  46.192 +extern bool
  46.193 +xen_sr_get_name_label(xen_session *session, char **result, xen_sr sr);
  46.194 +
  46.195 +
  46.196 +/**
  46.197 + * Get the name/description field of the given SR.
  46.198 + */
  46.199 +extern bool
  46.200 +xen_sr_get_name_description(xen_session *session, char **result, xen_sr sr);
  46.201 +
  46.202 +
  46.203 +/**
  46.204 + * Get the VDIs field of the given SR.
  46.205 + */
  46.206 +extern bool
  46.207 +xen_sr_get_vdis(xen_session *session, struct xen_vdi_set **result, xen_sr sr);
  46.208 +
  46.209 +
  46.210 +/**
  46.211 + * Get the PBDs field of the given SR.
  46.212 + */
  46.213 +extern bool
  46.214 +xen_sr_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_sr sr);
  46.215 +
  46.216 +
  46.217 +/**
  46.218 + * Get the virtual_allocation field of the given SR.
  46.219 + */
  46.220 +extern bool
  46.221 +xen_sr_get_virtual_allocation(xen_session *session, int64_t *result, xen_sr sr);
  46.222 +
  46.223 +
  46.224 +/**
  46.225 + * Get the physical_utilisation field of the given SR.
  46.226 + */
  46.227 +extern bool
  46.228 +xen_sr_get_physical_utilisation(xen_session *session, int64_t *result, xen_sr sr);
  46.229 +
  46.230 +
  46.231 +/**
  46.232 + * Get the physical_size field of the given SR.
  46.233 + */
  46.234 +extern bool
  46.235 +xen_sr_get_physical_size(xen_session *session, int64_t *result, xen_sr sr);
  46.236 +
  46.237 +
  46.238 +/**
  46.239 + * Get the type field of the given SR.
  46.240 + */
  46.241 +extern bool
  46.242 +xen_sr_get_type(xen_session *session, char **result, xen_sr sr);
  46.243 +
  46.244 +
  46.245 +/**
  46.246 + * Get the content_type field of the given SR.
  46.247 + */
  46.248 +extern bool
  46.249 +xen_sr_get_content_type(xen_session *session, char **result, xen_sr sr);
  46.250 +
  46.251 +
  46.252 +/**
  46.253 + * Set the name/label field of the given SR.
  46.254 + */
  46.255 +extern bool
  46.256 +xen_sr_set_name_label(xen_session *session, xen_sr sr, char *label);
  46.257 +
  46.258 +
  46.259 +/**
  46.260 + * Set the name/description field of the given SR.
  46.261 + */
  46.262 +extern bool
  46.263 +xen_sr_set_name_description(xen_session *session, xen_sr sr, char *description);
  46.264 +
  46.265 +
  46.266 +/**
  46.267 + * Return a set of all the SR types supported by the system.
  46.268 + */
  46.269 +extern bool
  46.270 +xen_sr_get_supported_types(xen_session *session, struct xen_string_set **result);
  46.271 +
  46.272 +
  46.273 +/**
  46.274 + * Return a list of all the SRs known to the system.
  46.275 + */
  46.276 +extern bool
  46.277 +xen_sr_get_all(xen_session *session, struct xen_sr_set **result);
  46.278 +
  46.279 +
  46.280 +#endif
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/tools/libxen/include/xen/api/xen_sr_decl.h	Tue Apr 24 21:39:23 2007 +0100
    47.3 @@ -0,0 +1,30 @@
    47.4 +/*
    47.5 + * Copyright (c) 2006-2007, XenSource Inc.
    47.6 + *
    47.7 + * This library is free software; you can redistribute it and/or
    47.8 + * modify it under the terms of the GNU Lesser General Public
    47.9 + * License as published by the Free Software Foundation; either
   47.10 + * version 2.1 of the License, or (at your option) any later version.
   47.11 + *
   47.12 + * This library is distributed in the hope that it will be useful,
   47.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   47.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   47.15 + * Lesser General Public License for more details.
   47.16 + *
   47.17 + * You should have received a copy of the GNU Lesser General Public
   47.18 + * License along with this library; if not, write to the Free Software
   47.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   47.20 + */
   47.21 +
   47.22 +#ifndef XEN_SR_DECL_H
   47.23 +#define XEN_SR_DECL_H
   47.24 +
   47.25 +typedef void *xen_sr;
   47.26 +
   47.27 +struct xen_sr_set;
   47.28 +struct xen_sr_record;
   47.29 +struct xen_sr_record_set;
   47.30 +struct xen_sr_record_opt;
   47.31 +struct xen_sr_record_opt_set;
   47.32 +
   47.33 +#endif
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/tools/libxen/include/xen/api/xen_string_set.h	Tue Apr 24 21:39:23 2007 +0100
    48.3 @@ -0,0 +1,47 @@
    48.4 +/*
    48.5 + * Copyright (c) 2006-2007, XenSource Inc.
    48.6 + *
    48.7 + * This library is free software; you can redistribute it and/or
    48.8 + * modify it under the terms of the GNU Lesser General Public
    48.9 + * License as published by the Free Software Foundation; either
   48.10 + * version 2.1 of the License, or (at your option) any later version.
   48.11 + *
   48.12 + * This library is distributed in the hope that it will be useful,
   48.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   48.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   48.15 + * Lesser General Public License for more details.
   48.16 + *
   48.17 + * You should have received a copy of the GNU Lesser General Public
   48.18 + * License along with this library; if not, write to the Free Software
   48.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   48.20 + */
   48.21 +
   48.22 +#ifndef XEN_STRING_SET_H
   48.23 +#define XEN_STRING_SET_H
   48.24 +
   48.25 +
   48.26 +#include "xen_common.h"
   48.27 +
   48.28 +
   48.29 +typedef struct xen_string_set
   48.30 +{
   48.31 +    size_t size;
   48.32 +    char *contents[];
   48.33 +} xen_string_set;
   48.34 +
   48.35 +
   48.36 +/**
   48.37 + * Allocate a xen_string_set of the given size.
   48.38 + */
   48.39 +extern xen_string_set *
   48.40 +xen_string_set_alloc(size_t size);
   48.41 +
   48.42 +/**
   48.43 + * Free the given xen_string_set.  The given set must have been allocated
   48.44 + * by this library.
   48.45 + */
   48.46 +extern void
   48.47 +xen_string_set_free(xen_string_set *set);
   48.48 +
   48.49 +
   48.50 +#endif
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/tools/libxen/include/xen/api/xen_string_string_map.h	Tue Apr 24 21:39:23 2007 +0100
    49.3 @@ -0,0 +1,53 @@
    49.4 +/*
    49.5 + * Copyright (c) 2006-2007, XenSource Inc.
    49.6 + *
    49.7 + * This library is free software; you can redistribute it and/or
    49.8 + * modify it under the terms of the GNU Lesser General Public
    49.9 + * License as published by the Free Software Foundation; either
   49.10 + * version 2.1 of the License, or (at your option) any later version.
   49.11 + *
   49.12 + * This library is distributed in the hope that it will be useful,
   49.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   49.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   49.15 + * Lesser General Public License for more details.
   49.16 + *
   49.17 + * You should have received a copy of the GNU Lesser General Public
   49.18 + * License along with this library; if not, write to the Free Software
   49.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   49.20 + */
   49.21 +
   49.22 +#ifndef XEN_STRING_STRING_MAP_H
   49.23 +#define XEN_STRING_STRING_MAP_H
   49.24 +
   49.25 +
   49.26 +#include <xen/api/xen_common.h>
   49.27 +
   49.28 +
   49.29 +typedef struct xen_string_string_map_contents
   49.30 +{
   49.31 +  char *key;
   49.32 +  char *val;
   49.33 +} xen_string_string_map_contents;
   49.34 +
   49.35 +
   49.36 +typedef struct xen_string_string_map
   49.37 +{
   49.38 +    size_t size;
   49.39 +    xen_string_string_map_contents contents[];
   49.40 +} xen_string_string_map;
   49.41 +
   49.42 +/**
   49.43 + * Allocate a xen_string_string_map of the given size.
   49.44 + */
   49.45 +extern xen_string_string_map *
   49.46 +xen_string_string_map_alloc(size_t size);
   49.47 +
   49.48 +/**
   49.49 + * Free the given xen_string_string_map, and all referenced values. 
   49.50 + * The given map must have been allocated by this library.
   49.51 + */
   49.52 +extern void
   49.53 +xen_string_string_map_free(xen_string_string_map *map);
   49.54 +
   49.55 +
   49.56 +#endif
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/tools/libxen/include/xen/api/xen_user.h	Tue Apr 24 21:39:23 2007 +0100
    50.3 @@ -0,0 +1,204 @@
    50.4 +/*
    50.5 + * Copyright (c) 2006-2007, XenSource Inc.
    50.6 + *
    50.7 + * This library is free software; you can redistribute it and/or
    50.8 + * modify it under the terms of the GNU Lesser General Public
    50.9 + * License as published by the Free Software Foundation; either
   50.10 + * version 2.1 of the License, or (at your option) any later version.
   50.11 + *
   50.12 + * This library is distributed in the hope that it will be useful,
   50.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   50.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   50.15 + * Lesser General Public License for more details.
   50.16 + *
   50.17 + * You should have received a copy of the GNU Lesser General Public
   50.18 + * License along with this library; if not, write to the Free Software
   50.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   50.20 + */
   50.21 +
   50.22 +#ifndef XEN_USER_H
   50.23 +#define XEN_USER_H
   50.24 +
   50.25 +#include <xen/api/xen_common.h>
   50.26 +#include <xen/api/xen_user_decl.h>
   50.27 +
   50.28 +
   50.29 +/*
   50.30 + * The user class.
   50.31 + * 
   50.32 + * A user of the system.
   50.33 + */
   50.34 +
   50.35 +
   50.36 +/**
   50.37 + * Free the given xen_user.  The given handle must have been allocated
   50.38 + * by this library.
   50.39 + */
   50.40 +extern void
   50.41 +xen_user_free(xen_user user);
   50.42 +
   50.43 +
   50.44 +typedef struct xen_user_set
   50.45 +{
   50.46 +    size_t size;
   50.47 +    xen_user *contents[];
   50.48 +} xen_user_set;
   50.49 +
   50.50 +/**
   50.51 + * Allocate a xen_user_set of the given size.
   50.52 + */
   50.53 +extern xen_user_set *
   50.54 +xen_user_set_alloc(size_t size);
   50.55 +
   50.56 +/**
   50.57 + * Free the given xen_user_set.  The given set must have been allocated
   50.58 + * by this library.
   50.59 + */
   50.60 +extern void
   50.61 +xen_user_set_free(xen_user_set *set);
   50.62 +
   50.63 +
   50.64 +typedef struct xen_user_record
   50.65 +{
   50.66 +    xen_user handle;
   50.67 +    char *uuid;
   50.68 +    char *short_name;
   50.69 +    char *fullname;
   50.70 +} xen_user_record;
   50.71 +
   50.72 +/**
   50.73 + * Allocate a xen_user_record.
   50.74 + */
   50.75 +extern xen_user_record *
   50.76 +xen_user_record_alloc(void);
   50.77 +
   50.78 +/**
   50.79 + * Free the given xen_user_record, and all referenced values.  The
   50.80 + * given record must have been allocated by this library.
   50.81 + */
   50.82 +extern void
   50.83 +xen_user_record_free(xen_user_record *record);
   50.84 +
   50.85 +
   50.86 +typedef struct xen_user_record_opt
   50.87 +{
   50.88 +    bool is_record;
   50.89 +    union
   50.90 +    {
   50.91 +        xen_user handle;
   50.92 +        xen_user_record *record;
   50.93 +    } u;
   50.94 +} xen_user_record_opt;
   50.95 +
   50.96 +/**
   50.97 + * Allocate a xen_user_record_opt.
   50.98 + */
   50.99 +extern xen_user_record_opt *
  50.100 +xen_user_record_opt_alloc(void);
  50.101 +
  50.102 +/**
  50.103 + * Free the given xen_user_record_opt, and all referenced values.  The
  50.104 + * given record_opt must have been allocated by this library.
  50.105 + */
  50.106 +extern void
  50.107 +xen_user_record_opt_free(xen_user_record_opt *record_opt);
  50.108 +
  50.109 +
  50.110 +typedef struct xen_user_record_set
  50.111 +{
  50.112 +    size_t size;
  50.113 +    xen_user_record *contents[];
  50.114 +} xen_user_record_set;
  50.115 +
  50.116 +/**
  50.117 + * Allocate a xen_user_record_set of the given size.
  50.118 + */
  50.119 +extern xen_user_record_set *
  50.120 +xen_user_record_set_alloc(size_t size);
  50.121 +
  50.122 +/**
  50.123 + * Free the given xen_user_record_set, and all referenced values.  The
  50.124 + * given set must have been allocated by this library.
  50.125 + */
  50.126 +extern void
  50.127 +xen_user_record_set_free(xen_user_record_set *set);
  50.128 +
  50.129 +
  50.130 +
  50.131 +typedef struct xen_user_record_opt_set
  50.132 +{
  50.133 +    size_t size;
  50.134 +    xen_user_record_opt *contents[];
  50.135 +} xen_user_record_opt_set;
  50.136 +
  50.137 +/**
  50.138 + * Allocate a xen_user_record_opt_set of the given size.
  50.139 + */
  50.140 +extern xen_user_record_opt_set *
  50.141 +xen_user_record_opt_set_alloc(size_t size);
  50.142 +
  50.143 +/**
  50.144 + * Free the given xen_user_record_opt_set, and all referenced values. 
  50.145 + * The given set must have been allocated by this library.
  50.146 + */
  50.147 +extern void
  50.148 +xen_user_record_opt_set_free(xen_user_record_opt_set *set);
  50.149 +
  50.150 +
  50.151 +/**
  50.152 + * Get a record containing the current state of the given user.
  50.153 + */
  50.154 +extern bool
  50.155 +xen_user_get_record(xen_session *session, xen_user_record **result, xen_user user);
  50.156 +
  50.157 +
  50.158 +/**
  50.159 + * Get a reference to the user instance with the specified UUID.
  50.160 + */
  50.161 +extern bool
  50.162 +xen_user_get_by_uuid(xen_session *session, xen_user *result, char *uuid);
  50.163 +
  50.164 +
  50.165 +/**
  50.166 + * Create a new user instance, and return its handle.
  50.167 + */
  50.168 +extern bool
  50.169 +xen_user_create(xen_session *session, xen_user *result, xen_user_record *record);
  50.170 +
  50.171 +
  50.172 +/**
  50.173 + * Destroy the specified user instance.
  50.174 + */
  50.175 +extern bool
  50.176 +xen_user_destroy(xen_session *session, xen_user user);
  50.177 +
  50.178 +
  50.179 +/**
  50.180 + * Get the uuid field of the given user.
  50.181 + */
  50.182 +extern bool
  50.183 +xen_user_get_uuid(xen_session *session, char **result, xen_user user);
  50.184 +
  50.185 +
  50.186 +/**
  50.187 + * Get the short_name field of the given user.
  50.188 + */
  50.189 +extern bool
  50.190 +xen_user_get_short_name(xen_session *session, char **result, xen_user user);
  50.191 +
  50.192 +
  50.193 +/**
  50.194 + * Get the fullname field of the given user.
  50.195 + */
  50.196 +extern bool
  50.197 +xen_user_get_fullname(xen_session *session, char **result, xen_user user);
  50.198 +
  50.199 +
  50.200 +/**
  50.201 + * Set the fullname field of the given user.
  50.202 + */
  50.203 +extern bool
  50.204 +xen_user_set_fullname(xen_session *session, xen_user user, char *fullname);
  50.205 +
  50.206 +
  50.207 +#endif
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/tools/libxen/include/xen/api/xen_user_decl.h	Tue Apr 24 21:39:23 2007 +0100
    51.3 @@ -0,0 +1,30 @@
    51.4 +/*
    51.5 + * Copyright (c) 2006-2007, XenSource Inc.
    51.6 + *
    51.7 + * This library is free software; you can redistribute it and/or
    51.8 + * modify it under the terms of the GNU Lesser General Public
    51.9 + * License as published by the Free Software Foundation; either
   51.10 + * version 2.1 of the License, or (at your option) any later version.
   51.11 + *
   51.12 + * This library is distributed in the hope that it will be useful,
   51.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   51.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   51.15 + * Lesser General Public License for more details.
   51.16 + *
   51.17 + * You should have received a copy of the GNU Lesser General Public
   51.18 + * License along with this library; if not, write to the Free Software
   51.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   51.20 + */
   51.21 +
   51.22 +#ifndef XEN_USER_DECL_H
   51.23 +#define XEN_USER_DECL_H
   51.24 +
   51.25 +typedef void *xen_user;
   51.26 +
   51.27 +struct xen_user_set;
   51.28 +struct xen_user_record;
   51.29 +struct xen_user_record_set;
   51.30 +struct xen_user_record_opt;
   51.31 +struct xen_user_record_opt_set;
   51.32 +
   51.33 +#endif
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/tools/libxen/include/xen/api/xen_vbd.h	Tue Apr 24 21:39:23 2007 +0100
    52.3 @@ -0,0 +1,390 @@
    52.4 +/*
    52.5 + * Copyright (c) 2006-2007, XenSource Inc.
    52.6 + *
    52.7 + * This library is free software; you can redistribute it and/or
    52.8 + * modify it under the terms of the GNU Lesser General Public
    52.9 + * License as published by the Free Software Foundation; either
   52.10 + * version 2.1 of the License, or (at your option) any later version.
   52.11 + *
   52.12 + * This library is distributed in the hope that it will be useful,
   52.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   52.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   52.15 + * Lesser General Public License for more details.
   52.16 + *
   52.17 + * You should have received a copy of the GNU Lesser General Public
   52.18 + * License along with this library; if not, write to the Free Software
   52.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   52.20 + */
   52.21 +
   52.22 +#ifndef XEN_VBD_H
   52.23 +#define XEN_VBD_H
   52.24 +
   52.25 +#include <xen/api/xen_common.h>
   52.26 +#include <xen/api/xen_string_set.h>
   52.27 +#include <xen/api/xen_string_string_map.h>
   52.28 +#include <xen/api/xen_vbd_decl.h>
   52.29 +#include <xen/api/xen_vbd_metrics_decl.h>
   52.30 +#include <xen/api/xen_vbd_mode.h>
   52.31 +#include <xen/api/xen_vbd_type.h>
   52.32 +#include <xen/api/xen_vdi_decl.h>
   52.33 +#include <xen/api/xen_vm_decl.h>
   52.34 +
   52.35 +
   52.36 +/*
   52.37 + * The VBD class.
   52.38 + * 
   52.39 + * A virtual block device.
   52.40 + */
   52.41 +
   52.42 +
   52.43 +/**
   52.44 + * Free the given xen_vbd.  The given handle must have been allocated
   52.45 + * by this library.
   52.46 + */
   52.47 +extern void
   52.48 +xen_vbd_free(xen_vbd vbd);
   52.49 +
   52.50 +
   52.51 +typedef struct xen_vbd_set
   52.52 +{
   52.53 +    size_t size;
   52.54 +    xen_vbd *contents[];
   52.55 +} xen_vbd_set;
   52.56 +
   52.57 +/**
   52.58 + * Allocate a xen_vbd_set of the given size.
   52.59 + */
   52.60 +extern xen_vbd_set *
   52.61 +xen_vbd_set_alloc(size_t size);
   52.62 +
   52.63 +/**
   52.64 + * Free the given xen_vbd_set.  The given set must have been allocated
   52.65 + * by this library.
   52.66 + */
   52.67 +extern void
   52.68 +xen_vbd_set_free(xen_vbd_set *set);
   52.69 +
   52.70 +
   52.71 +typedef struct xen_vbd_record
   52.72 +{
   52.73 +    xen_vbd handle;
   52.74 +    char *uuid;
   52.75 +    struct xen_vm_record_opt *vm;
   52.76 +    struct xen_vdi_record_opt *vdi;
   52.77 +    char *device;
   52.78 +    bool bootable;
   52.79 +    enum xen_vbd_mode mode;
   52.80 +    enum xen_vbd_type type;
   52.81 +    bool currently_attached;
   52.82 +    int64_t status_code;
   52.83 +    char *status_detail;
   52.84 +    xen_string_string_map *runtime_properties;
   52.85 +    char *qos_algorithm_type;
   52.86 +    xen_string_string_map *qos_algorithm_params;
   52.87 +    struct xen_string_set *qos_supported_algorithms;
   52.88 +    struct xen_vbd_metrics_record_opt *metrics;
   52.89 +} xen_vbd_record;
   52.90 +
   52.91 +/**
   52.92 + * Allocate a xen_vbd_record.
   52.93 + */
   52.94 +extern xen_vbd_record *
   52.95 +xen_vbd_record_alloc(void);
   52.96 +
   52.97 +/**
   52.98 + * Free the given xen_vbd_record, and all referenced values.  The given
   52.99 + * record must have been allocated by this library.
  52.100 + */
  52.101 +extern void
  52.102 +xen_vbd_record_free(xen_vbd_record *record);
  52.103 +
  52.104 +
  52.105 +typedef struct xen_vbd_record_opt
  52.106 +{
  52.107 +    bool is_record;
  52.108 +    union
  52.109 +    {
  52.110 +        xen_vbd handle;
  52.111 +        xen_vbd_record *record;
  52.112 +    } u;
  52.113 +} xen_vbd_record_opt;
  52.114 +
  52.115 +/**
  52.116 + * Allocate a xen_vbd_record_opt.
  52.117 + */
  52.118 +extern xen_vbd_record_opt *
  52.119 +xen_vbd_record_opt_alloc(void);
  52.120 +
  52.121 +/**
  52.122 + * Free the given xen_vbd_record_opt, and all referenced values.  The
  52.123 + * given record_opt must have been allocated by this library.
  52.124 + */
  52.125 +extern void
  52.126 +xen_vbd_record_opt_free(xen_vbd_record_opt *record_opt);
  52.127 +
  52.128 +
  52.129 +typedef struct xen_vbd_record_set
  52.130 +{
  52.131 +    size_t size;
  52.132 +    xen_vbd_record *contents[];
  52.133 +} xen_vbd_record_set;
  52.134 +
  52.135 +/**
  52.136 + * Allocate a xen_vbd_record_set of the given size.
  52.137 + */
  52.138 +extern xen_vbd_record_set *
  52.139 +xen_vbd_record_set_alloc(size_t size);
  52.140 +
  52.141 +/**
  52.142 + * Free the given xen_vbd_record_set, and all referenced values.  The
  52.143 + * given set must have been allocated by this library.
  52.144 + */
  52.145 +extern void
  52.146 +xen_vbd_record_set_free(xen_vbd_record_set *set);
  52.147 +
  52.148 +
  52.149 +
  52.150 +typedef struct xen_vbd_record_opt_set
  52.151 +{
  52.152 +    size_t size;
  52.153 +    xen_vbd_record_opt *contents[];
  52.154 +} xen_vbd_record_opt_set;
  52.155 +
  52.156 +/**
  52.157 + * Allocate a xen_vbd_record_opt_set of the given size.
  52.158 + */
  52.159 +extern xen_vbd_record_opt_set *
  52.160 +xen_vbd_record_opt_set_alloc(size_t size);
  52.161 +
  52.162 +/**
  52.163 + * Free the given xen_vbd_record_opt_set, and all referenced values. 
  52.164 + * The given set must have been allocated by this library.
  52.165 + */
  52.166 +extern void
  52.167 +xen_vbd_record_opt_set_free(xen_vbd_record_opt_set *set);
  52.168 +
  52.169 +
  52.170 +/**
  52.171 + * Get a record containing the current state of the given VBD.
  52.172 + */
  52.173 +extern bool
  52.174 +xen_vbd_get_record(xen_session *session, xen_vbd_record **result, xen_vbd vbd);
  52.175 +
  52.176 +
  52.177 +/**
  52.178 + * Get a reference to the VBD instance with the specified UUID.
  52.179 + */
  52.180 +extern bool
  52.181 +xen_vbd_get_by_uuid(xen_session *session, xen_vbd *result, char *uuid);
  52.182 +
  52.183 +
  52.184 +/**
  52.185 + * Create a new VBD instance, and return its handle.
  52.186 + */
  52.187 +extern bool
  52.188 +xen_vbd_create(xen_session *session, xen_vbd *result, xen_vbd_record *record);
  52.189 +
  52.190 +
  52.191 +/**
  52.192 + * Destroy the specified VBD instance.
  52.193 + */
  52.194 +extern bool
  52.195 +xen_vbd_destroy(xen_session *session, xen_vbd vbd);
  52.196 +
  52.197 +
  52.198 +/**
  52.199 + * Get the uuid field of the given VBD.
  52.200 + */
  52.201 +extern bool
  52.202 +xen_vbd_get_uuid(xen_session *session, char **result, xen_vbd vbd);
  52.203 +
  52.204 +
  52.205 +/**
  52.206 + * Get the VM field of the given VBD.
  52.207 + */
  52.208 +extern bool
  52.209 +xen_vbd_get_vm(xen_session *session, xen_vm *result, xen_vbd vbd);
  52.210 +
  52.211 +
  52.212 +/**
  52.213 + * Get the VDI field of the given VBD.
  52.214 + */
  52.215 +extern bool
  52.216 +xen_vbd_get_vdi(xen_session *session, xen_vdi *result, xen_vbd vbd);
  52.217 +
  52.218 +
  52.219 +/**
  52.220 + * Get the device field of the given VBD.
  52.221 + */
  52.222 +extern bool
  52.223 +xen_vbd_get_device(xen_session *session, char **result, xen_vbd vbd);
  52.224 +
  52.225 +
  52.226 +/**
  52.227 + * Get the bootable field of the given VBD.
  52.228 + */
  52.229 +extern bool
  52.230 +xen_vbd_get_bootable(xen_session *session, bool *result, xen_vbd vbd);
  52.231 +
  52.232 +
  52.233 +/**
  52.234 + * Get the mode field of the given VBD.
  52.235 + */
  52.236 +extern bool
  52.237 +xen_vbd_get_mode(xen_session *session, enum xen_vbd_mode *result, xen_vbd vbd);
  52.238 +
  52.239 +
  52.240 +/**
  52.241 + * Get the type field of the given VBD.
  52.242 + */
  52.243 +extern bool
  52.244 +xen_vbd_get_type(xen_session *session, enum xen_vbd_type *result, xen_vbd vbd);
  52.245 +
  52.246 +
  52.247 +/**
  52.248 + * Get the currently_attached field of the given VBD.
  52.249 + */
  52.250 +extern bool
  52.251 +xen_vbd_get_currently_attached(xen_session *session, bool *result, xen_vbd vbd);
  52.252 +
  52.253 +
  52.254 +/**
  52.255 + * Get the status_code field of the given VBD.
  52.256 + */
  52.257 +extern bool
  52.258 +xen_vbd_get_status_code(xen_session *session, int64_t *result, xen_vbd vbd);
  52.259 +
  52.260 +
  52.261 +/**
  52.262 + * Get the status_detail field of the given VBD.
  52.263 + */
  52.264 +extern bool
  52.265 +xen_vbd_get_status_detail(xen_session *session, char **result, xen_vbd vbd);
  52.266 +
  52.267 +
  52.268 +/**
  52.269 + * Get the runtime_properties field of the given VBD.
  52.270 + */
  52.271 +extern bool
  52.272 +xen_vbd_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
  52.273 +
  52.274 +
  52.275 +/**
  52.276 + * Get the qos/algorithm_type field of the given VBD.
  52.277 + */
  52.278 +extern bool
  52.279 +xen_vbd_get_qos_algorithm_type(xen_session *session, char **result, xen_vbd vbd);
  52.280 +
  52.281 +
  52.282 +/**
  52.283 + * Get the qos/algorithm_params field of the given VBD.
  52.284 + */
  52.285 +extern bool
  52.286 +xen_vbd_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vbd vbd);
  52.287 +
  52.288 +
  52.289 +/**
  52.290 + * Get the qos/supported_algorithms field of the given VBD.
  52.291 + */
  52.292 +extern bool
  52.293 +xen_vbd_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vbd vbd);
  52.294 +
  52.295 +
  52.296 +/**
  52.297 + * Get the metrics field of the given VBD.
  52.298 + */
  52.299 +extern bool
  52.300 +xen_vbd_get_metrics(xen_session *session, xen_vbd_metrics *result, xen_vbd vbd);
  52.301 +
  52.302 +
  52.303 +/**
  52.304 + * Set the device field of the given VBD.
  52.305 + */
  52.306 +extern bool
  52.307 +xen_vbd_set_device(xen_session *session, xen_vbd vbd, char *device);
  52.308 +
  52.309 +
  52.310 +/**
  52.311 + * Set the bootable field of the given VBD.
  52.312 + */
  52.313 +extern bool
  52.314 +xen_vbd_set_bootable(xen_session *session, xen_vbd vbd, bool bootable);
  52.315 +
  52.316 +
  52.317 +/**
  52.318 + * Set the mode field of the given VBD.
  52.319 + */
  52.320 +extern bool
  52.321 +xen_vbd_set_mode(xen_session *session, xen_vbd vbd, enum xen_vbd_mode mode);
  52.322 +
  52.323 +
  52.324 +/**
  52.325 + * Set the type field of the given VBD.
  52.326 + */
  52.327 +extern bool
  52.328 +xen_vbd_set_type(xen_session *session, xen_vbd vbd, enum xen_vbd_type type);
  52.329 +
  52.330 +
  52.331 +/**
  52.332 + * Set the qos/algorithm_type field of the given VBD.
  52.333 + */
  52.334 +extern bool
  52.335 +xen_vbd_set_qos_algorithm_type(xen_session *session, xen_vbd vbd, char *algorithm_type);
  52.336 +
  52.337 +
  52.338 +/**
  52.339 + * Set the qos/algorithm_params field of the given VBD.
  52.340 + */
  52.341 +extern bool
  52.342 +xen_vbd_set_qos_algorithm_params(xen_session *session, xen_vbd vbd, xen_string_string_map *algorithm_params);
  52.343 +
  52.344 +
  52.345 +/**
  52.346 + * Add the given key-value pair to the qos/algorithm_params field of
  52.347 + * the given VBD.
  52.348 + */
  52.349 +extern bool
  52.350 +xen_vbd_add_to_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key, char *value);
  52.351 +
  52.352 +
  52.353 +/**
  52.354 + * Remove the given key and its corresponding value from the
  52.355 + * qos/algorithm_params field of the given VBD.  If the key is not in that
  52.356 + * Map, then do nothing.
  52.357 + */
  52.358 +extern bool
  52.359 +xen_vbd_remove_from_qos_algorithm_params(xen_session *session, xen_vbd vbd, char *key);
  52.360 +
  52.361 +
  52.362 +/**
  52.363 + * Change the media in the device for CDROM-like devices only. For
  52.364 + * other devices, detach the VBD and attach a new one.
  52.365 + */
  52.366 +extern bool
  52.367 +xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi);
  52.368 +
  52.369 +
  52.370 +/**
  52.371 + * Hotplug the specified VBD, dynamically attaching it to the running
  52.372 + * VM.
  52.373 + */
  52.374 +extern bool
  52.375 +xen_vbd_plug(xen_session *session, xen_vbd self);
  52.376 +
  52.377 +
  52.378 +/**
  52.379 + * Hot-unplug the specified VBD, dynamically unattaching it from the
  52.380 + * running VM.
  52.381 + */
  52.382 +extern bool
  52.383 +xen_vbd_unplug(xen_session *session, xen_vbd self);
  52.384 +
  52.385 +
  52.386 +/**
  52.387 + * Return a list of all the VBDs known to the system.
  52.388 + */
  52.389 +extern bool
  52.390 +xen_vbd_get_all(xen_session *session, struct xen_vbd_set **result);
  52.391 +
  52.392 +
  52.393 +#endif
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/tools/libxen/include/xen/api/xen_vbd_decl.h	Tue Apr 24 21:39:23 2007 +0100
    53.3 @@ -0,0 +1,30 @@
    53.4 +/*
    53.5 + * Copyright (c) 2006-2007, XenSource Inc.
    53.6 + *
    53.7 + * This library is free software; you can redistribute it and/or
    53.8 + * modify it under the terms of the GNU Lesser General Public
    53.9 + * License as published by the Free Software Foundation; either
   53.10 + * version 2.1 of the License, or (at your option) any later version.
   53.11 + *
   53.12 + * This library is distributed in the hope that it will be useful,
   53.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   53.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   53.15 + * Lesser General Public License for more details.
   53.16 + *
   53.17 + * You should have received a copy of the GNU Lesser General Public
   53.18 + * License along with this library; if not, write to the Free Software
   53.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   53.20 + */
   53.21 +
   53.22 +#ifndef XEN_VBD_DECL_H
   53.23 +#define XEN_VBD_DECL_H
   53.24 +
   53.25 +typedef void *xen_vbd;
   53.26 +
   53.27 +struct xen_vbd_set;
   53.28 +struct xen_vbd_record;
   53.29 +struct xen_vbd_record_set;
   53.30 +struct xen_vbd_record_opt;
   53.31 +struct xen_vbd_record_opt_set;
   53.32 +
   53.33 +#endif
    54.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.2 +++ b/tools/libxen/include/xen/api/xen_vbd_metrics.h	Tue Apr 24 21:39:23 2007 +0100
    54.3 @@ -0,0 +1,198 @@
    54.4 +/*
    54.5 + * Copyright (c) 2006-2007, XenSource Inc.
    54.6 + *
    54.7 + * This library is free software; you can redistribute it and/or
    54.8 + * modify it under the terms of the GNU Lesser General Public
    54.9 + * License as published by the Free Software Foundation; either
   54.10 + * version 2.1 of the License, or (at your option) any later version.
   54.11 + *
   54.12 + * This library is distributed in the hope that it will be useful,
   54.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   54.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   54.15 + * Lesser General Public License for more details.
   54.16 + *
   54.17 + * You should have received a copy of the GNU Lesser General Public
   54.18 + * License along with this library; if not, write to the Free Software
   54.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   54.20 + */
   54.21 +
   54.22 +#ifndef XEN_VBD_METRICS_H
   54.23 +#define XEN_VBD_METRICS_H
   54.24 +
   54.25 +#include <xen/api/xen_common.h>
   54.26 +#include <xen/api/xen_vbd_metrics_decl.h>
   54.27 +
   54.28 +
   54.29 +/*
   54.30 + * The VBD_metrics class.
   54.31 + * 
   54.32 + * The metrics associated with a virtual block device.
   54.33 + */
   54.34 +
   54.35 +
   54.36 +/**
   54.37 + * Free the given xen_vbd_metrics.  The given handle must have been
   54.38 + * allocated by this library.
   54.39 + */
   54.40 +extern void
   54.41 +xen_vbd_metrics_free(xen_vbd_metrics vbd_metrics);
   54.42 +
   54.43 +
   54.44 +typedef struct xen_vbd_metrics_set
   54.45 +{
   54.46 +    size_t size;
   54.47 +    xen_vbd_metrics *contents[];
   54.48 +} xen_vbd_metrics_set;
   54.49 +
   54.50 +/**
   54.51 + * Allocate a xen_vbd_metrics_set of the given size.
   54.52 + */
   54.53 +extern xen_vbd_metrics_set *
   54.54 +xen_vbd_metrics_set_alloc(size_t size);
   54.55 +
   54.56 +/**
   54.57 + * Free the given xen_vbd_metrics_set.  The given set must have been
   54.58 + * allocated by this library.
   54.59 + */
   54.60 +extern void
   54.61 +xen_vbd_metrics_set_free(xen_vbd_metrics_set *set);
   54.62 +
   54.63 +
   54.64 +typedef struct xen_vbd_metrics_record
   54.65 +{
   54.66 +    xen_vbd_metrics handle;
   54.67 +    char *uuid;
   54.68 +    double io_read_kbs;
   54.69 +    double io_write_kbs;
   54.70 +    time_t last_updated;
   54.71 +} xen_vbd_metrics_record;
   54.72 +
   54.73 +/**
   54.74 + * Allocate a xen_vbd_metrics_record.
   54.75 + */
   54.76 +extern xen_vbd_metrics_record *
   54.77 +xen_vbd_metrics_record_alloc(void);
   54.78 +
   54.79 +/**
   54.80 + * Free the given xen_vbd_metrics_record, and all referenced values. 
   54.81 + * The given record must have been allocated by this library.
   54.82 + */
   54.83 +extern void
   54.84 +xen_vbd_metrics_record_free(xen_vbd_metrics_record *record);
   54.85 +
   54.86 +
   54.87 +typedef struct xen_vbd_metrics_record_opt
   54.88 +{
   54.89 +    bool is_record;
   54.90 +    union
   54.91 +    {
   54.92 +        xen_vbd_metrics handle;
   54.93 +        xen_vbd_metrics_record *record;
   54.94 +    } u;
   54.95 +} xen_vbd_metrics_record_opt;
   54.96 +
   54.97 +/**
   54.98 + * Allocate a xen_vbd_metrics_record_opt.
   54.99 + */
  54.100 +extern xen_vbd_metrics_record_opt *
  54.101 +xen_vbd_metrics_record_opt_alloc(void);
  54.102 +
  54.103 +/**
  54.104 + * Free the given xen_vbd_metrics_record_opt, and all referenced
  54.105 + * values.  The given record_opt must have been allocated by this library.
  54.106 + */
  54.107 +extern void
  54.108 +xen_vbd_metrics_record_opt_free(xen_vbd_metrics_record_opt *record_opt);
  54.109 +
  54.110 +
  54.111 +typedef struct xen_vbd_metrics_record_set
  54.112 +{
  54.113 +    size_t size;
  54.114 +    xen_vbd_metrics_record *contents[];
  54.115 +} xen_vbd_metrics_record_set;
  54.116 +
  54.117 +/**
  54.118 + * Allocate a xen_vbd_metrics_record_set of the given size.
  54.119 + */
  54.120 +extern xen_vbd_metrics_record_set *
  54.121 +xen_vbd_metrics_record_set_alloc(size_t size);
  54.122 +
  54.123 +/**
  54.124 + * Free the given xen_vbd_metrics_record_set, and all referenced
  54.125 + * values.  The given set must have been allocated by this library.
  54.126 + */
  54.127 +extern void
  54.128 +xen_vbd_metrics_record_set_free(xen_vbd_metrics_record_set *set);
  54.129 +
  54.130 +
  54.131 +
  54.132 +typedef struct xen_vbd_metrics_record_opt_set
  54.133 +{
  54.134 +    size_t size;
  54.135 +    xen_vbd_metrics_record_opt *contents[];
  54.136 +} xen_vbd_metrics_record_opt_set;
  54.137 +
  54.138 +/**
  54.139 + * Allocate a xen_vbd_metrics_record_opt_set of the given size.
  54.140 + */
  54.141 +extern xen_vbd_metrics_record_opt_set *
  54.142 +xen_vbd_metrics_record_opt_set_alloc(size_t size);
  54.143 +
  54.144 +/**
  54.145 + * Free the given xen_vbd_metrics_record_opt_set, and all referenced
  54.146 + * values.  The given set must have been allocated by this library.
  54.147 + */
  54.148 +extern void
  54.149 +xen_vbd_metrics_record_opt_set_free(xen_vbd_metrics_record_opt_set *set);
  54.150 +
  54.151 +
  54.152 +/**
  54.153 + * Get a record containing the current state of the given VBD_metrics.
  54.154 + */
  54.155 +extern bool
  54.156 +xen_vbd_metrics_get_record(xen_session *session, xen_vbd_metrics_record **result, xen_vbd_metrics vbd_metrics);
  54.157 +
  54.158 +
  54.159 +/**
  54.160 + * Get a reference to the VBD_metrics instance with the specified UUID.
  54.161 + */
  54.162 +extern bool
  54.163 +xen_vbd_metrics_get_by_uuid(xen_session *session, xen_vbd_metrics *result, char *uuid);
  54.164 +
  54.165 +
  54.166 +/**
  54.167 + * Get the uuid field of the given VBD_metrics.
  54.168 + */
  54.169 +extern bool
  54.170 +xen_vbd_metrics_get_uuid(xen_session *session, char **result, xen_vbd_metrics vbd_metrics);
  54.171 +
  54.172 +
  54.173 +/**
  54.174 + * Get the io/read_kbs field of the given VBD_metrics.
  54.175 + */
  54.176 +extern bool
  54.177 +xen_vbd_metrics_get_io_read_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics);
  54.178 +
  54.179 +
  54.180 +/**
  54.181 + * Get the io/write_kbs field of the given VBD_metrics.
  54.182 + */
  54.183 +extern bool
  54.184 +xen_vbd_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics);
  54.185 +
  54.186 +
  54.187 +/**
  54.188 + * Get the last_updated field of the given VBD_metrics.
  54.189 + */
  54.190 +extern bool
  54.191 +xen_vbd_metrics_get_last_updated(xen_session *session, time_t *result, xen_vbd_metrics vbd_metrics);
  54.192 +
  54.193 +
  54.194 +/**
  54.195 + * Return a list of all the VBD_metrics instances known to the system.
  54.196 + */
  54.197 +extern bool
  54.198 +xen_vbd_metrics_get_all(xen_session *session, struct xen_vbd_metrics_set **result);
  54.199 +
  54.200 +
  54.201 +#endif
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/tools/libxen/include/xen/api/xen_vbd_metrics_decl.h	Tue Apr 24 21:39:23 2007 +0100
    55.3 @@ -0,0 +1,30 @@
    55.4 +/*
    55.5 + * Copyright (c) 2006-2007, XenSource Inc.
    55.6 + *
    55.7 + * This library is free software; you can redistribute it and/or
    55.8 + * modify it under the terms of the GNU Lesser General Public
    55.9 + * License as published by the Free Software Foundation; either
   55.10 + * version 2.1 of the License, or (at your option) any later version.
   55.11 + *
   55.12 + * This library is distributed in the hope that it will be useful,
   55.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   55.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   55.15 + * Lesser General Public License for more details.
   55.16 + *
   55.17 + * You should have received a copy of the GNU Lesser General Public
   55.18 + * License along with this library; if not, write to the Free Software
   55.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   55.20 + */
   55.21 +
   55.22 +#ifndef XEN_VBD_METRICS_DECL_H
   55.23 +#define XEN_VBD_METRICS_DECL_H
   55.24 +
   55.25 +typedef void *xen_vbd_metrics;
   55.26 +
   55.27 +struct xen_vbd_metrics_set;
   55.28 +struct xen_vbd_metrics_record;
   55.29 +struct xen_vbd_metrics_record_set;
   55.30 +struct xen_vbd_metrics_record_opt;
   55.31 +struct xen_vbd_metrics_record_opt_set;
   55.32 +
   55.33 +#endif
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/tools/libxen/include/xen/api/xen_vbd_mode.h	Tue Apr 24 21:39:23 2007 +0100
    56.3 @@ -0,0 +1,77 @@
    56.4 +/*
    56.5 + * Copyright (c) 2006-2007, XenSource Inc.
    56.6 + *
    56.7 + * This library is free software; you can redistribute it and/or
    56.8 + * modify it under the terms of the GNU Lesser General Public
    56.9 + * License as published by the Free Software Foundation; either
   56.10 + * version 2.1 of the License, or (at your option) any later version.
   56.11 + *
   56.12 + * This library is distributed in the hope that it will be useful,
   56.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   56.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   56.15 + * Lesser General Public License for more details.
   56.16 + *
   56.17 + * You should have received a copy of the GNU Lesser General Public
   56.18 + * License along with this library; if not, write to the Free Software
   56.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   56.20 + */
   56.21 +
   56.22 +#ifndef XEN_VBD_MODE_H
   56.23 +#define XEN_VBD_MODE_H
   56.24 +
   56.25 +
   56.26 +#include <xen/api/xen_common.h>
   56.27 +
   56.28 +
   56.29 +enum xen_vbd_mode
   56.30 +{
   56.31 +    /**
   56.32 +     * disk is mounted read-only
   56.33 +     */
   56.34 +    XEN_VBD_MODE_RO,
   56.35 +
   56.36 +    /**
   56.37 +     * disk is mounted read-write
   56.38 +     */
   56.39 +    XEN_VBD_MODE_RW
   56.40 +};
   56.41 +
   56.42 +
   56.43 +typedef struct xen_vbd_mode_set
   56.44 +{
   56.45 +    size_t size;
   56.46 +    enum xen_vbd_mode contents[];
   56.47 +} xen_vbd_mode_set;
   56.48 +
   56.49 +/**
   56.50 + * Allocate a xen_vbd_mode_set of the given size.
   56.51 + */
   56.52 +extern xen_vbd_mode_set *
   56.53 +xen_vbd_mode_set_alloc(size_t size);
   56.54 +
   56.55 +/**
   56.56 + * Free the given xen_vbd_mode_set.  The given set must have been
   56.57 + * allocated by this library.
   56.58 + */
   56.59 +extern void
   56.60 +xen_vbd_mode_set_free(xen_vbd_mode_set *set);
   56.61 +
   56.62 +
   56.63 +/**
   56.64 + * Return the name corresponding to the given code.  This string must
   56.65 + * not be modified or freed.
   56.66 + */
   56.67 +extern const char *
   56.68 +xen_vbd_mode_to_string(enum xen_vbd_mode val);
   56.69 +
   56.70 +
   56.71 +/**
   56.72 + * Return the correct code for the given string, or set the session
   56.73 + * object to failure and return an undefined value if the given string does
   56.74 + * not match a known code.
   56.75 + */
   56.76 +extern enum xen_vbd_mode
   56.77 +xen_vbd_mode_from_string(xen_session *session, const char *str);
   56.78 +
   56.79 +
   56.80 +#endif
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/tools/libxen/include/xen/api/xen_vbd_type.h	Tue Apr 24 21:39:23 2007 +0100
    57.3 @@ -0,0 +1,77 @@
    57.4 +/*
    57.5 + * Copyright (c) 2006-2007, XenSource Inc.
    57.6 + *
    57.7 + * This library is free software; you can redistribute it and/or
    57.8 + * modify it under the terms of the GNU Lesser General Public
    57.9 + * License as published by the Free Software Foundation; either
   57.10 + * version 2.1 of the License, or (at your option) any later version.
   57.11 + *
   57.12 + * This library is distributed in the hope that it will be useful,
   57.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   57.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   57.15 + * Lesser General Public License for more details.
   57.16 + *
   57.17 + * You should have received a copy of the GNU Lesser General Public
   57.18 + * License along with this library; if not, write to the Free Software
   57.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   57.20 + */
   57.21 +
   57.22 +#ifndef XEN_VBD_TYPE_H
   57.23 +#define XEN_VBD_TYPE_H
   57.24 +
   57.25 +
   57.26 +#include <xen/api/xen_common.h>
   57.27 +
   57.28 +
   57.29 +enum xen_vbd_type
   57.30 +{
   57.31 +    /**
   57.32 +     * VBD will appear to guest as CD
   57.33 +     */
   57.34 +    XEN_VBD_TYPE_CD,
   57.35 +
   57.36 +    /**
   57.37 +     * VBD will appear to guest as disk
   57.38 +     */
   57.39 +    XEN_VBD_TYPE_DISK
   57.40 +};
   57.41 +
   57.42 +
   57.43 +typedef struct xen_vbd_type_set
   57.44 +{
   57.45 +    size_t size;
   57.46 +    enum xen_vbd_type contents[];
   57.47 +} xen_vbd_type_set;
   57.48 +
   57.49 +/**
   57.50 + * Allocate a xen_vbd_type_set of the given size.
   57.51 + */
   57.52 +extern xen_vbd_type_set *
   57.53 +xen_vbd_type_set_alloc(size_t size);
   57.54 +
   57.55 +/**
   57.56 + * Free the given xen_vbd_type_set.  The given set must have been
   57.57 + * allocated by this library.
   57.58 + */
   57.59 +extern void
   57.60 +xen_vbd_type_set_free(xen_vbd_type_set *set);
   57.61 +
   57.62 +
   57.63 +/**
   57.64 + * Return the name corresponding to the given code.  This string must
   57.65 + * not be modified or freed.
   57.66 + */
   57.67 +extern const char *
   57.68 +xen_vbd_type_to_string(enum xen_vbd_type val);
   57.69 +
   57.70 +
   57.71 +/**
   57.72 + * Return the correct code for the given string, or set the session
   57.73 + * object to failure and return an undefined value if the given string does
   57.74 + * not match a known code.
   57.75 + */
   57.76 +extern enum xen_vbd_type
   57.77 +xen_vbd_type_from_string(xen_session *session, const char *str);
   57.78 +
   57.79 +
   57.80 +#endif
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/tools/libxen/include/xen/api/xen_vdi.h	Tue Apr 24 21:39:23 2007 +0100
    58.3 @@ -0,0 +1,347 @@
    58.4 +/*
    58.5 + * Copyright (c) 2006-2007, XenSource Inc.
    58.6 + *
    58.7 + * This library is free software; you can redistribute it and/or
    58.8 + * modify it under the terms of the GNU Lesser General Public
    58.9 + * License as published by the Free Software Foundation; either
   58.10 + * version 2.1 of the License, or (at your option) any later version.
   58.11 + *
   58.12 + * This library is distributed in the hope that it will be useful,
   58.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   58.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   58.15 + * Lesser General Public License for more details.
   58.16 + *
   58.17 + * You should have received a copy of the GNU Lesser General Public
   58.18 + * License along with this library; if not, write to the Free Software
   58.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   58.20 + */
   58.21 +
   58.22 +#ifndef XEN_VDI_H
   58.23 +#define XEN_VDI_H
   58.24 +
   58.25 +#include <xen/api/xen_common.h>
   58.26 +#include <xen/api/xen_crashdump_decl.h>
   58.27 +#include <xen/api/xen_sr_decl.h>
   58.28 +#include <xen/api/xen_string_string_map.h>
   58.29 +#include <xen/api/xen_vbd_decl.h>
   58.30 +#include <xen/api/xen_vdi_decl.h>
   58.31 +#include <xen/api/xen_vdi_type.h>
   58.32 +
   58.33 +
   58.34 +/*
   58.35 + * The VDI class.
   58.36 + * 
   58.37 + * A virtual disk image.
   58.38 + */
   58.39 +
   58.40 +
   58.41 +/**
   58.42 + * Free the given xen_vdi.  The given handle must have been allocated
   58.43 + * by this library.
   58.44 + */
   58.45 +extern void
   58.46 +xen_vdi_free(xen_vdi vdi);
   58.47 +
   58.48 +
   58.49 +typedef struct xen_vdi_set
   58.50 +{
   58.51 +    size_t size;
   58.52 +    xen_vdi *contents[];
   58.53 +} xen_vdi_set;
   58.54 +
   58.55 +/**
   58.56 + * Allocate a xen_vdi_set of the given size.
   58.57 + */
   58.58 +extern xen_vdi_set *
   58.59 +xen_vdi_set_alloc(size_t size);
   58.60 +
   58.61 +/**
   58.62 + * Free the given xen_vdi_set.  The given set must have been allocated
   58.63 + * by this library.
   58.64 + */
   58.65 +extern void
   58.66 +xen_vdi_set_free(xen_vdi_set *set);
   58.67 +
   58.68 +
   58.69 +typedef struct xen_vdi_record
   58.70 +{
   58.71 +    xen_vdi handle;
   58.72 +    char *uuid;
   58.73 +    char *name_label;
   58.74 +    char *name_description;
   58.75 +    struct xen_sr_record_opt *sr;
   58.76 +    struct xen_vbd_record_opt_set *vbds;
   58.77 +    struct xen_crashdump_record_opt_set *crash_dumps;
   58.78 +    int64_t virtual_size;
   58.79 +    int64_t physical_utilisation;
   58.80 +    enum xen_vdi_type type;
   58.81 +    bool sharable;
   58.82 +    bool read_only;
   58.83 +    xen_string_string_map *other_config;
   58.84 +} xen_vdi_record;
   58.85 +
   58.86 +/**
   58.87 + * Allocate a xen_vdi_record.
   58.88 + */
   58.89 +extern xen_vdi_record *
   58.90 +xen_vdi_record_alloc(void);
   58.91 +
   58.92 +/**
   58.93 + * Free the given xen_vdi_record, and all referenced values.  The given
   58.94 + * record must have been allocated by this library.
   58.95 + */
   58.96 +extern void
   58.97 +xen_vdi_record_free(xen_vdi_record *record);
   58.98 +
   58.99 +
  58.100 +typedef struct xen_vdi_record_opt
  58.101 +{
  58.102 +    bool is_record;
  58.103 +    union
  58.104 +    {
  58.105 +        xen_vdi handle;
  58.106 +        xen_vdi_record *record;
  58.107 +    } u;
  58.108 +} xen_vdi_record_opt;
  58.109 +
  58.110 +/**
  58.111 + * Allocate a xen_vdi_record_opt.
  58.112 + */
  58.113 +extern xen_vdi_record_opt *
  58.114 +xen_vdi_record_opt_alloc(void);
  58.115 +
  58.116 +/**
  58.117 + * Free the given xen_vdi_record_opt, and all referenced values.  The
  58.118 + * given record_opt must have been allocated by this library.
  58.119 + */
  58.120 +extern void
  58.121 +xen_vdi_record_opt_free(xen_vdi_record_opt *record_opt);
  58.122 +
  58.123 +
  58.124 +typedef struct xen_vdi_record_set
  58.125 +{
  58.126 +    size_t size;
  58.127 +    xen_vdi_record *contents[];
  58.128 +} xen_vdi_record_set;
  58.129 +
  58.130 +/**
  58.131 + * Allocate a xen_vdi_record_set of the given size.
  58.132 + */
  58.133 +extern xen_vdi_record_set *
  58.134 +xen_vdi_record_set_alloc(size_t size);
  58.135 +
  58.136 +/**
  58.137 + * Free the given xen_vdi_record_set, and all referenced values.  The
  58.138 + * given set must have been allocated by this library.
  58.139 + */
  58.140 +extern void
  58.141 +xen_vdi_record_set_free(xen_vdi_record_set *set);
  58.142 +
  58.143 +
  58.144 +
  58.145 +typedef struct xen_vdi_record_opt_set
  58.146 +{
  58.147 +    size_t size;
  58.148 +    xen_vdi_record_opt *contents[];
  58.149 +} xen_vdi_record_opt_set;
  58.150 +
  58.151 +/**
  58.152 + * Allocate a xen_vdi_record_opt_set of the given size.
  58.153 + */
  58.154 +extern xen_vdi_record_opt_set *
  58.155 +xen_vdi_record_opt_set_alloc(size_t size);
  58.156 +
  58.157 +/**
  58.158 + * Free the given xen_vdi_record_opt_set, and all referenced values. 
  58.159 + * The given set must have been allocated by this library.
  58.160 + */
  58.161 +extern void
  58.162 +xen_vdi_record_opt_set_free(xen_vdi_record_opt_set *set);
  58.163 +
  58.164 +
  58.165 +/**
  58.166 + * Get a record containing the current state of the given VDI.
  58.167 + */
  58.168 +extern bool
  58.169 +xen_vdi_get_record(xen_session *session, xen_vdi_record **result, xen_vdi vdi);
  58.170 +
  58.171 +
  58.172 +/**
  58.173 + * Get a reference to the VDI instance with the specified UUID.
  58.174 + */
  58.175 +extern bool
  58.176 +xen_vdi_get_by_uuid(xen_session *session, xen_vdi *result, char *uuid);
  58.177 +
  58.178 +
  58.179 +/**
  58.180 + * Create a new VDI instance, and return its handle.
  58.181 + */
  58.182 +extern bool
  58.183 +xen_vdi_create(xen_session *session, xen_vdi *result, xen_vdi_record *record);
  58.184 +
  58.185 +
  58.186 +/**
  58.187 + * Destroy the specified VDI instance.
  58.188 + */
  58.189 +extern bool
  58.190 +xen_vdi_destroy(xen_session *session, xen_vdi vdi);
  58.191 +
  58.192 +
  58.193 +/**
  58.194 + * Get all the VDI instances with the given label.
  58.195 + */
  58.196 +extern bool
  58.197 +xen_vdi_get_by_name_label(xen_session *session, struct xen_vdi_set **result, char *label);
  58.198 +
  58.199 +
  58.200 +/**
  58.201 + * Get the uuid field of the given VDI.
  58.202 + */
  58.203 +extern bool
  58.204 +xen_vdi_get_uuid(xen_session *session, char **result, xen_vdi vdi);
  58.205 +
  58.206 +
  58.207 +/**
  58.208 + * Get the name/label field of the given VDI.
  58.209 + */
  58.210 +extern bool
  58.211 +xen_vdi_get_name_label(xen_session *session, char **result, xen_vdi vdi);
  58.212 +
  58.213 +
  58.214 +/**
  58.215 + * Get the name/description field of the given VDI.
  58.216 + */
  58.217 +extern bool
  58.218 +xen_vdi_get_name_description(xen_session *session, char **result, xen_vdi vdi);
  58.219 +
  58.220 +
  58.221 +/**
  58.222 + * Get the SR field of the given VDI.
  58.223 + */
  58.224 +extern bool
  58.225 +xen_vdi_get_sr(xen_session *session, xen_sr *result, xen_vdi vdi);
  58.226 +
  58.227 +
  58.228 +/**
  58.229 + * Get the VBDs field of the given VDI.
  58.230 + */
  58.231 +extern bool
  58.232 +xen_vdi_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vdi vdi);
  58.233 +
  58.234 +
  58.235 +/**
  58.236 + * Get the crash_dumps field of the given VDI.
  58.237 + */
  58.238 +extern bool
  58.239 +xen_vdi_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vdi vdi);
  58.240 +
  58.241 +
  58.242 +/**
  58.243 + * Get the virtual_size field of the given VDI.
  58.244 + */
  58.245 +extern bool
  58.246 +xen_vdi_get_virtual_size(xen_session *session, int64_t *result, xen_vdi vdi);
  58.247 +
  58.248 +
  58.249 +/**
  58.250 + * Get the physical_utilisation field of the given VDI.
  58.251 + */
  58.252 +extern bool
  58.253 +xen_vdi_get_physical_utilisation(xen_session *session, int64_t *result, xen_vdi vdi);
  58.254 +
  58.255 +
  58.256 +/**
  58.257 + * Get the type field of the given VDI.
  58.258 + */
  58.259 +extern bool
  58.260 +xen_vdi_get_type(xen_session *session, enum xen_vdi_type *result, xen_vdi vdi);
  58.261 +
  58.262 +
  58.263 +/**
  58.264 + * Get the sharable field of the given VDI.
  58.265 + */
  58.266 +extern bool
  58.267 +xen_vdi_get_sharable(xen_session *session, bool *result, xen_vdi vdi);
  58.268 +
  58.269 +
  58.270 +/**
  58.271 + * Get the read_only field of the given VDI.
  58.272 + */
  58.273 +extern bool
  58.274 +xen_vdi_get_read_only(xen_session *session, bool *result, xen_vdi vdi);
  58.275 +
  58.276 +
  58.277 +/**
  58.278 + * Get the other_config field of the given VDI.
  58.279 + */
  58.280 +extern bool
  58.281 +xen_vdi_get_other_config(xen_session *session, xen_string_string_map **result, xen_vdi vdi);
  58.282 +
  58.283 +
  58.284 +/**
  58.285 + * Set the name/label field of the given VDI.
  58.286 + */
  58.287 +extern bool
  58.288 +xen_vdi_set_name_label(xen_session *session, xen_vdi vdi, char *label);
  58.289 +
  58.290 +
  58.291 +/**
  58.292 + * Set the name/description field of the given VDI.
  58.293 + */
  58.294 +extern bool
  58.295 +xen_vdi_set_name_description(xen_session *session, xen_vdi vdi, char *description);
  58.296 +
  58.297 +
  58.298 +/**
  58.299 + * Set the virtual_size field of the given VDI.
  58.300 + */
  58.301 +extern bool
  58.302 +xen_vdi_set_virtual_size(xen_session *session, xen_vdi vdi, int64_t virtual_size);
  58.303 +
  58.304 +
  58.305 +/**
  58.306 + * Set the sharable field of the given VDI.
  58.307 + */
  58.308 +extern bool
  58.309 +xen_vdi_set_sharable(xen_session *session, xen_vdi vdi, bool sharable);
  58.310 +
  58.311 +
  58.312 +/**
  58.313 + * Set the read_only field of the given VDI.
  58.314 + */
  58.315 +extern bool
  58.316 +xen_vdi_set_read_only(xen_session *session, xen_vdi vdi, bool read_only);
  58.317 +
  58.318 +
  58.319 +/**
  58.320 + * Set the other_config field of the given VDI.
  58.321 + */
  58.322 +extern bool
  58.323 +xen_vdi_set_other_config(xen_session *session, xen_vdi vdi, xen_string_string_map *other_config);
  58.324 +
  58.325 +
  58.326 +/**
  58.327 + * Add the given key-value pair to the other_config field of the given
  58.328 + * VDI.
  58.329 + */
  58.330 +extern bool
  58.331 +xen_vdi_add_to_other_config(xen_session *session, xen_vdi vdi, char *key, char *value);
  58.332 +
  58.333 +
  58.334 +/**
  58.335 + * Remove the given key and its corresponding value from the
  58.336 + * other_config field of the given VDI.  If the key is not in that Map, then
  58.337 + * do nothing.
  58.338 + */
  58.339 +extern bool
  58.340 +xen_vdi_remove_from_other_config(xen_session *session, xen_vdi vdi, char *key);
  58.341 +
  58.342 +
  58.343 +/**
  58.344 + * Return a list of all the VDIs known to the system.
  58.345 + */
  58.346 +extern bool
  58.347 +xen_vdi_get_all(xen_session *session, struct xen_vdi_set **result);
  58.348 +
  58.349 +
  58.350 +#endif
    59.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.2 +++ b/tools/libxen/include/xen/api/xen_vdi_decl.h	Tue Apr 24 21:39:23 2007 +0100
    59.3 @@ -0,0 +1,30 @@
    59.4 +/*
    59.5 + * Copyright (c) 2006-2007, XenSource Inc.
    59.6 + *
    59.7 + * This library is free software; you can redistribute it and/or
    59.8 + * modify it under the terms of the GNU Lesser General Public
    59.9 + * License as published by the Free Software Foundation; either
   59.10 + * version 2.1 of the License, or (at your option) any later version.
   59.11 + *
   59.12 + * This library is distributed in the hope that it will be useful,
   59.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   59.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   59.15 + * Lesser General Public License for more details.
   59.16 + *
   59.17 + * You should have received a copy of the GNU Lesser General Public
   59.18 + * License along with this library; if not, write to the Free Software
   59.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   59.20 + */
   59.21 +
   59.22 +#ifndef XEN_VDI_DECL_H
   59.23 +#define XEN_VDI_DECL_H
   59.24 +
   59.25 +typedef void *xen_vdi;
   59.26 +
   59.27 +struct xen_vdi_set;
   59.28 +struct xen_vdi_record;
   59.29 +struct xen_vdi_record_set;
   59.30 +struct xen_vdi_record_opt;
   59.31 +struct xen_vdi_record_opt_set;
   59.32 +
   59.33 +#endif
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/tools/libxen/include/xen/api/xen_vdi_type.h	Tue Apr 24 21:39:23 2007 +0100
    60.3 @@ -0,0 +1,92 @@
    60.4 +/*
    60.5 + * Copyright (c) 2006-2007, XenSource Inc.
    60.6 + *
    60.7 + * This library is free software; you can redistribute it and/or
    60.8 + * modify it under the terms of the GNU Lesser General Public
    60.9 + * License as published by the Free Software Foundation; either
   60.10 + * version 2.1 of the License, or (at your option) any later version.
   60.11 + *
   60.12 + * This library is distributed in the hope that it will be useful,
   60.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   60.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   60.15 + * Lesser General Public License for more details.
   60.16 + *
   60.17 + * You should have received a copy of the GNU Lesser General Public
   60.18 + * License along with this library; if not, write to the Free Software
   60.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   60.20 + */
   60.21 +
   60.22 +#ifndef XEN_VDI_TYPE_H
   60.23 +#define XEN_VDI_TYPE_H
   60.24 +
   60.25 +
   60.26 +#include <xen/api/xen_common.h>
   60.27 +
   60.28 +
   60.29 +enum xen_vdi_type
   60.30 +{
   60.31 +    /**
   60.32 +     * a disk that may be replaced on upgrade
   60.33 +     */
   60.34 +    XEN_VDI_TYPE_SYSTEM,
   60.35 +
   60.36 +    /**
   60.37 +     * a disk that is always preserved on upgrade
   60.38 +     */
   60.39 +    XEN_VDI_TYPE_USER,
   60.40 +
   60.41 +    /**
   60.42 +     * a disk that may be reformatted on upgrade
   60.43 +     */
   60.44 +    XEN_VDI_TYPE_EPHEMERAL,
   60.45 +
   60.46 +    /**
   60.47 +     * a disk that stores a suspend image
   60.48 +     */
   60.49 +    XEN_VDI_TYPE_SUSPEND,
   60.50 +
   60.51 +    /**
   60.52 +     * a disk that stores VM crashdump information
   60.53 +     */
   60.54 +    XEN_VDI_TYPE_CRASHDUMP
   60.55 +};
   60.56 +
   60.57 +
   60.58 +typedef struct xen_vdi_type_set
   60.59 +{
   60.60 +    size_t size;
   60.61 +    enum xen_vdi_type contents[];
   60.62 +} xen_vdi_type_set;
   60.63 +
   60.64 +/**
   60.65 + * Allocate a xen_vdi_type_set of the given size.
   60.66 + */
   60.67 +extern xen_vdi_type_set *
   60.68 +xen_vdi_type_set_alloc(size_t size);
   60.69 +
   60.70 +/**
   60.71 + * Free the given xen_vdi_type_set.  The given set must have been
   60.72 + * allocated by this library.
   60.73 + */
   60.74 +extern void
   60.75 +xen_vdi_type_set_free(xen_vdi_type_set *set);
   60.76 +
   60.77 +
   60.78 +/**
   60.79 + * Return the name corresponding to the given code.  This string must
   60.80 + * not be modified or freed.
   60.81 + */
   60.82 +extern const char *
   60.83 +xen_vdi_type_to_string(enum xen_vdi_type val);
   60.84 +
   60.85 +
   60.86 +/**
   60.87 + * Return the correct code for the given string, or set the session
   60.88 + * object to failure and return an undefined value if the given string does
   60.89 + * not match a known code.
   60.90 + */
   60.91 +extern enum xen_vdi_type
   60.92 +xen_vdi_type_from_string(xen_session *session, const char *str);
   60.93 +
   60.94 +
   60.95 +#endif
    61.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.2 +++ b/tools/libxen/include/xen/api/xen_vif.h	Tue Apr 24 21:39:23 2007 +0100
    61.3 @@ -0,0 +1,365 @@
    61.4 +/*
    61.5 + * Copyright (c) 2006-2007, XenSource Inc.
    61.6 + *
    61.7 + * This library is free software; you can redistribute it and/or
    61.8 + * modify it under the terms of the GNU Lesser General Public
    61.9 + * License as published by the Free Software Foundation; either
   61.10 + * version 2.1 of the License, or (at your option) any later version.
   61.11 + *
   61.12 + * This library is distributed in the hope that it will be useful,
   61.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   61.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   61.15 + * Lesser General Public License for more details.
   61.16 + *
   61.17 + * You should have received a copy of the GNU Lesser General Public
   61.18 + * License along with this library; if not, write to the Free Software
   61.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   61.20 + */
   61.21 +
   61.22 +#ifndef XEN_VIF_H
   61.23 +#define XEN_VIF_H
   61.24 +
   61.25 +#include <xen/api/xen_common.h>
   61.26 +#include <xen/api/xen_network_decl.h>
   61.27 +#include <xen/api/xen_string_set.h>
   61.28 +#include <xen/api/xen_string_string_map.h>
   61.29 +#include <xen/api/xen_vif_decl.h>
   61.30 +#include <xen/api/xen_vif_metrics_decl.h>
   61.31 +#include <xen/api/xen_vm_decl.h>
   61.32 +
   61.33 +
   61.34 +/*
   61.35 + * The VIF class.
   61.36 + * 
   61.37 + * A virtual network interface.
   61.38 + */
   61.39 +
   61.40 +
   61.41 +/**
   61.42 + * Free the given xen_vif.  The given handle must have been allocated
   61.43 + * by this library.
   61.44 + */
   61.45 +extern void
   61.46 +xen_vif_free(xen_vif vif);
   61.47 +
   61.48 +
   61.49 +typedef struct xen_vif_set
   61.50 +{
   61.51 +    size_t size;
   61.52 +    xen_vif *contents[];
   61.53 +} xen_vif_set;
   61.54 +
   61.55 +/**
   61.56 + * Allocate a xen_vif_set of the given size.
   61.57 + */
   61.58 +extern xen_vif_set *
   61.59 +xen_vif_set_alloc(size_t size);
   61.60 +
   61.61 +/**
   61.62 + * Free the given xen_vif_set.  The given set must have been allocated
   61.63 + * by this library.
   61.64 + */
   61.65 +extern void
   61.66 +xen_vif_set_free(xen_vif_set *set);
   61.67 +
   61.68 +
   61.69 +typedef struct xen_vif_record
   61.70 +{
   61.71 +    xen_vif handle;
   61.72 +    char *uuid;
   61.73 +    char *device;
   61.74 +    struct xen_network_record_opt *network;
   61.75 +    struct xen_vm_record_opt *vm;
   61.76 +    char *mac;
   61.77 +    int64_t mtu;
   61.78 +    bool currently_attached;
   61.79 +    int64_t status_code;
   61.80 +    char *status_detail;
   61.81 +    xen_string_string_map *runtime_properties;
   61.82 +    char *qos_algorithm_type;
   61.83 +    xen_string_string_map *qos_algorithm_params;
   61.84 +    struct xen_string_set *qos_supported_algorithms;
   61.85 +    struct xen_vif_metrics_record_opt *metrics;
   61.86 +} xen_vif_record;
   61.87 +
   61.88 +/**
   61.89 + * Allocate a xen_vif_record.
   61.90 + */
   61.91 +extern xen_vif_record *
   61.92 +xen_vif_record_alloc(void);
   61.93 +
   61.94 +/**
   61.95 + * Free the given xen_vif_record, and all referenced values.  The given
   61.96 + * record must have been allocated by this library.
   61.97 + */
   61.98 +extern void
   61.99 +xen_vif_record_free(xen_vif_record *record);
  61.100 +
  61.101 +
  61.102 +typedef struct xen_vif_record_opt
  61.103 +{
  61.104 +    bool is_record;
  61.105 +    union
  61.106 +    {
  61.107 +        xen_vif handle;
  61.108 +        xen_vif_record *record;
  61.109 +    } u;
  61.110 +} xen_vif_record_opt;
  61.111 +
  61.112 +/**
  61.113 + * Allocate a xen_vif_record_opt.
  61.114 + */
  61.115 +extern xen_vif_record_opt *
  61.116 +xen_vif_record_opt_alloc(void);
  61.117 +
  61.118 +/**
  61.119 + * Free the given xen_vif_record_opt, and all referenced values.  The
  61.120 + * given record_opt must have been allocated by this library.
  61.121 + */
  61.122 +extern void
  61.123 +xen_vif_record_opt_free(xen_vif_record_opt *record_opt);
  61.124 +
  61.125 +
  61.126 +typedef struct xen_vif_record_set
  61.127 +{
  61.128 +    size_t size;
  61.129 +    xen_vif_record *contents[];
  61.130 +} xen_vif_record_set;
  61.131 +
  61.132 +/**
  61.133 + * Allocate a xen_vif_record_set of the given size.
  61.134 + */
  61.135 +extern xen_vif_record_set *
  61.136 +xen_vif_record_set_alloc(size_t size);
  61.137 +
  61.138 +/**
  61.139 + * Free the given xen_vif_record_set, and all referenced values.  The
  61.140 + * given set must have been allocated by this library.
  61.141 + */
  61.142 +extern void
  61.143 +xen_vif_record_set_free(xen_vif_record_set *set);
  61.144 +
  61.145 +
  61.146 +
  61.147 +typedef struct xen_vif_record_opt_set
  61.148 +{
  61.149 +    size_t size;
  61.150 +    xen_vif_record_opt *contents[];
  61.151 +} xen_vif_record_opt_set;
  61.152 +
  61.153 +/**
  61.154 + * Allocate a xen_vif_record_opt_set of the given size.
  61.155 + */
  61.156 +extern xen_vif_record_opt_set *
  61.157 +xen_vif_record_opt_set_alloc(size_t size);
  61.158 +
  61.159 +/**
  61.160 + * Free the given xen_vif_record_opt_set, and all referenced values. 
  61.161 + * The given set must have been allocated by this library.
  61.162 + */
  61.163 +extern void
  61.164 +xen_vif_record_opt_set_free(xen_vif_record_opt_set *set);
  61.165 +
  61.166 +
  61.167 +/**
  61.168 + * Get a record containing the current state of the given VIF.
  61.169 + */
  61.170 +extern bool
  61.171 +xen_vif_get_record(xen_session *session, xen_vif_record **result, xen_vif vif);
  61.172 +
  61.173 +
  61.174 +/**
  61.175 + * Get a reference to the VIF instance with the specified UUID.
  61.176 + */
  61.177 +extern bool
  61.178 +xen_vif_get_by_uuid(xen_session *session, xen_vif *result, char *uuid);
  61.179 +
  61.180 +
  61.181 +/**
  61.182 + * Create a new VIF instance, and return its handle.
  61.183 + */
  61.184 +extern bool
  61.185 +xen_vif_create(xen_session *session, xen_vif *result, xen_vif_record *record);
  61.186 +
  61.187 +
  61.188 +/**
  61.189 + * Destroy the specified VIF instance.
  61.190 + */
  61.191 +extern bool
  61.192 +xen_vif_destroy(xen_session *session, xen_vif vif);
  61.193 +
  61.194 +
  61.195 +/**
  61.196 + * Get the uuid field of the given VIF.
  61.197 + */
  61.198 +extern bool
  61.199 +xen_vif_get_uuid(xen_session *session, char **result, xen_vif vif);
  61.200 +
  61.201 +
  61.202 +/**
  61.203 + * Get the device field of the given VIF.
  61.204 + */
  61.205 +extern bool
  61.206 +xen_vif_get_device(xen_session *session, char **result, xen_vif vif);
  61.207 +
  61.208 +
  61.209 +/**
  61.210 + * Get the network field of the given VIF.
  61.211 + */
  61.212 +extern bool
  61.213 +xen_vif_get_network(xen_session *session, xen_network *result, xen_vif vif);
  61.214 +
  61.215 +
  61.216 +/**
  61.217 + * Get the VM field of the given VIF.
  61.218 + */
  61.219 +extern bool
  61.220 +xen_vif_get_vm(xen_session *session, xen_vm *result, xen_vif vif);
  61.221 +
  61.222 +
  61.223 +/**
  61.224 + * Get the MAC field of the given VIF.
  61.225 + */
  61.226 +extern bool
  61.227 +xen_vif_get_mac(xen_session *session, char **result, xen_vif vif);
  61.228 +
  61.229 +
  61.230 +/**
  61.231 + * Get the MTU field of the given VIF.
  61.232 + */
  61.233 +extern bool
  61.234 +xen_vif_get_mtu(xen_session *session, int64_t *result, xen_vif vif);
  61.235 +
  61.236 +
  61.237 +/**
  61.238 + * Get the currently_attached field of the given VIF.
  61.239 + */
  61.240 +extern bool
  61.241 +xen_vif_get_currently_attached(xen_session *session, bool *result, xen_vif vif);
  61.242 +
  61.243 +
  61.244 +/**
  61.245 + * Get the status_code field of the given VIF.
  61.246 + */
  61.247 +extern bool
  61.248 +xen_vif_get_status_code(xen_session *session, int64_t *result, xen_vif vif);
  61.249 +
  61.250 +
  61.251 +/**
  61.252 + * Get the status_detail field of the given VIF.
  61.253 + */
  61.254 +extern bool
  61.255 +xen_vif_get_status_detail(xen_session *session, char **result, xen_vif vif);
  61.256 +
  61.257 +
  61.258 +/**
  61.259 + * Get the runtime_properties field of the given VIF.
  61.260 + */
  61.261 +extern bool
  61.262 +xen_vif_get_runtime_properties(xen_session *session, xen_string_string_map **result, xen_vif vif);
  61.263 +
  61.264 +
  61.265 +/**
  61.266 + * Get the qos/algorithm_type field of the given VIF.
  61.267 + */
  61.268 +extern bool
  61.269 +xen_vif_get_qos_algorithm_type(xen_session *session, char **result, xen_vif vif);
  61.270 +
  61.271 +
  61.272 +/**
  61.273 + * Get the qos/algorithm_params field of the given VIF.
  61.274 + */
  61.275 +extern bool
  61.276 +xen_vif_get_qos_algorithm_params(xen_session *session, xen_string_string_map **result, xen_vif vif);
  61.277 +
  61.278 +
  61.279 +/**
  61.280 + * Get the qos/supported_algorithms field of the given VIF.
  61.281 + */
  61.282 +extern bool
  61.283 +xen_vif_get_qos_supported_algorithms(xen_session *session, struct xen_string_set **result, xen_vif vif);
  61.284 +
  61.285 +
  61.286 +/**
  61.287 + * Get the metrics field of the given VIF.
  61.288 + */
  61.289 +extern bool
  61.290 +xen_vif_get_metrics(xen_session *session, xen_vif_metrics *result, xen_vif vif);
  61.291 +
  61.292 +
  61.293 +/**
  61.294 + * Set the device field of the given VIF.
  61.295 + */
  61.296 +extern bool
  61.297 +xen_vif_set_device(xen_session *session, xen_vif vif, char *device);
  61.298 +
  61.299 +
  61.300 +/**
  61.301 + * Set the MAC field of the given VIF.
  61.302 + */
  61.303 +extern bool
  61.304 +xen_vif_set_mac(xen_session *session, xen_vif vif, char *mac);
  61.305 +
  61.306 +
  61.307 +/**
  61.308 + * Set the MTU field of the given VIF.
  61.309 + */
  61.310 +extern bool
  61.311 +xen_vif_set_mtu(xen_session *session, xen_vif vif, int64_t mtu);
  61.312 +
  61.313 +
  61.314 +/**
  61.315 + * Set the qos/algorithm_type field of the given VIF.
  61.316 + */
  61.317 +extern bool
  61.318 +xen_vif_set_qos_algorithm_type(xen_session *session, xen_vif vif, char *algorithm_type);
  61.319 +
  61.320 +
  61.321 +/**
  61.322 + * Set the qos/algorithm_params field of the given VIF.
  61.323 + */
  61.324 +extern bool
  61.325 +xen_vif_set_qos_algorithm_params(xen_session *session, xen_vif vif, xen_string_string_map *algorithm_params);
  61.326 +
  61.327 +
  61.328 +/**
  61.329 + * Add the given key-value pair to the qos/algorithm_params field of
  61.330 + * the given VIF.
  61.331 + */
  61.332 +extern bool
  61.333 +xen_vif_add_to_qos_algorithm_params(xen_session *session, xen_vif vif, char *key, char *value);
  61.334 +
  61.335 +
  61.336 +/**
  61.337 + * Remove the given key and its corresponding value from the
  61.338 + * qos/algorithm_params field of the given VIF.  If the key is not in that
  61.339 + * Map, then do nothing.
  61.340 + */
  61.341 +extern bool
  61.342 +xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char *key);
  61.343 +
  61.344 +
  61.345 +/**
  61.346 + * Hotplug the specified VIF, dynamically attaching it to the running
  61.347 + * VM.
  61.348 + */
  61.349 +extern bool
  61.350 +xen_vif_plug(xen_session *session, xen_vif self);
  61.351 +
  61.352 +
  61.353 +/**
  61.354 + * Hot-unplug the specified VIF, dynamically unattaching it from the
  61.355 + * running VM.
  61.356 + */
  61.357 +extern bool
  61.358 +xen_vif_unplug(xen_session *session, xen_vif self);
  61.359 +
  61.360 +
  61.361 +/**
  61.362 + * Return a list of all the VIFs known to the system.
  61.363 + */
  61.364 +extern bool
  61.365 +xen_vif_get_all(xen_session *session, struct xen_vif_set **result);
  61.366 +
  61.367 +
  61.368 +#endif
    62.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    62.2 +++ b/tools/libxen/include/xen/api/xen_vif_decl.h	Tue Apr 24 21:39:23 2007 +0100
    62.3 @@ -0,0 +1,30 @@
    62.4 +/*
    62.5 + * Copyright (c) 2006-2007, XenSource Inc.
    62.6 + *
    62.7 + * This library is free software; you can redistribute it and/or
    62.8 + * modify it under the terms of the GNU Lesser General Public
    62.9 + * License as published by the Free Software Foundation; either
   62.10 + * version 2.1 of the License, or (at your option) any later version.
   62.11 + *
   62.12 + * This library is distributed in the hope that it will be useful,
   62.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   62.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   62.15 + * Lesser General Public License for more details.
   62.16 + *
   62.17 + * You should have received a copy of the GNU Lesser General Public
   62.18 + * License along with this library; if not, write to the Free Software
   62.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   62.20 + */
   62.21 +
   62.22 +#ifndef XEN_VIF_DECL_H
   62.23 +#define XEN_VIF_DECL_H
   62.24 +
   62.25 +typedef void *xen_vif;
   62.26 +
   62.27 +struct xen_vif_set;
   62.28 +struct xen_vif_record;
   62.29 +struct xen_vif_record_set;
   62.30 +struct xen_vif_record_opt;
   62.31 +struct xen_vif_record_opt_set;
   62.32 +
   62.33 +#endif
    63.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.2 +++ b/tools/libxen/include/xen/api/xen_vif_metrics.h	Tue Apr 24 21:39:23 2007 +0100
    63.3 @@ -0,0 +1,198 @@
    63.4 +/*
    63.5 + * Copyright (c) 2006-2007, XenSource Inc.
    63.6 + *
    63.7 + * This library is free software; you can redistribute it and/or
    63.8 + * modify it under the terms of the GNU Lesser General Public
    63.9 + * License as published by the Free Software Foundation; either
   63.10 + * version 2.1 of the License, or (at your option) any later version.
   63.11 + *
   63.12 + * This library is distributed in the hope that it will be useful,
   63.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   63.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   63.15 + * Lesser General Public License for more details.
   63.16 + *
   63.17 + * You should have received a copy of the GNU Lesser General Public
   63.18 + * License along with this library; if not, write to the Free Software
   63.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   63.20 + */
   63.21 +
   63.22 +#ifndef XEN_VIF_METRICS_H
   63.23 +#define XEN_VIF_METRICS_H
   63.24 +
   63.25 +#include <xen/api/xen_common.h>
   63.26 +#include <xen/api/xen_vif_metrics_decl.h>
   63.27 +
   63.28 +
   63.29 +/*
   63.30 + * The VIF_metrics class.
   63.31 + * 
   63.32 + * The metrics associated with a virtual network device.
   63.33 + */
   63.34 +
   63.35 +
   63.36 +/**
   63.37 + * Free the given xen_vif_metrics.  The given handle must have been
   63.38 + * allocated by this library.
   63.39 + */
   63.40 +extern void
   63.41 +xen_vif_metrics_free(xen_vif_metrics vif_metrics);
   63.42 +
   63.43 +
   63.44 +typedef struct xen_vif_metrics_set
   63.45 +{
   63.46 +    size_t size;
   63.47 +    xen_vif_metrics *contents[];
   63.48 +} xen_vif_metrics_set;
   63.49 +
   63.50 +/**
   63.51 + * Allocate a xen_vif_metrics_set of the given size.
   63.52 + */
   63.53 +extern xen_vif_metrics_set *
   63.54 +xen_vif_metrics_set_alloc(size_t size);
   63.55 +
   63.56 +/**
   63.57 + * Free the given xen_vif_metrics_set.  The given set must have been
   63.58 + * allocated by this library.
   63.59 + */
   63.60 +extern void
   63.61 +xen_vif_metrics_set_free(xen_vif_metrics_set *set);
   63.62 +
   63.63 +
   63.64 +typedef struct xen_vif_metrics_record
   63.65 +{
   63.66 +    xen_vif_metrics handle;
   63.67 +    char *uuid;
   63.68 +    double io_read_kbs;
   63.69 +    double io_write_kbs;
   63.70 +    time_t last_updated;
   63.71 +} xen_vif_metrics_record;
   63.72 +
   63.73 +/**
   63.74 + * Allocate a xen_vif_metrics_record.
   63.75 + */
   63.76 +extern xen_vif_metrics_record *
   63.77 +xen_vif_metrics_record_alloc(void);
   63.78 +
   63.79 +/**
   63.80 + * Free the given xen_vif_metrics_record, and all referenced values. 
   63.81 + * The given record must have been allocated by this library.
   63.82 + */
   63.83 +extern void
   63.84 +xen_vif_metrics_record_free(xen_vif_metrics_record *record);
   63.85 +
   63.86 +
   63.87 +typedef struct xen_vif_metrics_record_opt
   63.88 +{
   63.89 +    bool is_record;
   63.90 +    union
   63.91 +    {
   63.92 +        xen_vif_metrics handle;
   63.93 +        xen_vif_metrics_record *record;
   63.94 +    } u;
   63.95 +} xen_vif_metrics_record_opt;
   63.96 +
   63.97 +/**
   63.98 + * Allocate a xen_vif_metrics_record_opt.
   63.99 + */
  63.100 +extern xen_vif_metrics_record_opt *
  63.101 +xen_vif_metrics_record_opt_alloc(void);
  63.102 +
  63.103 +/**
  63.104 + * Free the given xen_vif_metrics_record_opt, and all referenced
  63.105 + * values.  The given record_opt must have been allocated by this library.
  63.106 + */
  63.107 +extern void
  63.108 +xen_vif_metrics_record_opt_free(xen_vif_metrics_record_opt *record_opt);
  63.109 +
  63.110 +
  63.111 +typedef struct xen_vif_metrics_record_set
  63.112 +{
  63.113 +    size_t size;
  63.114 +    xen_vif_metrics_record *contents[];
  63.115 +} xen_vif_metrics_record_set;
  63.116 +
  63.117 +/**
  63.118 + * Allocate a xen_vif_metrics_record_set of the given size.
  63.119 + */
  63.120 +extern xen_vif_metrics_record_set *
  63.121 +xen_vif_metrics_record_set_alloc(size_t size);
  63.122 +
  63.123 +/**
  63.124 + * Free the given xen_vif_metrics_record_set, and all referenced
  63.125 + * values.  The given set must have been allocated by this library.
  63.126 + */
  63.127 +extern void
  63.128 +xen_vif_metrics_record_set_free(xen_vif_metrics_record_set *set);
  63.129 +
  63.130 +
  63.131 +
  63.132 +typedef struct xen_vif_metrics_record_opt_set
  63.133 +{
  63.134 +    size_t size;
  63.135 +    xen_vif_metrics_record_opt *contents[];
  63.136 +} xen_vif_metrics_record_opt_set;
  63.137 +
  63.138 +/**
  63.139 + * Allocate a xen_vif_metrics_record_opt_set of the given size.
  63.140 + */
  63.141 +extern xen_vif_metrics_record_opt_set *
  63.142 +xen_vif_metrics_record_opt_set_alloc(size_t size);
  63.143 +
  63.144 +/**
  63.145 + * Free the given xen_vif_metrics_record_opt_set, and all referenced
  63.146 + * values.  The given set must have been allocated by this library.
  63.147 + */
  63.148 +extern void
  63.149 +xen_vif_metrics_record_opt_set_free(xen_vif_metrics_record_opt_set *set);
  63.150 +
  63.151 +
  63.152 +/**
  63.153 + * Get a record containing the current state of the given VIF_metrics.
  63.154 + */
  63.155 +extern bool
  63.156 +xen_vif_metrics_get_record(xen_session *session, xen_vif_metrics_record **result, xen_vif_metrics vif_metrics);
  63.157 +
  63.158 +
  63.159 +/**
  63.160 + * Get a reference to the VIF_metrics instance with the specified UUID.
  63.161 + */
  63.162 +extern bool
  63.163 +xen_vif_metrics_get_by_uuid(xen_session *session, xen_vif_metrics *result, char *uuid);
  63.164 +
  63.165 +
  63.166 +/**
  63.167 + * Get the uuid field of the given VIF_metrics.
  63.168 + */
  63.169 +extern bool
  63.170 +xen_vif_metrics_get_uuid(xen_session *session, char **result, xen_vif_metrics vif_metrics);
  63.171 +
  63.172 +
  63.173 +/**
  63.174 + * Get the io/read_kbs field of the given VIF_metrics.
  63.175 + */
  63.176 +extern bool
  63.177 +xen_vif_metrics_get_io_read_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics);
  63.178 +
  63.179 +
  63.180 +/**
  63.181 + * Get the io/write_kbs field of the given VIF_metrics.
  63.182 + */
  63.183 +extern bool
  63.184 +xen_vif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics);
  63.185 +
  63.186 +
  63.187 +/**
  63.188 + * Get the last_updated field of the given VIF_metrics.
  63.189 + */
  63.190 +extern bool
  63.191 +xen_vif_metrics_get_last_updated(xen_session *session, time_t *result, xen_vif_metrics vif_metrics);
  63.192 +
  63.193 +
  63.194 +/**
  63.195 + * Return a list of all the VIF_metrics instances known to the system.
  63.196 + */
  63.197 +extern bool
  63.198 +xen_vif_metrics_get_all(xen_session *session, struct xen_vif_metrics_set **result);
  63.199 +
  63.200 +
  63.201 +#endif
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/tools/libxen/include/xen/api/xen_vif_metrics_decl.h	Tue Apr 24 21:39:23 2007 +0100
    64.3 @@ -0,0 +1,30 @@
    64.4 +/*
    64.5 + * Copyright (c) 2006-2007, XenSource Inc.
    64.6 + *
    64.7 + * This library is free software; you can redistribute it and/or
    64.8 + * modify it under the terms of the GNU Lesser General Public
    64.9 + * License as published by the Free Software Foundation; either
   64.10 + * version 2.1 of the License, or (at your option) any later version.
   64.11 + *
   64.12 + * This library is distributed in the hope that it will be useful,
   64.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   64.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   64.15 + * Lesser General Public License for more details.
   64.16 + *
   64.17 + * You should have received a copy of the GNU Lesser General Public
   64.18 + * License along with this library; if not, write to the Free Software
   64.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   64.20 + */
   64.21 +
   64.22 +#ifndef XEN_VIF_METRICS_DECL_H
   64.23 +#define XEN_VIF_METRICS_DECL_H
   64.24 +
   64.25 +typedef void *xen_vif_metrics;
   64.26 +
   64.27 +struct xen_vif_metrics_set;
   64.28 +struct xen_vif_metrics_record;
   64.29 +struct xen_vif_metrics_record_set;
   64.30 +struct xen_vif_metrics_record_opt;
   64.31 +struct xen_vif_metrics_record_opt_set;
   64.32 +
   64.33 +#endif
    65.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.2 +++ b/tools/libxen/include/xen/api/xen_vm.h	Tue Apr 24 21:39:23 2007 +0100
    65.3 @@ -0,0 +1,894 @@
    65.4 +/*
    65.5 + * Copyright (c) 2006-2007, XenSource Inc.
    65.6 + *
    65.7 + * This library is free software; you can redistribute it and/or
    65.8 + * modify it under the terms of the GNU Lesser General Public
    65.9 + * License as published by the Free Software Foundation; either
   65.10 + * version 2.1 of the License, or (at your option) any later version.
   65.11 + *
   65.12 + * This library is distributed in the hope that it will be useful,
   65.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   65.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   65.15 + * Lesser General Public License for more details.
   65.16 + *
   65.17 + * You should have received a copy of the GNU Lesser General Public
   65.18 + * License along with this library; if not, write to the Free Software
   65.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   65.20 + */
   65.21 +
   65.22 +#ifndef XEN_VM_H
   65.23 +#define XEN_VM_H
   65.24 +
   65.25 +#include <xen/api/xen_common.h>
   65.26 +#include <xen/api/xen_console_decl.h>
   65.27 +#include <xen/api/xen_crashdump_decl.h>
   65.28 +#include <xen/api/xen_host_decl.h>
   65.29 +#include <xen/api/xen_on_crash_behaviour.h>
   65.30 +#include <xen/api/xen_on_normal_exit.h>
   65.31 +#include <xen/api/xen_string_string_map.h>
   65.32 +#include <xen/api/xen_vbd_decl.h>
   65.33 +#include <xen/api/xen_vdi_decl.h>
   65.34 +#include <xen/api/xen_vif_decl.h>
   65.35 +#include <xen/api/xen_vm_decl.h>
   65.36 +#include <xen/api/xen_vm_guest_metrics_decl.h>
   65.37 +#include <xen/api/xen_vm_metrics_decl.h>
   65.38 +#include <xen/api/xen_vm_power_state.h>
   65.39 +#include <xen/api/xen_vtpm_decl.h>
   65.40 +
   65.41 +
   65.42 +/*
   65.43 + * The VM class.
   65.44 + * 
   65.45 + * A virtual machine (or 'guest').
   65.46 + */
   65.47 +
   65.48 +
   65.49 +/**
   65.50 + * Free the given xen_vm.  The given handle must have been allocated by
   65.51 + * this library.
   65.52 + */
   65.53 +extern void
   65.54 +xen_vm_free(xen_vm vm);
   65.55 +
   65.56 +
   65.57 +typedef struct xen_vm_set
   65.58 +{
   65.59 +    size_t size;
   65.60 +    xen_vm *contents[];
   65.61 +} xen_vm_set;
   65.62 +
   65.63 +/**
   65.64 + * Allocate a xen_vm_set of the given size.
   65.65 + */
   65.66 +extern xen_vm_set *
   65.67 +xen_vm_set_alloc(size_t size);
   65.68 +
   65.69 +/**
   65.70 + * Free the given xen_vm_set.  The given set must have been allocated
   65.71 + * by this library.
   65.72 + */
   65.73 +extern void
   65.74 +xen_vm_set_free(xen_vm_set *set);
   65.75 +
   65.76 +
   65.77 +typedef struct xen_vm_record
   65.78 +{
   65.79 +    xen_vm handle;
   65.80 +    char *uuid;
   65.81 +    enum xen_vm_power_state power_state;
   65.82 +    char *name_label;
   65.83 +    char *name_description;
   65.84 +    int64_t user_version;
   65.85 +    bool is_a_template;
   65.86 +    bool auto_power_on;
   65.87 +    struct xen_vdi_record_opt *suspend_vdi;
   65.88 +    struct xen_host_record_opt *resident_on;
   65.89 +    int64_t memory_static_max;
   65.90 +    int64_t memory_dynamic_max;
   65.91 +    int64_t memory_dynamic_min;
   65.92 +    int64_t memory_static_min;
   65.93 +    xen_string_string_map *vcpus_params;
   65.94 +    int64_t vcpus_max;
   65.95 +    int64_t vcpus_at_startup;
   65.96 +    enum xen_on_normal_exit actions_after_shutdown;
   65.97 +    enum xen_on_normal_exit actions_after_reboot;
   65.98 +    enum xen_on_crash_behaviour actions_after_crash;
   65.99 +    struct xen_console_record_opt_set *consoles;
  65.100 +    struct xen_vif_record_opt_set *vifs;
  65.101 +    struct xen_vbd_record_opt_set *vbds;
  65.102 +    struct xen_crashdump_record_opt_set *crash_dumps;
  65.103 +    struct xen_vtpm_record_opt_set *vtpms;
  65.104 +    char *pv_bootloader;
  65.105 +    char *pv_kernel;
  65.106 +    char *pv_ramdisk;
  65.107 +    char *pv_args;
  65.108 +    char *pv_bootloader_args;
  65.109 +    char *hvm_boot_policy;
  65.110 +    xen_string_string_map *hvm_boot_params;
  65.111 +    xen_string_string_map *platform;
  65.112 +    char *pci_bus;
  65.113 +    xen_string_string_map *other_config;
  65.114 +    int64_t domid;
  65.115 +    bool is_control_domain;
  65.116 +    struct xen_vm_metrics_record_opt *metrics;
  65.117 +    struct xen_vm_guest_metrics_record_opt *guest_metrics;
  65.118 +} xen_vm_record;
  65.119 +
  65.120 +/**
  65.121 + * Allocate a xen_vm_record.
  65.122 + */
  65.123 +extern xen_vm_record *
  65.124 +xen_vm_record_alloc(void);
  65.125 +
  65.126 +/**
  65.127 + * Free the given xen_vm_record, and all referenced values.  The given
  65.128 + * record must have been allocated by this library.
  65.129 + */
  65.130 +extern void
  65.131 +xen_vm_record_free(xen_vm_record *record);
  65.132 +
  65.133 +
  65.134 +typedef struct xen_vm_record_opt
  65.135 +{
  65.136 +    bool is_record;
  65.137 +    union
  65.138 +    {
  65.139 +        xen_vm handle;
  65.140 +        xen_vm_record *record;
  65.141 +    } u;
  65.142 +} xen_vm_record_opt;
  65.143 +
  65.144 +/**
  65.145 + * Allocate a xen_vm_record_opt.
  65.146 + */
  65.147 +extern xen_vm_record_opt *
  65.148 +xen_vm_record_opt_alloc(void);
  65.149 +
  65.150 +/**
  65.151 + * Free the given xen_vm_record_opt, and all referenced values.  The
  65.152 + * given record_opt must have been allocated by this library.
  65.153 + */
  65.154 +extern void
  65.155 +xen_vm_record_opt_free(xen_vm_record_opt *record_opt);
  65.156 +
  65.157 +
  65.158 +typedef struct xen_vm_record_set
  65.159 +{
  65.160 +    size_t size;
  65.161 +    xen_vm_record *contents[];
  65.162 +} xen_vm_record_set;
  65.163 +
  65.164 +/**
  65.165 + * Allocate a xen_vm_record_set of the given size.
  65.166 + */
  65.167 +extern xen_vm_record_set *
  65.168 +xen_vm_record_set_alloc(size_t size);
  65.169 +
  65.170 +/**
  65.171 + * Free the given xen_vm_record_set, and all referenced values.  The
  65.172 + * given set must have been allocated by this library.
  65.173 + */
  65.174 +extern void
  65.175 +xen_vm_record_set_free(xen_vm_record_set *set);
  65.176 +
  65.177 +
  65.178 +
  65.179 +typedef struct xen_vm_record_opt_set
  65.180 +{
  65.181 +    size_t size;
  65.182 +    xen_vm_record_opt *contents[];
  65.183 +} xen_vm_record_opt_set;
  65.184 +
  65.185 +/**
  65.186 + * Allocate a xen_vm_record_opt_set of the given size.
  65.187 + */
  65.188 +extern xen_vm_record_opt_set *
  65.189 +xen_vm_record_opt_set_alloc(size_t size);
  65.190 +
  65.191 +/**
  65.192 + * Free the given xen_vm_record_opt_set, and all referenced values. 
  65.193 + * The given set must have been allocated by this library.
  65.194 + */
  65.195 +extern void
  65.196 +xen_vm_record_opt_set_free(xen_vm_record_opt_set *set);
  65.197 +
  65.198 +
  65.199 +/**
  65.200 + * Get a record containing the current state of the given VM.
  65.201 + */
  65.202 +extern bool
  65.203 +xen_vm_get_record(xen_session *session, xen_vm_record **result, xen_vm vm);
  65.204 +
  65.205 +
  65.206 +/**
  65.207 + * Get a reference to the VM instance with the specified UUID.
  65.208 + */
  65.209 +extern bool
  65.210 +xen_vm_get_by_uuid(xen_session *session, xen_vm *result, char *uuid);
  65.211 +
  65.212 +
  65.213 +/**
  65.214 + * Create a new VM instance, and return its handle.
  65.215 + */
  65.216 +extern bool
  65.217 +xen_vm_create(xen_session *session, xen_vm *result, xen_vm_record *record);
  65.218 +
  65.219 +
  65.220 +/**
  65.221 + * Destroy the specified VM.  The VM is completely removed from the
  65.222 + * system.  This function can only be called when the VM is in the Halted
  65.223 + * State.
  65.224 + */
  65.225 +extern bool
  65.226 +xen_vm_destroy(xen_session *session, xen_vm vm);
  65.227 +
  65.228 +
  65.229 +/**
  65.230 + * Get all the VM instances with the given label.
  65.231 + */
  65.232 +extern bool
  65.233 +xen_vm_get_by_name_label(xen_session *session, struct xen_vm_set **result, char *label);
  65.234 +
  65.235 +
  65.236 +/**
  65.237 + * Get the uuid field of the given VM.
  65.238 + */
  65.239 +extern bool
  65.240 +xen_vm_get_uuid(xen_session *session, char **result, xen_vm vm);
  65.241 +
  65.242 +
  65.243 +/**
  65.244 + * Get the power_state field of the given VM.
  65.245 + */
  65.246 +extern bool
  65.247 +xen_vm_get_power_state(xen_session *session, enum xen_vm_power_state *result, xen_vm vm);
  65.248 +
  65.249 +
  65.250 +/**
  65.251 + * Get the name/label field of the given VM.
  65.252 + */
  65.253 +extern bool
  65.254 +xen_vm_get_name_label(xen_session *session, char **result, xen_vm vm);
  65.255 +
  65.256 +
  65.257 +/**
  65.258 + * Get the name/description field of the given VM.
  65.259 + */
  65.260 +extern bool
  65.261 +xen_vm_get_name_description(xen_session *session, char **result, xen_vm vm);
  65.262 +
  65.263 +
  65.264 +/**
  65.265 + * Get the user_version field of the given VM.
  65.266 + */
  65.267 +extern bool
  65.268 +xen_vm_get_user_version(xen_session *session, int64_t *result, xen_vm vm);
  65.269 +
  65.270 +
  65.271 +/**
  65.272 + * Get the is_a_template field of the given VM.
  65.273 + */
  65.274 +extern bool
  65.275 +xen_vm_get_is_a_template(xen_session *session, bool *result, xen_vm vm);
  65.276 +
  65.277 +
  65.278 +/**
  65.279 + * Get the auto_power_on field of the given VM.
  65.280 + */
  65.281 +extern bool
  65.282 +xen_vm_get_auto_power_on(xen_session *session, bool *result, xen_vm vm);
  65.283 +
  65.284 +
  65.285 +/**
  65.286 + * Get the suspend_VDI field of the given VM.
  65.287 + */
  65.288 +extern bool
  65.289 +xen_vm_get_suspend_vdi(xen_session *session, xen_vdi *result, xen_vm vm);
  65.290 +
  65.291 +
  65.292 +/**
  65.293 + * Get the resident_on field of the given VM.
  65.294 + */
  65.295 +extern bool
  65.296 +xen_vm_get_resident_on(xen_session *session, xen_host *result, xen_vm vm);
  65.297 +
  65.298 +
  65.299 +/**
  65.300 + * Get the memory/static_max field of the given VM.
  65.301 + */
  65.302 +extern bool
  65.303 +xen_vm_get_memory_static_max(xen_session *session, int64_t *result, xen_vm vm);
  65.304 +
  65.305 +
  65.306 +/**
  65.307 + * Get the memory/dynamic_max field of the given VM.
  65.308 + */
  65.309 +extern bool
  65.310 +xen_vm_get_memory_dynamic_max(xen_session *session, int64_t *result, xen_vm vm);
  65.311 +
  65.312 +
  65.313 +/**
  65.314 + * Get the memory/dynamic_min field of the given VM.
  65.315 + */
  65.316 +extern bool
  65.317 +xen_vm_get_memory_dynamic_min(xen_session *session, int64_t *result, xen_vm vm);
  65.318 +
  65.319 +
  65.320 +/**
  65.321 + * Get the memory/static_min field of the given VM.
  65.322 + */
  65.323 +extern bool
  65.324 +xen_vm_get_memory_static_min(xen_session *session, int64_t *result, xen_vm vm);
  65.325 +
  65.326 +
  65.327 +/**
  65.328 + * Get the VCPUs/params field of the given VM.
  65.329 + */
  65.330 +extern bool
  65.331 +xen_vm_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
  65.332 +
  65.333 +
  65.334 +/**
  65.335 + * Get the VCPUs/max field of the given VM.
  65.336 + */
  65.337 +extern bool
  65.338 +xen_vm_get_vcpus_max(xen_session *session, int64_t *result, xen_vm vm);
  65.339 +
  65.340 +
  65.341 +/**
  65.342 + * Get the VCPUs/at_startup field of the given VM.
  65.343 + */
  65.344 +extern bool
  65.345 +xen_vm_get_vcpus_at_startup(xen_session *session, int64_t *result, xen_vm vm);
  65.346 +
  65.347 +
  65.348 +/**
  65.349 + * Get the actions/after_shutdown field of the given VM.
  65.350 + */
  65.351 +extern bool
  65.352 +xen_vm_get_actions_after_shutdown(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
  65.353 +
  65.354 +
  65.355 +/**
  65.356 + * Get the actions/after_reboot field of the given VM.
  65.357 + */
  65.358 +extern bool
  65.359 +xen_vm_get_actions_after_reboot(xen_session *session, enum xen_on_normal_exit *result, xen_vm vm);
  65.360 +
  65.361 +
  65.362 +/**
  65.363 + * Get the actions/after_crash field of the given VM.
  65.364 + */
  65.365 +extern bool
  65.366 +xen_vm_get_actions_after_crash(xen_session *session, enum xen_on_crash_behaviour *result, xen_vm vm);
  65.367 +
  65.368 +
  65.369 +/**
  65.370 + * Get the consoles field of the given VM.
  65.371 + */
  65.372 +extern bool
  65.373 +xen_vm_get_consoles(xen_session *session, struct xen_console_set **result, xen_vm vm);
  65.374 +
  65.375 +
  65.376 +/**
  65.377 + * Get the VIFs field of the given VM.
  65.378 + */
  65.379 +extern bool
  65.380 +xen_vm_get_vifs(xen_session *session, struct xen_vif_set **result, xen_vm vm);
  65.381 +
  65.382 +
  65.383 +/**
  65.384 + * Get the VBDs field of the given VM.
  65.385 + */
  65.386 +extern bool
  65.387 +xen_vm_get_vbds(xen_session *session, struct xen_vbd_set **result, xen_vm vm);
  65.388 +
  65.389 +
  65.390 +/**
  65.391 + * Get the crash_dumps field of the given VM.
  65.392 + */
  65.393 +extern bool
  65.394 +xen_vm_get_crash_dumps(xen_session *session, struct xen_crashdump_set **result, xen_vm vm);
  65.395 +
  65.396 +
  65.397 +/**
  65.398 + * Get the VTPMs field of the given VM.
  65.399 + */
  65.400 +extern bool
  65.401 +xen_vm_get_vtpms(xen_session *session, struct xen_vtpm_set **result, xen_vm vm);
  65.402 +
  65.403 +
  65.404 +/**
  65.405 + * Get the PV/bootloader field of the given VM.
  65.406 + */
  65.407 +extern bool
  65.408 +xen_vm_get_pv_bootloader(xen_session *session, char **result, xen_vm vm);
  65.409 +
  65.410 +
  65.411 +/**
  65.412 + * Get the PV/kernel field of the given VM.
  65.413 + */
  65.414 +extern bool
  65.415 +xen_vm_get_pv_kernel(xen_session *session, char **result, xen_vm vm);
  65.416 +
  65.417 +
  65.418 +/**
  65.419 + * Get the PV/ramdisk field of the given VM.
  65.420 + */
  65.421 +extern bool
  65.422 +xen_vm_get_pv_ramdisk(xen_session *session, char **result, xen_vm vm);
  65.423 +
  65.424 +
  65.425 +/**
  65.426 + * Get the PV/args field of the given VM.
  65.427 + */
  65.428 +extern bool
  65.429 +xen_vm_get_pv_args(xen_session *session, char **result, xen_vm vm);
  65.430 +
  65.431 +
  65.432 +/**
  65.433 + * Get the PV/bootloader_args field of the given VM.
  65.434 + */
  65.435 +extern bool
  65.436 +xen_vm_get_pv_bootloader_args(xen_session *session, char **result, xen_vm vm);
  65.437 +
  65.438 +
  65.439 +/**
  65.440 + * Get the HVM/boot_policy field of the given VM.
  65.441 + */
  65.442 +extern bool
  65.443 +xen_vm_get_hvm_boot_policy(xen_session *session, char **result, xen_vm vm);
  65.444 +
  65.445 +
  65.446 +/**
  65.447 + * Get the HVM/boot_params field of the given VM.
  65.448 + */
  65.449 +extern bool
  65.450 +xen_vm_get_hvm_boot_params(xen_session *session, xen_string_string_map **result, xen_vm vm);
  65.451 +
  65.452 +
  65.453 +/**
  65.454 + * Get the platform field of the given VM.
  65.455 + */
  65.456 +extern bool
  65.457 +xen_vm_get_platform(xen_session *session, xen_string_string_map **result, xen_vm vm);
  65.458 +
  65.459 +
  65.460 +/**
  65.461 + * Get the PCI_bus field of the given VM.
  65.462 + */
  65.463 +extern bool
  65.464 +xen_vm_get_pci_bus(xen_session *session, char **result, xen_vm vm);
  65.465 +
  65.466 +
  65.467 +/**
  65.468 + * Get the other_config field of the given VM.
  65.469 + */
  65.470 +extern bool
  65.471 +xen_vm_get_other_config(xen_session *session, xen_string_string_map **result, xen_vm vm);
  65.472 +
  65.473 +
  65.474 +/**
  65.475 + * Get the domid field of the given VM.
  65.476 + */
  65.477 +extern bool
  65.478 +xen_vm_get_domid(xen_session *session, int64_t *result, xen_vm vm);
  65.479 +
  65.480 +
  65.481 +/**
  65.482 + * Get the is_control_domain field of the given VM.
  65.483 + */
  65.484 +extern bool
  65.485 +xen_vm_get_is_control_domain(xen_session *session, bool *result, xen_vm vm);
  65.486 +
  65.487 +
  65.488 +/**
  65.489 + * Get the metrics field of the given VM.
  65.490 + */
  65.491 +extern bool
  65.492 +xen_vm_get_metrics(xen_session *session, xen_vm_metrics *result, xen_vm vm);
  65.493 +
  65.494 +
  65.495 +/**
  65.496 + * Get the guest_metrics field of the given VM.
  65.497 + */
  65.498 +extern bool
  65.499 +xen_vm_get_guest_metrics(xen_session *session, xen_vm_guest_metrics *result, xen_vm vm);
  65.500 +
  65.501 +
  65.502 +/**
  65.503 + * Set the name/label field of the given VM.
  65.504 + */
  65.505 +extern bool
  65.506 +xen_vm_set_name_label(xen_session *session, xen_vm vm, char *label);
  65.507 +
  65.508 +
  65.509 +/**
  65.510 + * Set the name/description field of the given VM.
  65.511 + */
  65.512 +extern bool
  65.513 +xen_vm_set_name_description(xen_session *session, xen_vm vm, char *description);
  65.514 +
  65.515 +
  65.516 +/**
  65.517 + * Set the user_version field of the given VM.
  65.518 + */
  65.519 +extern bool
  65.520 +xen_vm_set_user_version(xen_session *session, xen_vm vm, int64_t user_version);
  65.521 +
  65.522 +
  65.523 +/**
  65.524 + * Set the is_a_template field of the given VM.
  65.525 + */
  65.526 +extern bool
  65.527 +xen_vm_set_is_a_template(xen_session *session, xen_vm vm, bool is_a_template);
  65.528 +
  65.529 +
  65.530 +/**
  65.531 + * Set the auto_power_on field of the given VM.
  65.532 + */
  65.533 +extern bool
  65.534 +xen_vm_set_auto_power_on(xen_session *session, xen_vm vm, bool auto_power_on);
  65.535 +
  65.536 +
  65.537 +/**
  65.538 + * Set the memory/static_max field of the given VM.
  65.539 + */
  65.540 +extern bool
  65.541 +xen_vm_set_memory_static_max(xen_session *session, xen_vm vm, int64_t static_max);
  65.542 +
  65.543 +
  65.544 +/**
  65.545 + * Set the memory/dynamic_max field of the given VM.
  65.546 + */
  65.547 +extern bool
  65.548 +xen_vm_set_memory_dynamic_max(xen_session *session, xen_vm vm, int64_t dynamic_max);
  65.549 +
  65.550 +
  65.551 +/**
  65.552 + * Set the memory/dynamic_min field of the given VM.
  65.553 + */
  65.554 +extern bool
  65.555 +xen_vm_set_memory_dynamic_min(xen_session *session, xen_vm vm, int64_t dynamic_min);
  65.556 +
  65.557 +
  65.558 +/**
  65.559 + * Set the memory/static_min field of the given VM.
  65.560 + */
  65.561 +extern bool
  65.562 +xen_vm_set_memory_static_min(xen_session *session, xen_vm vm, int64_t static_min);
  65.563 +
  65.564 +
  65.565 +/**
  65.566 + * Set the VCPUs/params field of the given VM.
  65.567 + */
  65.568 +extern bool
  65.569 +xen_vm_set_vcpus_params(xen_session *session, xen_vm vm, xen_string_string_map *params);
  65.570 +
  65.571 +
  65.572 +/**
  65.573 + * Add the given key-value pair to the VCPUs/params field of the given
  65.574 + * VM.
  65.575 + */
  65.576 +extern bool
  65.577 +xen_vm_add_to_vcpus_params(xen_session *session, xen_vm vm, char *key, char *value);
  65.578 +
  65.579 +
  65.580 +/**
  65.581 + * Remove the given key and its corresponding value from the
  65.582 + * VCPUs/params field of the given VM.  If the key is not in that Map, then do
  65.583 + * nothing.
  65.584 + */
  65.585 +extern bool
  65.586 +xen_vm_remove_from_vcpus_params(xen_session *session, xen_vm vm, char *key);
  65.587 +
  65.588 +
  65.589 +/**
  65.590 + * Set the VCPUs/max field of the given VM.
  65.591 + */
  65.592 +extern bool
  65.593 +xen_vm_set_vcpus_max(xen_session *session, xen_vm vm, int64_t max);
  65.594 +
  65.595 +
  65.596 +/**
  65.597 + * Set the VCPUs/at_startup field of the given VM.
  65.598 + */
  65.599 +extern bool
  65.600 +xen_vm_set_vcpus_at_startup(xen_session *session, xen_vm vm, int64_t at_startup);
  65.601 +
  65.602 +
  65.603 +/**
  65.604 + * Set the actions/after_shutdown field of the given VM.
  65.605 + */
  65.606 +extern bool
  65.607 +xen_vm_set_actions_after_shutdown(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_shutdown);
  65.608 +
  65.609 +
  65.610 +/**
  65.611 + * Set the actions/after_reboot field of the given VM.
  65.612 + */
  65.613 +extern bool
  65.614 +xen_vm_set_actions_after_reboot(xen_session *session, xen_vm vm, enum xen_on_normal_exit after_reboot);
  65.615 +
  65.616 +
  65.617 +/**
  65.618 + * Set the actions/after_crash field of the given VM.
  65.619 + */
  65.620 +extern bool
  65.621 +xen_vm_set_actions_after_crash(xen_session *session, xen_vm vm, enum xen_on_crash_behaviour after_crash);
  65.622 +
  65.623 +
  65.624 +/**
  65.625 + * Set the PV/bootloader field of the given VM.
  65.626 + */
  65.627 +extern bool
  65.628 +xen_vm_set_pv_bootloader(xen_session *session, xen_vm vm, char *bootloader);
  65.629 +
  65.630 +
  65.631 +/**
  65.632 + * Set the PV/kernel field of the given VM.
  65.633 + */
  65.634 +extern bool
  65.635 +xen_vm_set_pv_kernel(xen_session *session, xen_vm vm, char *kernel);
  65.636 +
  65.637 +
  65.638 +/**
  65.639 + * Set the PV/ramdisk field of the given VM.
  65.640 + */
  65.641 +extern bool
  65.642 +xen_vm_set_pv_ramdisk(xen_session *session, xen_vm vm, char *ramdisk);
  65.643 +
  65.644 +
  65.645 +/**
  65.646 + * Set the PV/args field of the given VM.
  65.647 + */
  65.648 +extern bool
  65.649 +xen_vm_set_pv_args(xen_session *session, xen_vm vm, char *args);
  65.650 +
  65.651 +
  65.652 +/**
  65.653 + * Set the PV/bootloader_args field of the given VM.
  65.654 + */
  65.655 +extern bool
  65.656 +xen_vm_set_pv_bootloader_args(xen_session *session, xen_vm vm, char *bootloader_args);
  65.657 +
  65.658 +
  65.659 +/**
  65.660 + * Set the HVM/boot_policy field of the given VM.
  65.661 + */
  65.662 +extern bool
  65.663 +xen_vm_set_hvm_boot_policy(xen_session *session, xen_vm vm, char *boot_policy);
  65.664 +
  65.665 +
  65.666 +/**
  65.667 + * Set the HVM/boot_params field of the given VM.
  65.668 + */
  65.669 +extern bool
  65.670 +xen_vm_set_hvm_boot_params(xen_session *session, xen_vm vm, xen_string_string_map *boot_params);
  65.671 +
  65.672 +
  65.673 +/**
  65.674 + * Add the given key-value pair to the HVM/boot_params field of the
  65.675 + * given VM.
  65.676 + */
  65.677 +extern bool
  65.678 +xen_vm_add_to_hvm_boot_params(xen_session *session, xen_vm vm, char *key, char *value);
  65.679 +
  65.680 +
  65.681 +/**
  65.682 + * Remove the given key and its corresponding value from the
  65.683 + * HVM/boot_params field of the given VM.  If the key is not in that Map, then
  65.684 + * do nothing.
  65.685 + */
  65.686 +extern bool
  65.687 +xen_vm_remove_from_hvm_boot_params(xen_session *session, xen_vm vm, char *key);
  65.688 +
  65.689 +
  65.690 +/**
  65.691 + * Set the platform field of the given VM.
  65.692 + */
  65.693 +extern bool
  65.694 +xen_vm_set_platform(xen_session *session, xen_vm vm, xen_string_string_map *platform);
  65.695 +
  65.696 +
  65.697 +/**
  65.698 + * Add the given key-value pair to the platform field of the given VM.
  65.699 + */
  65.700 +extern bool
  65.701 +xen_vm_add_to_platform(xen_session *session, xen_vm vm, char *key, char *value);
  65.702 +
  65.703 +
  65.704 +/**
  65.705 + * Remove the given key and its corresponding value from the platform
  65.706 + * field of the given VM.  If the key is not in that Map, then do nothing.
  65.707 + */
  65.708 +extern bool
  65.709 +xen_vm_remove_from_platform(xen_session *session, xen_vm vm, char *key);
  65.710 +
  65.711 +
  65.712 +/**
  65.713 + * Set the PCI_bus field of the given VM.
  65.714 + */
  65.715 +extern bool
  65.716 +xen_vm_set_pci_bus(xen_session *session, xen_vm vm, char *pci_bus);
  65.717 +
  65.718 +
  65.719 +/**
  65.720 + * Set the other_config field of the given VM.
  65.721 + */
  65.722 +extern bool
  65.723 +xen_vm_set_other_config(xen_session *session, xen_vm vm, xen_string_string_map *other_config);
  65.724 +
  65.725 +
  65.726 +/**
  65.727 + * Add the given key-value pair to the other_config field of the given
  65.728 + * VM.
  65.729 + */
  65.730 +extern bool
  65.731 +xen_vm_add_to_other_config(xen_session *session, xen_vm vm, char *key, char *value);
  65.732 +
  65.733 +
  65.734 +/**
  65.735 + * Remove the given key and its corresponding value from the
  65.736 + * other_config field of the given VM.  If the key is not in that Map, then do
  65.737 + * nothing.
  65.738 + */
  65.739 +extern bool
  65.740 +xen_vm_remove_from_other_config(xen_session *session, xen_vm vm, char *key);
  65.741 +
  65.742 +
  65.743 +/**
  65.744 + * Clones the specified VM, making a new VM. Clone automatically
  65.745 + * exploits the capabilities of the underlying storage repository in which the
  65.746 + * VM's disk images are stored (e.g. Copy on Write).   This function can only
  65.747 + * be called when the VM is in the Halted State.
  65.748 + */
  65.749 +extern bool
  65.750 +xen_vm_clone(xen_session *session, xen_vm *result, xen_vm vm, char *new_name);
  65.751 +
  65.752 +
  65.753 +/**
  65.754 + * Start the specified VM.  This function can only be called with the
  65.755 + * VM is in the Halted State.
  65.756 + */
  65.757 +extern bool
  65.758 +xen_vm_start(xen_session *session, xen_vm vm, bool start_paused);
  65.759 +
  65.760 +
  65.761 +/**
  65.762 + * Pause the specified VM. This can only be called when the specified
  65.763 + * VM is in the Running state.
  65.764 + */
  65.765 +extern bool
  65.766 +xen_vm_pause(xen_session *session, xen_vm vm);
  65.767 +
  65.768 +
  65.769 +/**
  65.770 + * Resume the specified VM. This can only be called when the specified
  65.771 + * VM is in the Paused state.
  65.772 + */
  65.773 +extern bool
  65.774 +xen_vm_unpause(xen_session *session, xen_vm vm);
  65.775 +
  65.776 +
  65.777 +/**
  65.778 + * Attempt to cleanly shutdown the specified VM. (Note: this may not be
  65.779 + * supported---e.g. if a guest agent is not installed).
  65.780 + * 
  65.781 + * Once shutdown has been completed perform poweroff action specified in guest
  65.782 + * configuration.
  65.783 + * 
  65.784 + * This can only be called when the specified VM is in the Running state.
  65.785 + */
  65.786 +extern bool
  65.787 +xen_vm_clean_shutdown(xen_session *session, xen_vm vm);
  65.788 +
  65.789 +
  65.790 +/**
  65.791 + * Attempt to cleanly shutdown the specified VM (Note: this may not be
  65.792 + * supported---e.g. if a guest agent is not installed).
  65.793 + * 
  65.794 + * Once shutdown has been completed perform reboot action specified in guest
  65.795 + * configuration.
  65.796 + * 
  65.797 + * This can only be called when the specified VM is in the Running state.
  65.798 + */
  65.799 +extern bool
  65.800 +xen_vm_clean_reboot(xen_session *session, xen_vm vm);
  65.801 +
  65.802 +
  65.803 +/**
  65.804 + * Stop executing the specified VM without attempting a clean shutdown.
  65.805 + * Then perform poweroff action specified in VM configuration.
  65.806 + */
  65.807 +extern bool
  65.808 +xen_vm_hard_shutdown(xen_session *session, xen_vm vm);
  65.809 +
  65.810 +
  65.811 +/**
  65.812 + * Stop executing the specified VM without attempting a clean shutdown.
  65.813 + * Then perform reboot action specified in VM configuration
  65.814 + */
  65.815 +extern bool
  65.816 +xen_vm_hard_reboot(xen_session *session, xen_vm vm);
  65.817 +
  65.818 +
  65.819 +/**
  65.820 + * Suspend the specified VM to disk.  This can only be called when the
  65.821 + * specified VM is in the Running state.
  65.822 + */
  65.823 +extern bool
  65.824 +xen_vm_suspend(xen_session *session, xen_vm vm);
  65.825 +
  65.826 +
  65.827 +/**
  65.828 + * Awaken the specified VM and resume it.  This can only be called when
  65.829 + * the specified VM is in the Suspended state.
  65.830 + */
  65.831 +extern bool
  65.832 +xen_vm_resume(xen_session *session, xen_vm vm, bool start_paused);
  65.833 +
  65.834 +
  65.835 +/**
  65.836 + * Set this VM's VCPUs/at_startup value, and set the same value on the
  65.837 + * VM, if running
  65.838 + */
  65.839 +extern bool
  65.840 +xen_vm_set_vcpus_number_live(xen_session *session, xen_vm self, int64_t nvcpu);
  65.841 +
  65.842 +
  65.843 +/**
  65.844 + * Add the given key-value pair to VM.VCPUs_params, and apply that
  65.845 + * value on the running VM.
  65.846 + */
  65.847 +extern bool
  65.848 +xen_vm_add_to_vcpus_params_live(xen_session *session, xen_vm self, char *key, char *value);
  65.849 +
  65.850 +
  65.851 +/**
  65.852 + * Set memory_dynamic_max in database and on running VM.
  65.853 + */
  65.854 +extern bool
  65.855 +xen_vm_set_memory_dynamic_max_live(xen_session *session, xen_vm self, int64_t max);
  65.856 +
  65.857 +
  65.858 +/**
  65.859 + * Set memory_dynamic_min in database and on running VM.
  65.860 + */
  65.861 +extern bool
  65.862 +xen_vm_set_memory_dynamic_min_live(xen_session *session, xen_vm self, int64_t min);
  65.863 +
  65.864 +
  65.865 +/**
  65.866 + * Send the given key as a sysrq to this VM.  The key is specified as a
  65.867 + * single character (a String of length 1).  This can only be called when the
  65.868 + * specified VM is in the Running state.
  65.869 + */
  65.870 +extern bool
  65.871 +xen_vm_send_sysrq(xen_session *session, xen_vm vm, char *key);
  65.872 +
  65.873 +
  65.874 +/**
  65.875 + * Send the named trigger to this VM.  This can only be called when the
  65.876 + * specified VM is in the Running state.
  65.877 + */
  65.878 +extern bool
  65.879 +xen_vm_send_trigger(xen_session *session, xen_vm vm, char *trigger);
  65.880 +
  65.881 +
  65.882 +/**
  65.883 + * Migrate the VM to another host.  This can only be called when the
  65.884 + * specified VM is in the Running state.
  65.885 + */
  65.886 +extern bool
  65.887 +xen_vm_migrate(xen_session *session, xen_vm vm, char *dest, bool live, xen_string_string_map *options);
  65.888 +
  65.889 +
  65.890 +/**
  65.891 + * Return a list of all the VMs known to the system.
  65.892 + */
  65.893 +extern bool
  65.894 +xen_vm_get_all(xen_session *session, struct xen_vm_set **result);
  65.895 +
  65.896 +
  65.897 +#endif
    66.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    66.2 +++ b/tools/libxen/include/xen/api/xen_vm_decl.h	Tue Apr 24 21:39:23 2007 +0100
    66.3 @@ -0,0 +1,30 @@
    66.4 +/*
    66.5 + * Copyright (c) 2006-2007, XenSource Inc.
    66.6 + *
    66.7 + * This library is free software; you can redistribute it and/or
    66.8 + * modify it under the terms of the GNU Lesser General Public
    66.9 + * License as published by the Free Software Foundation; either
   66.10 + * version 2.1 of the License, or (at your option) any later version.
   66.11 + *
   66.12 + * This library is distributed in the hope that it will be useful,
   66.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   66.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   66.15 + * Lesser General Public License for more details.
   66.16 + *
   66.17 + * You should have received a copy of the GNU Lesser General Public
   66.18 + * License along with this library; if not, write to the Free Software
   66.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   66.20 + */
   66.21 +
   66.22 +#ifndef XEN_VM_DECL_H
   66.23 +#define XEN_VM_DECL_H
   66.24 +
   66.25 +typedef void *xen_vm;
   66.26 +
   66.27 +struct xen_vm_set;
   66.28 +struct xen_vm_record;
   66.29 +struct xen_vm_record_set;
   66.30 +struct xen_vm_record_opt;
   66.31 +struct xen_vm_record_opt_set;
   66.32 +
   66.33 +#endif
    67.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.2 +++ b/tools/libxen/include/xen/api/xen_vm_guest_metrics.h	Tue Apr 24 21:39:23 2007 +0100
    67.3 @@ -0,0 +1,234 @@
    67.4 +/*
    67.5 + * Copyright (c) 2006-2007, XenSource Inc.
    67.6 + *
    67.7 + * This library is free software; you can redistribute it and/or
    67.8 + * modify it under the terms of the GNU Lesser General Public
    67.9 + * License as published by the Free Software Foundation; either
   67.10 + * version 2.1 of the License, or (at your option) any later version.
   67.11 + *
   67.12 + * This library is distributed in the hope that it will be useful,
   67.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   67.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   67.15 + * Lesser General Public License for more details.
   67.16 + *
   67.17 + * You should have received a copy of the GNU Lesser General Public
   67.18 + * License along with this library; if not, write to the Free Software
   67.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   67.20 + */
   67.21 +
   67.22 +#ifndef XEN_VM_GUEST_METRICS_H
   67.23 +#define XEN_VM_GUEST_METRICS_H
   67.24 +
   67.25 +#include <xen/api/xen_common.h>
   67.26 +#include <xen/api/xen_string_string_map.h>
   67.27 +#include <xen/api/xen_vm_guest_metrics_decl.h>
   67.28 +
   67.29 +
   67.30 +/*
   67.31 + * The VM_guest_metrics class.
   67.32 + * 
   67.33 + * The metrics reported by the guest (as opposed to inferred from outside).
   67.34 + */
   67.35 +
   67.36 +
   67.37 +/**
   67.38 + * Free the given xen_vm_guest_metrics.  The given handle must have
   67.39 + * been allocated by this library.
   67.40 + */
   67.41 +extern void
   67.42 +xen_vm_guest_metrics_free(xen_vm_guest_metrics vm_guest_metrics);
   67.43 +
   67.44 +
   67.45 +typedef struct xen_vm_guest_metrics_set
   67.46 +{
   67.47 +    size_t size;
   67.48 +    xen_vm_guest_metrics *contents[];
   67.49 +} xen_vm_guest_metrics_set;
   67.50 +
   67.51 +/**
   67.52 + * Allocate a xen_vm_guest_metrics_set of the given size.
   67.53 + */
   67.54 +extern xen_vm_guest_metrics_set *
   67.55 +xen_vm_guest_metrics_set_alloc(size_t size);
   67.56 +
   67.57 +/**
   67.58 + * Free the given xen_vm_guest_metrics_set.  The given set must have
   67.59 + * been allocated by this library.
   67.60 + */
   67.61 +extern void
   67.62 +xen_vm_guest_metrics_set_free(xen_vm_guest_metrics_set *set);
   67.63 +
   67.64 +
   67.65 +typedef struct xen_vm_guest_metrics_record
   67.66 +{
   67.67 +    xen_vm_guest_metrics handle;
   67.68 +    char *uuid;
   67.69 +    xen_string_string_map *os_version;
   67.70 +    xen_string_string_map *pv_drivers_version;
   67.71 +    xen_string_string_map *memory;
   67.72 +    xen_string_string_map *disks;
   67.73 +    xen_string_string_map *networks;
   67.74 +    xen_string_string_map *other;
   67.75 +    time_t last_updated;
   67.76 +} xen_vm_guest_metrics_record;
   67.77 +
   67.78 +/**
   67.79 + * Allocate a xen_vm_guest_metrics_record.
   67.80 + */
   67.81 +extern xen_vm_guest_metrics_record *
   67.82 +xen_vm_guest_metrics_record_alloc(void);
   67.83 +
   67.84 +/**
   67.85 + * Free the given xen_vm_guest_metrics_record, and all referenced
   67.86 + * values.  The given record must have been allocated by this library.
   67.87 + */
   67.88 +extern void
   67.89 +xen_vm_guest_metrics_record_free(xen_vm_guest_metrics_record *record);
   67.90 +
   67.91 +
   67.92 +typedef struct xen_vm_guest_metrics_record_opt
   67.93 +{
   67.94 +    bool is_record;
   67.95 +    union
   67.96 +    {
   67.97 +        xen_vm_guest_metrics handle;
   67.98 +        xen_vm_guest_metrics_record *record;
   67.99 +    } u;
  67.100 +} xen_vm_guest_metrics_record_opt;
  67.101 +
  67.102 +/**
  67.103 + * Allocate a xen_vm_guest_metrics_record_opt.
  67.104 + */
  67.105 +extern xen_vm_guest_metrics_record_opt *
  67.106 +xen_vm_guest_metrics_record_opt_alloc(void);
  67.107 +
  67.108 +/**
  67.109 + * Free the given xen_vm_guest_metrics_record_opt, and all referenced
  67.110 + * values.  The given record_opt must have been allocated by this library.
  67.111 + */
  67.112 +extern void
  67.113 +xen_vm_guest_metrics_record_opt_free(xen_vm_guest_metrics_record_opt *record_opt);
  67.114 +
  67.115 +
  67.116 +typedef struct xen_vm_guest_metrics_record_set
  67.117 +{
  67.118 +    size_t size;
  67.119 +    xen_vm_guest_metrics_record *contents[];
  67.120 +} xen_vm_guest_metrics_record_set;
  67.121 +
  67.122 +/**
  67.123 + * Allocate a xen_vm_guest_metrics_record_set of the given size.
  67.124 + */
  67.125 +extern xen_vm_guest_metrics_record_set *
  67.126 +xen_vm_guest_metrics_record_set_alloc(size_t size);
  67.127 +
  67.128 +/**
  67.129 + * Free the given xen_vm_guest_metrics_record_set, and all referenced
  67.130 + * values.  The given set must have been allocated by this library.
  67.131 + */
  67.132 +extern void
  67.133 +xen_vm_guest_metrics_record_set_free(xen_vm_guest_metrics_record_set *set);
  67.134 +
  67.135 +
  67.136 +
  67.137 +typedef struct xen_vm_guest_metrics_record_opt_set
  67.138 +{
  67.139 +    size_t size;
  67.140 +    xen_vm_guest_metrics_record_opt *contents[];
  67.141 +} xen_vm_guest_metrics_record_opt_set;
  67.142 +
  67.143 +/**
  67.144 + * Allocate a xen_vm_guest_metrics_record_opt_set of the given size.
  67.145 + */
  67.146 +extern xen_vm_guest_metrics_record_opt_set *
  67.147 +xen_vm_guest_metrics_record_opt_set_alloc(size_t size);
  67.148 +
  67.149 +/**
  67.150 + * Free the given xen_vm_guest_metrics_record_opt_set, and all
  67.151 + * referenced values.  The given set must have been allocated by this library.
  67.152 + */
  67.153 +extern void
  67.154 +xen_vm_guest_metrics_record_opt_set_free(xen_vm_guest_metrics_record_opt_set *set);
  67.155 +
  67.156 +
  67.157 +/**
  67.158 + * Get a record containing the current state of the given
  67.159 + * VM_guest_metrics.
  67.160 + */
  67.161 +extern bool
  67.162 +xen_vm_guest_metrics_get_record(xen_session *session, xen_vm_guest_metrics_record **result, xen_vm_guest_metrics vm_guest_metrics);
  67.163 +
  67.164 +
  67.165 +/**
  67.166 + * Get a reference to the VM_guest_metrics instance with the specified
  67.167 + * UUID.
  67.168 + */
  67.169 +extern bool
  67.170 +xen_vm_guest_metrics_get_by_uuid(xen_session *session, xen_vm_guest_metrics *result, char *uuid);
  67.171 +
  67.172 +
  67.173 +/**
  67.174 + * Get the uuid field of the given VM_guest_metrics.
  67.175 + */
  67.176 +extern bool
  67.177 +xen_vm_guest_metrics_get_uuid(xen_session *session, char **result, xen_vm_guest_metrics vm_guest_metrics);
  67.178 +
  67.179 +
  67.180 +/**
  67.181 + * Get the os_version field of the given VM_guest_metrics.
  67.182 + */
  67.183 +extern bool
  67.184 +xen_vm_guest_metrics_get_os_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  67.185 +
  67.186 +
  67.187 +/**
  67.188 + * Get the PV_drivers_version field of the given VM_guest_metrics.
  67.189 + */
  67.190 +extern bool
  67.191 +xen_vm_guest_metrics_get_pv_drivers_version(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  67.192 +
  67.193 +
  67.194 +/**
  67.195 + * Get the memory field of the given VM_guest_metrics.
  67.196 + */
  67.197 +extern bool
  67.198 +xen_vm_guest_metrics_get_memory(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  67.199 +
  67.200 +
  67.201 +/**
  67.202 + * Get the disks field of the given VM_guest_metrics.
  67.203 + */
  67.204 +extern bool
  67.205 +xen_vm_guest_metrics_get_disks(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  67.206 +
  67.207 +
  67.208 +/**
  67.209 + * Get the networks field of the given VM_guest_metrics.
  67.210 + */
  67.211 +extern bool
  67.212 +xen_vm_guest_metrics_get_networks(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  67.213 +
  67.214 +
  67.215 +/**
  67.216 + * Get the other field of the given VM_guest_metrics.
  67.217 + */
  67.218 +extern bool
  67.219 +xen_vm_guest_metrics_get_other(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics);
  67.220 +
  67.221 +
  67.222 +/**
  67.223 + * Get the last_updated field of the given VM_guest_metrics.
  67.224 + */
  67.225 +extern bool
  67.226 +xen_vm_guest_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_guest_metrics vm_guest_metrics);
  67.227 +
  67.228 +
  67.229 +/**
  67.230 + * Return a list of all the VM_guest_metrics instances known to the
  67.231 + * system.
  67.232 + */
  67.233 +extern bool
  67.234 +xen_vm_guest_metrics_get_all(xen_session *session, struct xen_vm_guest_metrics_set **result);
  67.235 +
  67.236 +
  67.237 +#endif
    68.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.2 +++ b/tools/libxen/include/xen/api/xen_vm_guest_metrics_decl.h	Tue Apr 24 21:39:23 2007 +0100
    68.3 @@ -0,0 +1,30 @@
    68.4 +/*
    68.5 + * Copyright (c) 2006-2007, XenSource Inc.
    68.6 + *
    68.7 + * This library is free software; you can redistribute it and/or
    68.8 + * modify it under the terms of the GNU Lesser General Public
    68.9 + * License as published by the Free Software Foundation; either
   68.10 + * version 2.1 of the License, or (at your option) any later version.
   68.11 + *
   68.12 + * This library is distributed in the hope that it will be useful,
   68.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   68.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   68.15 + * Lesser General Public License for more details.
   68.16 + *
   68.17 + * You should have received a copy of the GNU Lesser General Public
   68.18 + * License along with this library; if not, write to the Free Software
   68.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   68.20 + */
   68.21 +
   68.22 +#ifndef XEN_VM_GUEST_METRICS_DECL_H
   68.23 +#define XEN_VM_GUEST_METRICS_DECL_H
   68.24 +
   68.25 +typedef void *xen_vm_guest_metrics;
   68.26 +
   68.27 +struct xen_vm_guest_metrics_set;
   68.28 +struct xen_vm_guest_metrics_record;
   68.29 +struct xen_vm_guest_metrics_record_set;
   68.30 +struct xen_vm_guest_metrics_record_opt;
   68.31 +struct xen_vm_guest_metrics_record_opt_set;
   68.32 +
   68.33 +#endif
    69.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.2 +++ b/tools/libxen/include/xen/api/xen_vm_metrics.h	Tue Apr 24 21:39:23 2007 +0100
    69.3 @@ -0,0 +1,251 @@
    69.4 +/*
    69.5 + * Copyright (c) 2006-2007, XenSource Inc.
    69.6 + *
    69.7 + * This library is free software; you can redistribute it and/or
    69.8 + * modify it under the terms of the GNU Lesser General Public
    69.9 + * License as published by the Free Software Foundation; either
   69.10 + * version 2.1 of the License, or (at your option) any later version.
   69.11 + *
   69.12 + * This library is distributed in the hope that it will be useful,
   69.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   69.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   69.15 + * Lesser General Public License for more details.
   69.16 + *
   69.17 + * You should have received a copy of the GNU Lesser General Public
   69.18 + * License along with this library; if not, write to the Free Software
   69.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   69.20 + */
   69.21 +
   69.22 +#ifndef XEN_VM_METRICS_H
   69.23 +#define XEN_VM_METRICS_H
   69.24 +
   69.25 +#include <xen/api/xen_common.h>
   69.26 +#include <xen/api/xen_int_float_map.h>
   69.27 +#include <xen/api/xen_int_int_map.h>
   69.28 +#include <xen/api/xen_int_string_set_map.h>
   69.29 +#include <xen/api/xen_string_set.h>
   69.30 +#include <xen/api/xen_string_string_map.h>
   69.31 +#include <xen/api/xen_vm_metrics_decl.h>
   69.32 +
   69.33 +
   69.34 +/*
   69.35 + * The VM_metrics class.
   69.36 + * 
   69.37 + * The metrics associated with a VM.
   69.38 + */
   69.39 +
   69.40 +
   69.41 +/**
   69.42 + * Free the given xen_vm_metrics.  The given handle must have been
   69.43 + * allocated by this library.
   69.44 + */
   69.45 +extern void
   69.46 +xen_vm_metrics_free(xen_vm_metrics vm_metrics);
   69.47 +
   69.48 +
   69.49 +typedef struct xen_vm_metrics_set
   69.50 +{
   69.51 +    size_t size;
   69.52 +    xen_vm_metrics *contents[];
   69.53 +} xen_vm_metrics_set;
   69.54 +
   69.55 +/**
   69.56 + * Allocate a xen_vm_metrics_set of the given size.
   69.57 + */
   69.58 +extern xen_vm_metrics_set *
   69.59 +xen_vm_metrics_set_alloc(size_t size);
   69.60 +
   69.61 +/**
   69.62 + * Free the given xen_vm_metrics_set.  The given set must have been
   69.63 + * allocated by this library.
   69.64 + */
   69.65 +extern void
   69.66 +xen_vm_metrics_set_free(xen_vm_metrics_set *set);
   69.67 +
   69.68 +
   69.69 +typedef struct xen_vm_metrics_record
   69.70 +{
   69.71 +    xen_vm_metrics handle;
   69.72 +    char *uuid;
   69.73 +    int64_t memory_actual;
   69.74 +    int64_t vcpus_number;
   69.75 +    xen_int_float_map *vcpus_utilisation;
   69.76 +    xen_int_int_map *vcpus_cpu;
   69.77 +    xen_string_string_map *vcpus_params;
   69.78 +    xen_int_string_set_map *vcpus_flags;
   69.79 +    struct xen_string_set *state;
   69.80 +    time_t start_time;
   69.81 +    time_t last_updated;
   69.82 +} xen_vm_metrics_record;
   69.83 +
   69.84 +/**
   69.85 + * Allocate a xen_vm_metrics_record.
   69.86 + */
   69.87 +extern xen_vm_metrics_record *
   69.88 +xen_vm_metrics_record_alloc(void);
   69.89 +
   69.90 +/**
   69.91 + * Free the given xen_vm_metrics_record, and all referenced values. 
   69.92 + * The given record must have been allocated by this library.
   69.93 + */
   69.94 +extern void
   69.95 +xen_vm_metrics_record_free(xen_vm_metrics_record *record);
   69.96 +
   69.97 +
   69.98 +typedef struct xen_vm_metrics_record_opt
   69.99 +{
  69.100 +    bool is_record;
  69.101 +    union
  69.102 +    {
  69.103 +        xen_vm_metrics handle;
  69.104 +        xen_vm_metrics_record *record;
  69.105 +    } u;
  69.106 +} xen_vm_metrics_record_opt;
  69.107 +
  69.108 +/**
  69.109 + * Allocate a xen_vm_metrics_record_opt.
  69.110 + */
  69.111 +extern xen_vm_metrics_record_opt *
  69.112 +xen_vm_metrics_record_opt_alloc(void);
  69.113 +
  69.114 +/**
  69.115 + * Free the given xen_vm_metrics_record_opt, and all referenced values.
  69.116 + *  The given record_opt must have been allocated by this library.
  69.117 + */
  69.118 +extern void
  69.119 +xen_vm_metrics_record_opt_free(xen_vm_metrics_record_opt *record_opt);
  69.120 +
  69.121 +
  69.122 +typedef struct xen_vm_metrics_record_set
  69.123 +{
  69.124 +    size_t size;
  69.125 +    xen_vm_metrics_record *contents[];
  69.126 +} xen_vm_metrics_record_set;
  69.127 +
  69.128 +/**
  69.129 + * Allocate a xen_vm_metrics_record_set of the given size.
  69.130 + */
  69.131 +extern xen_vm_metrics_record_set *
  69.132 +xen_vm_metrics_record_set_alloc(size_t size);
  69.133 +
  69.134 +/**
  69.135 + * Free the given xen_vm_metrics_record_set, and all referenced values.
  69.136 + *  The given set must have been allocated by this library.
  69.137 + */
  69.138 +extern void
  69.139 +xen_vm_metrics_record_set_free(xen_vm_metrics_record_set *set);
  69.140 +
  69.141 +
  69.142 +
  69.143 +typedef struct xen_vm_metrics_record_opt_set
  69.144 +{
  69.145 +    size_t size;
  69.146 +    xen_vm_metrics_record_opt *contents[];
  69.147 +} xen_vm_metrics_record_opt_set;
  69.148 +
  69.149 +/**
  69.150 + * Allocate a xen_vm_metrics_record_opt_set of the given size.
  69.151 + */
  69.152 +extern xen_vm_metrics_record_opt_set *
  69.153 +xen_vm_metrics_record_opt_set_alloc(size_t size);
  69.154 +
  69.155 +/**
  69.156 + * Free the given xen_vm_metrics_record_opt_set, and all referenced
  69.157 + * values.  The given set must have been allocated by this library.
  69.158 + */
  69.159 +extern void
  69.160 +xen_vm_metrics_record_opt_set_free(xen_vm_metrics_record_opt_set *set);
  69.161 +
  69.162 +
  69.163 +/**
  69.164 + * Get a record containing the current state of the given VM_metrics.
  69.165 + */
  69.166 +extern bool
  69.167 +xen_vm_metrics_get_record(xen_session *session, xen_vm_metrics_record **result, xen_vm_metrics vm_metrics);
  69.168 +
  69.169 +
  69.170 +/**
  69.171 + * Get a reference to the VM_metrics instance with the specified UUID.
  69.172 + */
  69.173 +extern bool
  69.174 +xen_vm_metrics_get_by_uuid(xen_session *session, xen_vm_metrics *result, char *uuid);
  69.175 +
  69.176 +
  69.177 +/**
  69.178 + * Get the uuid field of the given VM_metrics.
  69.179 + */
  69.180 +extern bool
  69.181 +xen_vm_metrics_get_uuid(xen_session *session, char **result, xen_vm_metrics vm_metrics);
  69.182 +
  69.183 +
  69.184 +/**
  69.185 + * Get the memory/actual field of the given VM_metrics.
  69.186 + */
  69.187 +extern bool
  69.188 +xen_vm_metrics_get_memory_actual(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
  69.189 +
  69.190 +
  69.191 +/**
  69.192 + * Get the VCPUs/number field of the given VM_metrics.
  69.193 + */
  69.194 +extern bool
  69.195 +xen_vm_metrics_get_vcpus_number(xen_session *session, int64_t *result, xen_vm_metrics vm_metrics);
  69.196 +
  69.197 +
  69.198 +/**
  69.199 + * Get the VCPUs/utilisation field of the given VM_metrics.
  69.200 + */
  69.201 +extern bool
  69.202 +xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm_metrics vm_metrics);
  69.203 +
  69.204 +
  69.205 +/**
  69.206 + * Get the VCPUs/CPU field of the given VM_metrics.
  69.207 + */
  69.208 +extern bool
  69.209 +xen_vm_metrics_get_vcpus_cpu(xen_session *session, xen_int_int_map **result, xen_vm_metrics vm_metrics);
  69.210 +
  69.211 +
  69.212 +/**
  69.213 + * Get the VCPUs/params field of the given VM_metrics.
  69.214 + */
  69.215 +extern bool
  69.216 +xen_vm_metrics_get_vcpus_params(xen_session *session, xen_string_string_map **result, xen_vm_metrics vm_metrics);
  69.217 +
  69.218 +
  69.219 +/**
  69.220 + * Get the VCPUs/flags field of the given VM_metrics.
  69.221 + */
  69.222 +extern bool
  69.223 +xen_vm_metrics_get_vcpus_flags(xen_session *session, xen_int_string_set_map **result, xen_vm_metrics vm_metrics);
  69.224 +
  69.225 +
  69.226 +/**
  69.227 + * Get the state field of the given VM_metrics.
  69.228 + */
  69.229 +extern bool
  69.230 +xen_vm_metrics_get_state(xen_session *session, struct xen_string_set **result, xen_vm_metrics vm_metrics);
  69.231 +
  69.232 +
  69.233 +/**
  69.234 + * Get the start_time field of the given VM_metrics.
  69.235 + */
  69.236 +extern bool
  69.237 +xen_vm_metrics_get_start_time(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
  69.238 +
  69.239 +
  69.240 +/**
  69.241 + * Get the last_updated field of the given VM_metrics.
  69.242 + */
  69.243 +extern bool
  69.244 +xen_vm_metrics_get_last_updated(xen_session *session, time_t *result, xen_vm_metrics vm_metrics);
  69.245 +
  69.246 +
  69.247 +/**
  69.248 + * Return a list of all the VM_metrics instances known to the system.
  69.249 + */
  69.250 +extern bool
  69.251 +xen_vm_metrics_get_all(xen_session *session, struct xen_vm_metrics_set **result);
  69.252 +
  69.253 +
  69.254 +#endif
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/tools/libxen/include/xen/api/xen_vm_metrics_decl.h	Tue Apr 24 21:39:23 2007 +0100
    70.3 @@ -0,0 +1,30 @@
    70.4 +/*
    70.5 + * Copyright (c) 2006-2007, XenSource Inc.
    70.6 + *
    70.7 + * This library is free software; you can redistribute it and/or
    70.8 + * modify it under the terms of the GNU Lesser General Public
    70.9 + * License as published by the Free Software Foundation; either
   70.10 + * version 2.1 of the License, or (at your option) any later version.
   70.11 + *
   70.12 + * This library is distributed in the hope that it will be useful,
   70.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   70.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   70.15 + * Lesser General Public License for more details.
   70.16 + *
   70.17 + * You should have received a copy of the GNU Lesser General Public
   70.18 + * License along with this library; if not, write to the Free Software
   70.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   70.20 + */
   70.21 +
   70.22 +#ifndef XEN_VM_METRICS_DECL_H
   70.23 +#define XEN_VM_METRICS_DECL_H
   70.24 +
   70.25 +typedef void *xen_vm_metrics;
   70.26 +
   70.27 +struct xen_vm_metrics_set;
   70.28 +struct xen_vm_metrics_record;
   70.29 +struct xen_vm_metrics_record_set;
   70.30 +struct xen_vm_metrics_record_opt;
   70.31 +struct xen_vm_metrics_record_opt_set;
   70.32 +
   70.33 +#endif
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/tools/libxen/include/xen/api/xen_vm_power_state.h	Tue Apr 24 21:39:23 2007 +0100
    71.3 @@ -0,0 +1,92 @@
    71.4 +/*
    71.5 + * Copyright (c) 2006-2007, XenSource Inc.
    71.6 + *
    71.7 + * This library is free software; you can redistribute it and/or
    71.8 + * modify it under the terms of the GNU Lesser General Public
    71.9 + * License as published by the Free Software Foundation; either
   71.10 + * version 2.1 of the License, or (at your option) any later version.
   71.11 + *
   71.12 + * This library is distributed in the hope that it will be useful,
   71.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   71.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   71.15 + * Lesser General Public License for more details.
   71.16 + *
   71.17 + * You should have received a copy of the GNU Lesser General Public
   71.18 + * License along with this library; if not, write to the Free Software
   71.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   71.20 + */
   71.21 +
   71.22 +#ifndef XEN_VM_POWER_STATE_H
   71.23 +#define XEN_VM_POWER_STATE_H
   71.24 +
   71.25 +
   71.26 +#include <xen/api/xen_common.h>
   71.27 +
   71.28 +
   71.29 +enum xen_vm_power_state
   71.30 +{
   71.31 +    /**
   71.32 +     * Halted
   71.33 +     */
   71.34 +    XEN_VM_POWER_STATE_HALTED,
   71.35 +
   71.36 +    /**
   71.37 +     * Paused
   71.38 +     */
   71.39 +    XEN_VM_POWER_STATE_PAUSED,
   71.40 +
   71.41 +    /**
   71.42 +     * Running
   71.43 +     */
   71.44 +    XEN_VM_POWER_STATE_RUNNING,
   71.45 +
   71.46 +    /**
   71.47 +     * Suspended
   71.48 +     */
   71.49 +    XEN_VM_POWER_STATE_SUSPENDED,
   71.50 +
   71.51 +    /**
   71.52 +     * Some other unknown state
   71.53 +     */
   71.54 +    XEN_VM_POWER_STATE_UNKNOWN
   71.55 +};
   71.56 +
   71.57 +
   71.58 +typedef struct xen_vm_power_state_set
   71.59 +{
   71.60 +    size_t size;
   71.61 +    enum xen_vm_power_state contents[];
   71.62 +} xen_vm_power_state_set;
   71.63 +
   71.64 +/**
   71.65 + * Allocate a xen_vm_power_state_set of the given size.
   71.66 + */
   71.67 +extern xen_vm_power_state_set *
   71.68 +xen_vm_power_state_set_alloc(size_t size);
   71.69 +
   71.70 +/**
   71.71 + * Free the given xen_vm_power_state_set.  The given set must have been
   71.72 + * allocated by this library.
   71.73 + */
   71.74 +extern void
   71.75 +xen_vm_power_state_set_free(xen_vm_power_state_set *set);
   71.76 +
   71.77 +
   71.78 +/**
   71.79 + * Return the name corresponding to the given code.  This string must
   71.80 + * not be modified or freed.
   71.81 + */
   71.82 +extern const char *
   71.83 +xen_vm_power_state_to_string(enum xen_vm_power_state val);
   71.84 +
   71.85 +
   71.86 +/**
   71.87 + * Return the correct code for the given string, or set the session
   71.88 + * object to failure and return an undefined value if the given string does
   71.89 + * not match a known code.
   71.90 + */
   71.91 +extern enum xen_vm_power_state
   71.92 +xen_vm_power_state_from_string(xen_session *session, const char *str);
   71.93 +
   71.94 +
   71.95 +#endif
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/tools/libxen/include/xen/api/xen_vtpm.h	Tue Apr 24 21:39:23 2007 +0100
    72.3 @@ -0,0 +1,199 @@
    72.4 +/*
    72.5 + * Copyright (c) 2006-2007, XenSource Inc.
    72.6 + * Copyright (c) 2006, IBM Corp.
    72.7 + *
    72.8 + * This library is free software; you can redistribute it and/or
    72.9 + * modify it under the terms of the GNU Lesser General Public
   72.10 + * License as published by the Free Software Foundation; either
   72.11 + * version 2.1 of the License, or (at your option) any later version.
   72.12 + *
   72.13 + * This library is distributed in the hope that it will be useful,
   72.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   72.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   72.16 + * Lesser General Public License for more details.
   72.17 + *
   72.18 + * You should have received a copy of the GNU Lesser General Public
   72.19 + * License along with this library; if not, write to the Free Software
   72.20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   72.21 + */
   72.22 +
   72.23 +#ifndef XEN_VTPM_H
   72.24 +#define XEN_VTPM_H
   72.25 +
   72.26 +#include <xen/api/xen_common.h>
   72.27 +#include <xen/api/xen_vm_decl.h>
   72.28 +#include <xen/api/xen_vtpm_decl.h>
   72.29 +
   72.30 +
   72.31 +/*
   72.32 + * The VTPM class.
   72.33 + * 
   72.34 + * A virtual TPM device.
   72.35 + */
   72.36 +
   72.37 +
   72.38 +/**
   72.39 + * Free the given xen_vtpm.  The given handle must have been allocated
   72.40 + * by this library.
   72.41 + */
   72.42 +extern void
   72.43 +xen_vtpm_free(xen_vtpm vtpm);
   72.44 +
   72.45 +
   72.46 +typedef struct xen_vtpm_set
   72.47 +{
   72.48 +    size_t size;
   72.49 +    xen_vtpm *contents[];
   72.50 +} xen_vtpm_set;
   72.51 +
   72.52 +/**
   72.53 + * Allocate a xen_vtpm_set of the given size.
   72.54 + */
   72.55 +extern xen_vtpm_set *
   72.56 +xen_vtpm_set_alloc(size_t size);
   72.57 +
   72.58 +/**
   72.59 + * Free the given xen_vtpm_set.  The given set must have been allocated
   72.60 + * by this library.
   72.61 + */
   72.62 +extern void
   72.63 +xen_vtpm_set_free(xen_vtpm_set *set);
   72.64 +
   72.65 +
   72.66 +typedef struct xen_vtpm_record
   72.67 +{
   72.68 +    xen_vtpm handle;
   72.69 +    char *uuid;
   72.70 +    struct xen_vm_record_opt *vm;
   72.71 +    struct xen_vm_record_opt *backend;
   72.72 +} xen_vtpm_record;
   72.73 +
   72.74 +/**
   72.75 + * Allocate a xen_vtpm_record.
   72.76 + */
   72.77 +extern xen_vtpm_record *
   72.78 +xen_vtpm_record_alloc(void);
   72.79 +
   72.80 +/**
   72.81 + * Free the given xen_vtpm_record, and all referenced values.  The
   72.82 + * given record must have been allocated by this library.
   72.83 + */
   72.84 +extern void
   72.85 +xen_vtpm_record_free(xen_vtpm_record *record);
   72.86 +
   72.87 +
   72.88 +typedef struct xen_vtpm_record_opt
   72.89 +{
   72.90 +    bool is_record;
   72.91 +    union
   72.92 +    {
   72.93 +        xen_vtpm handle;
   72.94 +        xen_vtpm_record *record;
   72.95 +    } u;
   72.96 +} xen_vtpm_record_opt;
   72.97 +
   72.98 +/**
   72.99 + * Allocate a xen_vtpm_record_opt.
  72.100 + */
  72.101 +extern xen_vtpm_record_opt *
  72.102 +xen_vtpm_record_opt_alloc(void);
  72.103 +
  72.104 +/**
  72.105 + * Free the given xen_vtpm_record_opt, and all referenced values.  The
  72.106 + * given record_opt must have been allocated by this library.
  72.107 + */
  72.108 +extern void
  72.109 +xen_vtpm_record_opt_free(xen_vtpm_record_opt *record_opt);
  72.110 +
  72.111 +
  72.112 +typedef struct xen_vtpm_record_set
  72.113 +{
  72.114 +    size_t size;
  72.115 +    xen_vtpm_record *contents[];
  72.116 +} xen_vtpm_record_set;
  72.117 +
  72.118 +/**
  72.119 + * Allocate a xen_vtpm_record_set of the given size.
  72.120 + */
  72.121 +extern xen_vtpm_record_set *
  72.122 +xen_vtpm_record_set_alloc(size_t size);
  72.123 +
  72.124 +/**
  72.125 + * Free the given xen_vtpm_record_set, and all referenced values.  The
  72.126 + * given set must have been allocated by this library.
  72.127 + */
  72.128 +extern void
  72.129 +xen_vtpm_record_set_free(xen_vtpm_record_set *set);
  72.130 +
  72.131 +
  72.132 +
  72.133 +typedef struct xen_vtpm_record_opt_set
  72.134 +{
  72.135 +    size_t size;
  72.136 +    xen_vtpm_record_opt *contents[];
  72.137 +} xen_vtpm_record_opt_set;
  72.138 +
  72.139 +/**
  72.140 + * Allocate a xen_vtpm_record_opt_set of the given size.
  72.141 + */
  72.142 +extern xen_vtpm_record_opt_set *
  72.143 +xen_vtpm_record_opt_set_alloc(size_t size);
  72.144 +
  72.145 +/**
  72.146 + * Free the given xen_vtpm_record_opt_set, and all referenced values. 
  72.147 + * The given set must have been allocated by this library.
  72.148 + */
  72.149 +extern void
  72.150 +xen_vtpm_record_opt_set_free(xen_vtpm_record_opt_set *set);
  72.151 +
  72.152 +
  72.153 +/**
  72.154 + * Get a record containing the current state of the given VTPM.
  72.155 + */
  72.156 +extern bool
  72.157 +xen_vtpm_get_record(xen_session *session, xen_vtpm_record **result, xen_vtpm vtpm);
  72.158 +
  72.159 +
  72.160 +/**
  72.161 + * Get a reference to the VTPM instance with the specified UUID.
  72.162 + */
  72.163 +extern bool
  72.164 +xen_vtpm_get_by_uuid(xen_session *session, xen_vtpm *result, char *uuid);
  72.165 +
  72.166 +
  72.167 +/**
  72.168 + * Create a new VTPM instance, and return its handle.
  72.169 + */
  72.170 +extern bool
  72.171 +xen_vtpm_create(xen_session *session, xen_vtpm *result, xen_vtpm_record *record);
  72.172 +
  72.173 +
  72.174 +/**
  72.175 + * Destroy the specified VTPM instance.
  72.176 + */
  72.177 +extern bool
  72.178 +xen_vtpm_destroy(xen_session *session, xen_vtpm vtpm);
  72.179 +
  72.180 +
  72.181 +/**
  72.182 + * Get the uuid field of the given VTPM.
  72.183 + */
  72.184 +extern bool
  72.185 +xen_vtpm_get_uuid(xen_session *session, char **result, xen_vtpm vtpm);
  72.186 +
  72.187 +
  72.188 +/**
  72.189 + * Get the VM field of the given VTPM.
  72.190 + */
  72.191 +extern bool
  72.192 +xen_vtpm_get_vm(xen_session *session, xen_vm *result, xen_vtpm vtpm);
  72.193 +
  72.194 +
  72.195 +/**
  72.196 + * Get the backend field of the given VTPM.
  72.197 + */
  72.198 +extern bool
  72.199 +xen_vtpm_get_backend(xen_session *session, xen_vm *result, xen_vtpm vtpm);
  72.200 +
  72.201 +
  72.202 +#endif
    73.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.2 +++ b/tools/libxen/include/xen/api/xen_vtpm_decl.h	Tue Apr 24 21:39:23 2007 +0100
    73.3 @@ -0,0 +1,31 @@
    73.4 +/*
    73.5 + * Copyright (c) 2006, XenSource Inc.
    73.6 + * Copyright (c) 2006, IBM Corp.
    73.7 + *
    73.8 + * This library is free software; you can redistribute it and/or
    73.9 + * modify it under the terms of the GNU Lesser General Public
   73.10 + * License as published by the Free Software Foundation; either
   73.11 + * version 2.1 of the License, or (at your option) any later version.
   73.12 + *
   73.13 + * This library is distributed in the hope that it will be useful,
   73.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   73.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   73.16 + * Lesser General Public License for more details.
   73.17 + *
   73.18 + * You should have received a copy of the GNU Lesser General Public
   73.19 + * License along with this library; if not, write to the Free Software
   73.20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   73.21 + */
   73.22 +
   73.23 +#ifndef XEN_VTPM_DECL_H
   73.24 +#define XEN_VTPM_DECL_H
   73.25 +
   73.26 +typedef void *xen_vtpm;
   73.27 +
   73.28 +struct xen_vtpm_set;
   73.29 +struct xen_vtpm_record;
   73.30 +struct xen_vtpm_record_set;
   73.31 +struct xen_vtpm_record_opt;
   73.32 +struct xen_vtpm_record_opt_set;
   73.33 +
   73.34 +#endif
    74.1 --- a/tools/libxen/include/xen_common.h	Tue Apr 24 09:26:32 2007 -0600
    74.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    74.3 @@ -1,204 +0,0 @@
    74.4 -/*
    74.5 - * Copyright (c) 2006 XenSource, Inc.
    74.6 - *
    74.7 - * This library is free software; you can redistribute it and/or
    74.8 - * modify it under the terms of the GNU Lesser General Public
    74.9 - * License as published by the Free Software Foundation; either
   74.10 - * version 2.1 of the License, or (at your option) any later version.
   74.11 - *
   74.12 - * This library is distributed in the hope that it will be useful,
   74.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   74.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   74.15 - * Lesser General Public License for more details.
   74.16 - *
   74.17 - * You should have received a copy of the GNU Lesser General Public
   74.18 - * License along with this library; if not, write to the Free Software
   74.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   74.20 - */
   74.21 -
   74.22 -#ifndef XEN_COMMON_H
   74.23 -#define XEN_COMMON_H
   74.24 -
   74.25 -
   74.26 -#include <stdbool.h>
   74.27 -#include <stddef.h>
   74.28 -#include <stdint.h>
   74.29 -#include <time.h>
   74.30 -
   74.31 -#include "xen_host_decl.h"
   74.32 -
   74.33 -
   74.34 -typedef bool (*xen_result_func)(const void *data, size_t len,
   74.35 -                                void *result_handle);
   74.36 -
   74.37 -
   74.38 -/**
   74.39 - * len does not include a terminating \0.
   74.40 - */
   74.41 -typedef int (*xen_call_func)(const void *, size_t len, void *user_handle,
   74.42 -                             void *result_handle,
   74.43 -                             xen_result_func result_func);
   74.44 -
   74.45 -
   74.46 -typedef struct
   74.47 -{
   74.48 -    xen_call_func call_func;
   74.49 -    void *handle;
   74.50 -    const char *session_id;
   74.51 -    bool ok;
   74.52 -    char **error_description;
   74.53 -    int error_description_count;
   74.54 -} xen_session;
   74.55 -
   74.56 -
   74.57 -typedef struct xen_session_record
   74.58 -{
   74.59 -    char *uuid;
   74.60 -    struct xen_host_record_opt *this_host;
   74.61 -    char *this_user;
   74.62 -    time_t last_active;
   74.63 -} xen_session_record;
   74.64 -
   74.65 -
   74.66 -/**
   74.67 - * Allocate a xen_session_record.
   74.68 - */
   74.69 -extern xen_session_record *
   74.70 -xen_session_record_alloc(void);
   74.71 -
   74.72 -
   74.73 -/**
   74.74 - * Free the given xen_session_record, and all referenced values.  The
   74.75 - * given record must have been allocated by this library.
   74.76 - */
   74.77 -extern void
   74.78 -xen_session_record_free(xen_session_record *record);
   74.79 -
   74.80 -
   74.81 -struct xen_task_;
   74.82 -typedef struct xen_task_ * xen_task_id;
   74.83 -
   74.84 -
   74.85 -typedef struct
   74.86 -{
   74.87 -    int progress;
   74.88 -    long eta;
   74.89 -    /* !!! RESULT */
   74.90 -}  xen_task_status;
   74.91 -
   74.92 -
   74.93 -typedef struct
   74.94 -{
   74.95 -    int major;
   74.96 -    int minor;
   74.97 -    int patch;
   74.98 -    char *extraversion;
   74.99 -} xen_version;
  74.100 -
  74.101 -
  74.102 -/**
  74.103 - * Free the given xen_version, and all referenced values.
  74.104 - */
  74.105 -extern void xen_version_free(xen_version *version);
  74.106 -
  74.107 -
  74.108 -/**
  74.109 - * Return the version of this client-side library.  This will be the major,
  74.110 - * minor, and extraversion of the Xen release with which it was released,
  74.111 - * plus the library's own version as the patch.
  74.112 - */
  74.113 -extern xen_version *xen_get_client_side_version();
  74.114 -
  74.115 -
  74.116 -extern bool
  74.117 -xen_uuid_string_to_bytes(char *uuid, char **bytes);
  74.118 -
  74.119 -
  74.120 -extern bool
  74.121 -xen_uuid_bytes_to_string(char *bytes, char **uuid);
  74.122 -
  74.123 -
  74.124 -extern void
  74.125 -xen_uuid_free(char *uuid);
  74.126 -
  74.127 -
  74.128 -extern void
  74.129 -xen_uuid_bytes_free(char *bytes);
  74.130 -
  74.131 -
  74.132 -/**
  74.133 - * Initialise this library.  Call this before starting to use this library.
  74.134 - * Note that since this library depends upon libxml2, you should also call
  74.135 - * xmlInitParser as appropriate for your program.
  74.136 - */
  74.137 -extern
  74.138 -void xen_init(void);
  74.139 -
  74.140 -
  74.141 -/**
  74.142 - * Clear up this library.  Call when you have finished using this library.
  74.143 - * Note that since this library depends upon libxml2, you should also call
  74.144 - * xmlCleanupParser as appropriate for your program.
  74.145 - */
  74.146 -extern
  74.147 -void xen_fini(void);
  74.148 -
  74.149 -
  74.150 -/**
  74.151 - * Log in at the server, and allocate a xen_session to represent this session.
  74.152 - */
  74.153 -extern xen_session *
  74.154 -xen_session_login_with_password(xen_call_func call_func, void *handle,
  74.155 -                                const char *uname, const char *pwd);
  74.156 -
  74.157 -
  74.158 -/**
  74.159 - * Log out at the server, and free the xen_session.
  74.160 - */
  74.161 -extern void
  74.162 -xen_session_logout(xen_session *session);
  74.163 -
  74.164 -
  74.165 -/**
  74.166 - * Get the UUID of the second given session.  Set *result to point at a
  74.167 - * string, yours to free.
  74.168 - */
  74.169 -extern bool
  74.170 -xen_session_get_uuid(xen_session *session, char **result,
  74.171 -                     xen_session *self_session);
  74.172 -
  74.173 -
  74.174 -/**
  74.175 - * Get the this_host field of the second given session.  Set *result to be a
  74.176 - * handle to that host.
  74.177 - */
  74.178 -extern bool
  74.179 -xen_session_get_this_host(xen_session *session, xen_host *result,
  74.180 -                          xen_session *self_session);
  74.181 -
  74.182 -
  74.183 -/**
  74.184 - * Get the this_user field of the second given session.  Set *result to point
  74.185 - * at a string, yours to free.
  74.186 - */
  74.187 -extern bool
  74.188 -xen_session_get_this_user(xen_session *session, char **result,
  74.189 -                          xen_session *self_session);
  74.190 -
  74.191 -
  74.192 -/**
  74.193 - * Get the last_active field of the given session, and place it in *result.
  74.194 - */
  74.195 -extern bool
  74.196 -xen_session_get_last_active(xen_session *session, time_t *result,
  74.197 -                            xen_session *self_session);
  74.198 -
  74.199 -/**
  74.200 - * Get a record containing the current state of the second given session.
  74.201 - */
  74.202 -extern bool
  74.203 -xen_session_get_record(xen_session *session, xen_session_record **result,
  74.204 -                       xen_session *self_session);
  74.205 -
  74.206 -
  74.207 -#endif
    75.1 --- a/tools/libxen/include/xen_console.h	Tue Apr 24 09:26:32 2007 -0600
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,247 +0,0 @@
    75.4 -/*
    75.5 - * Copyright (c) 2006-2007, XenSource Inc.
    75.6 - *
    75.7 - * This library is free software; you can redistribute it and/or
    75.8 - * modify it under the terms of the GNU Lesser General Public
    75.9 - * License as published by the Free Software Foundation; either
   75.10 - * version 2.1 of the License, or (at your option) any later version.
   75.11 - *
   75.12 - * This library is distributed in the hope that it will be useful,
   75.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   75.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   75.15 - * Lesser General Public License for more details.
   75.16 - *
   75.17 - * You should have received a copy of the GNU Lesser General Public
   75.18 - * License along with this library; if not, write to the Free Software
   75.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   75.20 - */
   75.21 -
   75.22 -#ifndef XEN_CONSOLE_H
   75.23 -#define XEN_CONSOLE_H
   75.24 -
   75.25 -#include "xen_common.h"
   75.26 -#include "xen_console_decl.h"
   75.27 -#include "xen_console_protocol.h"
   75.28 -#include "xen_string_string_map.h"
   75.29 -#include "xen_vm_decl.h"
   75.30 -
   75.31 -
   75.32 -/*
   75.33 - * The console class.
   75.34 - * 
   75.35 - * A console.
   75.36 - */
   75.37 -
   75.38 -
   75.39 -/**
   75.40 - * Free the given xen_console.  The given handle must have been
   75.41 - * allocated by this library.
   75.42 - */
   75.43 -extern void
   75.44 -xen_console_free(xen_console console);
   75.45 -
   75.46 -
   75.47 -typedef struct xen_console_set
   75.48 -{
   75.49 -    size_t size;
   75.50 -    xen_console *contents[];
   75.51 -} xen_console_set;
   75.52 -
   75.53 -/**
   75.54 - * Allocate a xen_console_set of the given size.
   75.55 - */
   75.56 -extern xen_console_set *
   75.57 -xen_console_set_alloc(size_t size);
   75.58 -
   75.59 -/**
   75.60 - * Free the given xen_console_set.  The given set must have been
   75.61 - * allocated by this library.
   75.62 - */
   75.63 -extern void
   75.64 -xen_console_set_free(xen_console_set *set);
   75.65 -
   75.66 -
   75.67 -typedef struct xen_console_record
   75.68 -{
   75.69 -    xen_console handle;
   75.70 -    char *uuid;
   75.71 -    enum xen_console_protocol protocol;
   75.72 -    char *location;
   75.73 -    struct xen_vm_record_opt *vm;
   75.74 -    xen_string_string_map *other_config;
   75.75 -} xen_console_record;
   75.76 -
   75.77 -/**
   75.78 - * Allocate a xen_console_record.
   75.79 - */
   75.80 -extern xen_console_record *
   75.81 -xen_console_record_alloc(void);
   75.82 -
   75.83 -/**
   75.84 - * Free the given xen_console_record, and all referenced values.  The
   75.85 - * given record must have been allocated by this library.
   75.86 - */
   75.87 -extern void
   75.88 -xen_console_record_free(xen_console_record *record);
   75.89 -
   75.90 -
   75.91 -typedef struct xen_console_record_opt
   75.92 -{
   75.93 -    bool is_record;
   75.94 -    union
   75.95 -    {
   75.96 -        xen_console handle;
   75.97 -        xen_console_record *record;
   75.98 -    } u;
   75.99 -} xen_console_record_opt;
  75.100 -
  75.101 -/**
  75.102 - * Allocate a xen_console_record_opt.
  75.103 - */
  75.104 -extern xen_console_record_opt *
  75.105 -xen_console_record_opt_alloc(void);
  75.106 -
  75.107 -/**
  75.108 - * Free the given xen_console_record_opt, and all referenced values. 
  75.109 - * The given record_opt must have been allocated by this library.
  75.110 - */
  75.111 -extern void
  75.112 -xen_console_record_opt_free(xen_console_record_opt *record_opt);
  75.113 -
  75.114 -
  75.115 -typedef struct xen_console_record_set
  75.116 -{
  75.117 -    size_t size;
  75.118 -    xen_console_record *contents[];
  75.119 -} xen_console_record_set;
  75.120 -
  75.121 -/**
  75.122 - * Allocate a xen_console_record_set of the given size.
  75.123 - */
  75.124 -extern xen_console_record_set *
  75.125 -xen_console_record_set_alloc(size_t size);
  75.126 -
  75.127 -/**
  75.128 - * Free the given xen_console_record_set, and all referenced values. 
  75.129 - * The given set must have been allocated by this library.
  75.130 - */
  75.131 -extern void
  75.132 -xen_console_record_set_free(xen_console_record_set *set);
  75.133 -
  75.134 -
  75.135 -
  75.136 -typedef struct xen_console_record_opt_set
  75.137 -{
  75.138 -    size_t size;
  75.139 -    xen_console_record_opt *contents[];
  75.140 -} xen_console_record_opt_set;
  75.141 -
  75.142 -/**
  75.143 - * Allocate a xen_console_record_opt_set of the given size.
  75.144 - */
  75.145 -extern xen_console_record_opt_set *
  75.146 -xen_console_record_opt_set_alloc(size_t size);
  75.147 -
  75.148 -/**
  75.149 - * Free the given xen_console_record_opt_set, and all referenced
  75.150 - * values.  The given set must have been allocated by this library.
  75.151 - */
  75.152 -extern void
  75.153 -xen_console_record_opt_set_free(xen_console_record_opt_set *set);
  75.154 -
  75.155 -
  75.156 -/**
  75.157 - * Get a record containing the current state of the given console.
  75.158 - */
  75.159 -extern bool
  75.160 -xen_console_get_record(xen_session *session, xen_console_record **result, xen_console console);
  75.161 -
  75.162 -
  75.163 -/**
  75.164 - * Get a reference to the console instance with the specified UUID.
  75.165 - */
  75.166 -extern bool
  75.167 -xen_console_get_by_uuid(xen_session *session, xen_console *result, char *uuid);
  75.168 -
  75.169 -
  75.170 -/**
  75.171 - * Create a new console instance, and return its handle.
  75.172 - */
  75.173 -extern bool
  75.174 -xen_console_create(xen_session *session, xen_console *result, xen_console_record *record);
  75.175 -
  75.176 -
  75.177 -/**
  75.178 - * Destroy the specified console instance.
  75.179 - */
  75.180 -extern bool
  75.181 -xen_console_destroy(xen_session *session, xen_console console);
  75.182 -
  75.183 -
  75.184 -/**
  75.185 - * Get the uuid field of the given console.
  75.186 - */
  75.187 -extern bool
  75.188 -xen_console_get_uuid(xen_session *session, char **result, xen_console console);
  75.189 -
  75.190 -
  75.191 -/**
  75.192 - * Get the protocol field of the given console.
  75.193 - */
  75.194 -extern bool
  75.195 -xen_console_get_protocol(xen_session *session, enum xen_console_protocol *result, xen_console console);
  75.196 -
  75.197 -
  75.198 -/**
  75.199 - * Get the location field of the given console.
  75.200 - */
  75.201 -extern bool
  75.202 -xen_console_get_location(xen_session *session, char **result, xen_console console);
  75.203 -
  75.204 -
  75.205 -/**
  75.206 - * Get the VM field of the given console.
  75.207 - */
  75.208 -extern bool
  75.209 -xen_console_get_vm(xen_session *session, xen_vm *result, xen_console console);
  75.210 -
  75.211 -
  75.212 -/**
  75.213 - * Get the other_config field of the given console.
  75.214 - */
  75.215 -extern bool
  75.216 -xen_console_get_other_config(xen_session *session, xen_string_string_map **result, xen_console console);
  75.217 -
  75.218 -
  75.219 -/**
  75.220 - * Set the other_config field of the given console.
  75.221 - */
  75.222 -extern bool
  75.223 -xen_console_set_other_config(xen_session *session, xen_console console, xen_string_string_map *other_config);
  75.224 -
  75.225 -
  75.226 -/**
  75.227 - * Add the given key-value pair to the other_config field of the given
  75.228 - * console.
  75.229 - */
  75.230 -extern bool
  75.231 -xen_console_add_to_other_config(xen_session *session, xen_console console, char *key, char *value);
  75.232 -
  75.233 -
  75.234 -/**
  75.235 - * Remove the given key and its corresponding value from the
  75.236 - * other_config field of the given console.  If the key is not in that Map,
  75.237 - * then do nothing.
  75.238 - */
  75.239 -extern bool
  75.240 -xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key);
  75.241 -
  75.242 -
  75.243 -/**
  75.244 - * Return a list of all the consoles known to the system.
  75.245 - */
  75.246 -extern bool
  75.247 -xen_console_get_all(xen_session *session, struct xen_console_set **result);
  75.248 -
  75.249 -
  75.250 -#endif
    76.1 --- a/tools/libxen/include/xen_console_decl.h	Tue Apr 24 09:26:32 2007 -0600
    76.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.3 @@ -1,30 +0,0 @@
    76.4 -/*
    76.5 - * Copyright (c) 2006, XenSource Inc.
    76.6 - *
    76.7 - * This library is free software; you can redistribute it and/or
    76.8 - * modify it under the terms of the GNU Lesser General Public
    76.9 - * License as published by the Free Software Foundation; either
   76.10 - * version 2.1 of the License, or (at your option) any later version.
   76.11 - *
   76.12 - * This library is distributed in the hope that it will be useful,
   76.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   76.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   76.15 - * Lesser General Public License for more details.
   76.16 - *
   76.17 - * You should have received a copy of the GNU Lesser General Public
   76.18 - * License along with this library; if not, write to the Free Software
   76.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   76.20 - */
   76.21 -
   76.22 -#ifndef XEN_CONSOLE_DECL_H
   76.23 -#define XEN_CONSOLE_DECL_H
   76.24 -
   76.25 -typedef void *xen_console;
   76.26 -
   76.27 -struct xen_console_set;
   76.28 -struct xen_console_record;
   76.29 -struct xen_console_record_set;
   76.30 -struct xen_console_record_opt;
   76.31 -struct xen_console_record_opt_set;
   76.32 -
   76.33 -#endif
    77.1 --- a/tools/libxen/include/xen_console_protocol.h	Tue Apr 24 09:26:32 2007 -0600
    77.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.3 @@ -1,82 +0,0 @@
    77.4 -/*
    77.5 - * Copyright (c) 2006, XenSource Inc.
    77.6 - *
    77.7 - * This library is free software; you can redistribute it and/or
    77.8 - * modify it under the terms of the GNU Lesser General Public
    77.9 - * License as published by the Free Software Foundation; either
   77.10 - * version 2.1 of the License, or (at your option) any later version.
   77.11 - *
   77.12 - * This library is distributed in the hope that it will be useful,
   77.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   77.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   77.15 - * Lesser General Public License for more details.
   77.16 - *
   77.17 - * You should have received a copy of the GNU Lesser General Public
   77.18 - * License along with this library; if not, write to the Free Software
   77.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   77.20 - */
   77.21 -
   77.22 -#ifndef XEN_CONSOLE_PROTOCOL_H
   77.23 -#define XEN_CONSOLE_PROTOCOL_H
   77.24 -
   77.25 -
   77.26 -#include "xen_common.h"
   77.27 -
   77.28 -
   77.29 -enum xen_console_protocol
   77.30 -{
   77.31 -    /**
   77.32 -     * VT100 terminal
   77.33 -     */
   77.34 -    XEN_CONSOLE_PROTOCOL_VT100,
   77.35 -
   77.36 -    /**
   77.37 -     * Remote FrameBuffer protocol (as used in VNC)
   77.38 -     */
   77.39 -    XEN_CONSOLE_PROTOCOL_RFB,
   77.40 -
   77.41 -    /**
   77.42 -     * Remote Desktop Protocol
   77.43 -     */
   77.44 -    XEN_CONSOLE_PROTOCOL_RDP
   77.45 -};
   77.46 -
   77.47 -
   77.48 -typedef struct xen_console_protocol_set
   77.49 -{
   77.50 -    size_t size;
   77.51 -    enum xen_console_protocol contents[];
   77.52 -} xen_console_protocol_set;
   77.53 -
   77.54 -/**
   77.55 - * Allocate a xen_console_protocol_set of the given size.
   77.56 - */
   77.57 -extern xen_console_protocol_set *
   77.58 -xen_console_protocol_set_alloc(size_t size);
   77.59 -
   77.60 -/**
   77.61 - * Free the given xen_console_protocol_set.  The given set must have
   77.62 - * been allocated by this library.
   77.63 - */
   77.64 -extern void
   77.65 -xen_console_protocol_set_free(xen_console_protocol_set *set);
   77.66 -
   77.67 -
   77.68 -/**
   77.69 - * Return the name corresponding to the given code.  This string must
   77.70 - * not be modified or freed.
   77.71 - */
   77.72 -extern const char *
   77.73 -xen_console_protocol_to_string(enum xen_console_protocol val);
   77.74 -
   77.75 -
   77.76 -/**
   77.77 - * Return the correct code for the given string, or set the session
   77.78 - * object to failure and return an undefined value if the given string does
   77.79 - * not match a known code.
   77.80 - */
   77.81 -extern enum xen_console_protocol
   77.82 -xen_console_protocol_from_string(xen_session *session, const char *str);
   77.83 -
   77.84 -
   77.85 -#endif
    78.1 --- a/tools/libxen/include/xen_console_protocol_internal.h	Tue Apr 24 09:26:32 2007 -0600
    78.2 +++ b/tools/libxen/include/xen_console_protocol_internal.h	Tue Apr 24 21:39:23 2007 +0100
    78.3 @@ -1,5 +1,5 @@
    78.4  /*
    78.5 - * Copyright (c) 2006, XenSource Inc.
    78.6 + * Copyright (c) 2006-2007, XenSource Inc.
    78.7   *
    78.8   * This library is free software; you can redistribute it and/or
    78.9   * modify it under the terms of the GNU Lesser General Public
    79.1 --- a/tools/libxen/include/xen_crashdump.h	Tue Apr 24 09:26:32 2007 -0600
    79.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.3 @@ -1,199 +0,0 @@
    79.4 -/*
    79.5 - * Copyright (c) 2006-2007, XenSource Inc.
    79.6 - *
    79.7 - * This library is free software; you can redistribute it and/or
    79.8 - * modify it under the terms of the GNU Lesser General Public
    79.9 - * License as published by the Free Software Foundation; either
   79.10 - * version 2.1 of the License, or (at your option) any later version.
   79.11 - *
   79.12 - * This library is distributed in the hope that it will be useful,
   79.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   79.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   79.15 - * Lesser General Public License for more details.
   79.16 - *
   79.17 - * You should have received a copy of the GNU Lesser General Public
   79.18 - * License along with this library; if not, write to the Free Software
   79.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   79.20 - */
   79.21 -
   79.22 -#ifndef XEN_CRASHDUMP_H
   79.23 -#define XEN_CRASHDUMP_H
   79.24 -
   79.25 -#include "xen_common.h"
   79.26 -#include "xen_crashdump_decl.h"
   79.27 -#include "xen_vdi_decl.h"
   79.28 -#include "xen_vm_decl.h"
   79.29 -
   79.30 -
   79.31 -/*
   79.32 - * The crashdump class.
   79.33 - * 
   79.34 - * A VM crashdump.
   79.35 - */
   79.36 -
   79.37 -
   79.38 -/**
   79.39 - * Free the given xen_crashdump.  The given handle must have been
   79.40 - * allocated by this library.
   79.41 - */
   79.42 -extern void
   79.43 -xen_crashdump_free(xen_crashdump crashdump);
   79.44 -
   79.45 -
   79.46 -typedef struct xen_crashdump_set
   79.47 -{
   79.48 -    size_t size;
   79.49 -    xen_crashdump *contents[];
   79.50 -} xen_crashdump_set;
   79.51 -
   79.52 -/**
   79.53 - * Allocate a xen_crashdump_set of the given size.
   79.54 - */
   79.55 -extern xen_crashdump_set *
   79.56 -xen_crashdump_set_alloc(size_t size);
   79.57 -
   79.58 -/**
   79.59 - * Free the given xen_crashdump_set.  The given set must have been
   79.60 - * allocated by this library.
   79.61 - */
   79.62 -extern void
   79.63 -xen_crashdump_set_free(xen_crashdump_set *set);
   79.64 -
   79.65 -
   79.66 -typedef struct xen_crashdump_record
   79.67 -{
   79.68 -    xen_crashdump handle;
   79.69 -    char *uuid;
   79.70 -    struct xen_vm_record_opt *vm;
   79.71 -    struct xen_vdi_record_opt *vdi;
   79.72 -} xen_crashdump_record;
   79.73 -
   79.74 -/**
   79.75 - * Allocate a xen_crashdump_record.
   79.76 - */
   79.77 -extern xen_crashdump_record *
   79.78 -xen_crashdump_record_alloc(void);
   79.79 -
   79.80 -/**
   79.81 - * Free the given xen_crashdump_record, and all referenced values.  The
   79.82 - * given record must have been allocated by this library.
   79.83 - */
   79.84 -extern void
   79.85 -xen_crashdump_record_free(xen_crashdump_record *record);
   79.86 -
   79.87 -
   79.88 -typedef struct xen_crashdump_record_opt
   79.89 -{
   79.90 -    bool is_record;
   79.91 -    union
   79.92 -    {
   79.93 -        xen_crashdump handle;
   79.94 -        xen_crashdump_record *record;
   79.95 -    } u;
   79.96 -} xen_crashdump_record_opt;
   79.97 -
   79.98 -/**
   79.99 - * Allocate a xen_crashdump_record_opt.
  79.100 - */
  79.101 -extern xen_crashdump_record_opt *
  79.102 -xen_crashdump_record_opt_alloc(void);
  79.103 -
  79.104 -/**
  79.105 - * Free the given xen_crashdump_record_opt, and all referenced values. 
  79.106 - * The given record_opt must have been allocated by this library.
  79.107 - */
  79.108 -extern void
  79.109 -xen_crashdump_record_opt_free(xen_crashdump_record_opt *record_opt);
  79.110 -
  79.111 -
  79.112 -typedef struct xen_crashdump_record_set
  79.113 -{
  79.114 -    size_t size;
  79.115 -    xen_crashdump_record *contents[];
  79.116 -} xen_crashdump_record_set;
  79.117 -
  79.118 -/**
  79.119 - * Allocate a xen_crashdump_record_set of the given size.
  79.120 - */
  79.121 -extern xen_crashdump_record_set *
  79.122 -xen_crashdump_record_set_alloc(size_t size);
  79.123 -
  79.124 -/**
  79.125 - * Free the given xen_crashdump_record_set, and all referenced values. 
  79.126 - * The given set must have been allocated by this library.
  79.127 - */
  79.128 -extern void
  79.129 -xen_crashdump_record_set_free(xen_crashdump_record_set *set);
  79.130 -
  79.131 -
  79.132 -
  79.133 -typedef struct xen_crashdump_record_opt_set
  79.134 -{
  79.135 -    size_t size;
  79.136 -    xen_crashdump_record_opt *contents[];
  79.137 -} xen_crashdump_record_opt_set;
  79.138 -
  79.139 -/**
  79.140 - * Allocate a xen_crashdump_record_opt_set of the given size.
  79.141 - */
  79.142 -extern xen_crashdump_record_opt_set *
  79.143 -xen_crashdump_record_opt_set_alloc(size_t size);
  79.144 -
  79.145 -/**
  79.146 - * Free the given xen_crashdump_record_opt_set, and all referenced
  79.147 - * values.  The given set must have been allocated by this library.
  79.148 - */
  79.149 -extern void
  79.150 -xen_crashdump_record_opt_set_free(xen_crashdump_record_opt_set *set);
  79.151 -
  79.152 -
  79.153 -/**
  79.154 - * Get a record containing the current state of the given crashdump.
  79.155 - */
  79.156 -extern bool
  79.157 -xen_crashdump_get_record(xen_session *session, xen_crashdump_record **result, xen_crashdump crashdump);
  79.158 -
  79.159 -
  79.160 -/**
  79.161 - * Get a reference to the crashdump instance with the specified UUID.
  79.162 - */
  79.163 -extern bool
  79.164 -xen_crashdump_get_by_uuid(xen_session *session, xen_crashdump *result, char *uuid);
  79.165 -
  79.166 -
  79.167 -/**
  79.168 - * Get the uuid field of the given crashdump.
  79.169 - */
  79.170 -extern bool
  79.171 -xen_crashdump_get_uuid(xen_session *session, char **result, xen_crashdump crashdump);
  79.172 -
  79.173 -
  79.174 -/**
  79.175 - * Get the VM field of the given crashdump.
  79.176 - */
  79.177 -extern bool
  79.178 -xen_crashdump_get_vm(xen_session *session, xen_vm *result, xen_crashdump crashdump);
  79.179 -
  79.180 -
  79.181 -/**
  79.182 - * Get the VDI field of the given crashdump.
  79.183 - */
  79.184 -extern bool
  79.185 -xen_crashdump_get_vdi(xen_session *session, xen_vdi *result, xen_crashdump crashdump);
  79.186 -
  79.187 -
  79.188 -/**
  79.189 - * Destroy the specified crashdump
  79.190 - */
  79.191 -extern bool
  79.192 -xen_crashdump_destroy(xen_session *session, xen_crashdump self);
  79.193 -
  79.194 -
  79.195 -/**
  79.196 - * Return a list of all the crashdumps known to the system.
  79.197 - */
  79.198 -extern bool
  79.199 -xen_crashdump_get_all(xen_session *session, struct xen_crashdump_set **result);
  79.200 -
  79.201 -
  79.202 -#endif
    80.1 --- a/tools/libxen/include/xen_crashdump_decl.h	Tue Apr 24 09:26:32 2007 -0600
    80.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    80.3 @@ -1,30 +0,0 @@
    80.4 -/*
    80.5 - * Copyright (c) 2006, XenSource Inc.
    80.6 - *
    80.7 - * This library is free software; you can redistribute it and/or
    80.8 - * modify it under the terms of the GNU Lesser General Public
    80.9 - * License as published by the Free Software Foundation; either
   80.10 - * version 2.1 of the License, or (at your option) any later version.
   80.11 - *
   80.12 - * This library is distributed in the hope that it will be useful,
   80.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   80.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   80.15 - * Lesser General Public License for more details.
   80.16 - *
   80.17 - * You should have received a copy of the GNU Lesser General Public
   80.18 - * License along with this library; if not, write to the Free Software
   80.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   80.20 - */
   80.21 -
   80.22 -#ifndef XEN_CRASHDUMP_DECL_H
   80.23 -#define XEN_CRASHDUMP_DECL_H
   80.24 -
   80.25 -typedef void *xen_crashdump;
   80.26 -
   80.27 -struct xen_crashdump_set;
   80.28 -struct xen_crashdump_record;
   80.29 -struct xen_crashdump_record_set;
   80.30 -struct xen_crashdump_record_opt;
   80.31 -struct xen_crashdump_record_opt_set;
   80.32 -
   80.33 -#endif
    81.1 --- a/tools/libxen/include/xen_event.h	Tue Apr 24 09:26:32 2007 -0600
    81.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.3 @@ -1,102 +0,0 @@
    81.4 -/*
    81.5 - * Copyright (c) 2006-2007, XenSource Inc.
    81.6 - *
    81.7 - * This library is free software; you can redistribute it and/or
    81.8 - * modify it under the terms of the GNU Lesser General Public
    81.9 - * License as published by the Free Software Foundation; either
   81.10 - * version 2.1 of the License, or (at your option) any later version.
   81.11 - *
   81.12 - * This library is distributed in the hope that it will be useful,
   81.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   81.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   81.15 - * Lesser General Public License for more details.
   81.16 - *
   81.17 - * You should have received a copy of the GNU Lesser General Public
   81.18 - * License along with this library; if not, write to the Free Software
   81.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   81.20 - */
   81.21 -
   81.22 -#ifndef XEN_EVENT_H
   81.23 -#define XEN_EVENT_H
   81.24 -
   81.25 -#include "xen_common.h"
   81.26 -#include "xen_event_decl.h"
   81.27 -#include "xen_event_operation.h"
   81.28 -#include "xen_string_set.h"
   81.29 -
   81.30 -
   81.31 -/*
   81.32 - * The event class.
   81.33 - * 
   81.34 - * Asynchronous event registration and handling.
   81.35 - */
   81.36 -
   81.37 -
   81.38 -
   81.39 -typedef struct xen_event_record
   81.40 -{
   81.41 -    int64_t id;
   81.42 -    time_t timestamp;
   81.43 -    char *class;
   81.44 -    enum xen_event_operation operation;
   81.45 -    char *ref;
   81.46 -    char *obj_uuid;
   81.47 -} xen_event_record;
   81.48 -
   81.49 -/**
   81.50 - * Allocate a xen_event_record.
   81.51 - */
   81.52 -extern xen_event_record *
   81.53 -xen_event_record_alloc(void);
   81.54 -
   81.55 -/**
   81.56 - * Free the given xen_event_record, and all referenced values.  The
   81.57 - * given record must have been allocated by this library.
   81.58 - */
   81.59 -extern void
   81.60 -xen_event_record_free(xen_event_record *record);
   81.61 -
   81.62 -
   81.63 -typedef struct xen_event_record_set
   81.64 -{
   81.65 -    size_t size;
   81.66 -    xen_event_record *contents[];
   81.67 -} xen_event_record_set;
   81.68 -
   81.69 -/**
   81.70 - * Allocate a xen_event_record_set of the given size.
   81.71 - */
   81.72 -extern xen_event_record_set *
   81.73 -xen_event_record_set_alloc(size_t size);
   81.74 -
   81.75 -/**
   81.76 - * Free the given xen_event_record_set, and all referenced values.  The
   81.77 - * given set must have been allocated by this library.
   81.78 - */
   81.79 -extern void
   81.80 -xen_event_record_set_free(xen_event_record_set *set);
   81.81 -
   81.82 -
   81.83 -/**
   81.84 - * Registers this session with the event system.  Specifying the empty
   81.85 - * list will register for all classes.
   81.86 - */
   81.87 -extern bool
   81.88 -xen_event_register(xen_session *session, struct xen_string_set *classes);
   81.89 -
   81.90 -
   81.91 -/**
   81.92 - * Unregisters this session with the event system.
   81.93 - */
   81.94 -extern bool
   81.95 -xen_event_unregister(xen_session *session, struct xen_string_set *classes);
   81.96 -
   81.97 -
   81.98 -/**
   81.99 - * Blocking call which returns a (possibly empty) batch of events.
  81.100 - */
  81.101 -extern bool
  81.102 -xen_event_next(xen_session *session, struct xen_event_record_set **result);
  81.103 -
  81.104 -
  81.105 -#endif
    82.1 --- a/tools/libxen/include/xen_event_decl.h	Tue Apr 24 09:26:32 2007 -0600
    82.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.3 @@ -1,25 +0,0 @@
    82.4 -/*
    82.5 - * Copyright (c) 2006-2007, XenSource Inc.
    82.6 - *
    82.7 - * This library is free software; you can redistribute it and/or
    82.8 - * modify it under the terms of the GNU Lesser General Public
    82.9 - * License as published by the Free Software Foundation; either
   82.10 - * version 2.1 of the License, or (at your option) any later version.
   82.11 - *
   82.12 - * This library is distributed in the hope that it will be useful,
   82.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   82.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   82.15 - * Lesser General Public License for more details.
   82.16 - *
   82.17 - * You should have received a copy of the GNU Lesser General Public
   82.18 - * License along with this library; if not, write to the Free Software
   82.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   82.20 - */
   82.21 -
   82.22 -#ifndef XEN_EVENT_DECL_H
   82.23 -#define XEN_EVENT_DECL_H
   82.24 -
   82.25 -struct xen_event_record;
   82.26 -struct xen_event_record_set;
   82.27 -
   82.28 -#endif
    83.1 --- a/tools/libxen/include/xen_event_operation.h	Tue Apr 24 09:26:32 2007 -0600
    83.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.3 @@ -1,82 +0,0 @@
    83.4 -/*
    83.5 - * Copyright (c) 2006-2007, XenSource Inc.
    83.6 - *
    83.7 - * This library is free software; you can redistribute it and/or
    83.8 - * modify it under the terms of the GNU Lesser General Public
    83.9 - * License as published by the Free Software Foundation; either
   83.10 - * version 2.1 of the License, or (at your option) any later version.
   83.11 - *
   83.12 - * This library is distributed in the hope that it will be useful,
   83.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   83.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   83.15 - * Lesser General Public License for more details.
   83.16 - *
   83.17 - * You should have received a copy of the GNU Lesser General Public
   83.18 - * License along with this library; if not, write to the Free Software
   83.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   83.20 - */
   83.21 -
   83.22 -#ifndef XEN_EVENT_OPERATION_H
   83.23 -#define XEN_EVENT_OPERATION_H
   83.24 -
   83.25 -
   83.26 -#include "xen_common.h"
   83.27 -
   83.28 -
   83.29 -enum xen_event_operation
   83.30 -{
   83.31 -    /**
   83.32 -     * An object has been created
   83.33 -     */
   83.34 -    XEN_EVENT_OPERATION_ADD,
   83.35 -
   83.36 -    /**
   83.37 -     * An object has been deleted
   83.38 -     */
   83.39 -    XEN_EVENT_OPERATION_DEL,
   83.40 -
   83.41 -    /**
   83.42 -     * An object has been modified
   83.43 -     */
   83.44 -    XEN_EVENT_OPERATION_MOD
   83.45 -};
   83.46 -
   83.47 -
   83.48 -typedef struct xen_event_operation_set
   83.49 -{
   83.50 -    size_t size;
   83.51 -    enum xen_event_operation contents[];
   83.52 -} xen_event_operation_set;
   83.53 -
   83.54 -/**
   83.55 - * Allocate a xen_event_operation_set of the given size.
   83.56 - */
   83.57 -extern xen_event_operation_set *
   83.58 -xen_event_operation_set_alloc(size_t size);
   83.59 -
   83.60 -/**
   83.61 - * Free the given xen_event_operation_set.  The given set must have
   83.62 - * been allocated by this library.
   83.63 - */
   83.64 -extern void
   83.65 -xen_event_operation_set_free(xen_event_operation_set *set);
   83.66 -
   83.67 -
   83.68 -/**
   83.69 - * Return the name corresponding to the given code.  This string must
   83.70 - * not be modified or freed.
   83.71 - */
   83.72 -extern const char *
   83.73 -xen_event_operation_to_string(enum xen_event_operation val);
   83.74 -
   83.75 -
   83.76 -/**
   83.77 - * Return the correct code for the given string, or set the session
   83.78 - * object to failure and return an undefined value if the given string does
   83.79 - * not match a known code.
   83.80 - */
   83.81 -extern enum xen_event_operation
   83.82 -xen_event_operation_from_string(xen_session *session, const char *str);
   83.83 -
   83.84 -
   83.85 -#endif
    84.1 --- a/tools/libxen/include/xen_host.h	Tue Apr 24 09:26:32 2007 -0600
    84.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    84.3 @@ -1,497 +0,0 @@
    84.4 -/*
    84.5 - * Copyright (c) 2006-2007, XenSource Inc.
    84.6 - *
    84.7 - * This library is free software; you can redistribute it and/or
    84.8 - * modify it under the terms of the GNU Lesser General Public
    84.9 - * License as published by the Free Software Foundation; either
   84.10 - * version 2.1 of the License, or (at your option) any later version.
   84.11 - *
   84.12 - * This library is distributed in the hope that it will be useful,
   84.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   84.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   84.15 - * Lesser General Public License for more details.
   84.16 - *
   84.17 - * You should have received a copy of the GNU Lesser General Public
   84.18 - * License along with this library; if not, write to the Free Software
   84.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   84.20 - */
   84.21 -
   84.22 -#ifndef XEN_HOST_H
   84.23 -#define XEN_HOST_H
   84.24 -
   84.25 -#include "xen_common.h"
   84.26 -#include "xen_host_cpu_decl.h"
   84.27 -#include "xen_host_decl.h"
   84.28 -#include "xen_host_metrics_decl.h"
   84.29 -#include "xen_pbd_decl.h"
   84.30 -#include "xen_pif_decl.h"
   84.31 -#include "xen_sr_decl.h"
   84.32 -#include "xen_string_set.h"
   84.33 -#include "xen_string_string_map.h"
   84.34 -#include "xen_vm_decl.h"
   84.35 -
   84.36 -
   84.37 -/*
   84.38 - * The host class.
   84.39 - * 
   84.40 - * A physical host.
   84.41 - */
   84.42 -
   84.43 -
   84.44 -/**
   84.45 - * Free the given xen_host.  The given handle must have been allocated
   84.46 - * by this library.
   84.47 - */
   84.48 -extern void
   84.49 -xen_host_free(xen_host host);
   84.50 -
   84.51 -
   84.52 -typedef struct xen_host_set
   84.53 -{
   84.54 -    size_t size;
   84.55 -    xen_host *contents[];
   84.56 -} xen_host_set;
   84.57 -
   84.58 -/**
   84.59 - * Allocate a xen_host_set of the given size.
   84.60 - */
   84.61 -extern xen_host_set *
   84.62 -xen_host_set_alloc(size_t size);
   84.63 -
   84.64 -/**
   84.65 - * Free the given xen_host_set.  The given set must have been allocated
   84.66 - * by this library.
   84.67 - */
   84.68 -extern void
   84.69 -xen_host_set_free(xen_host_set *set);
   84.70 -
   84.71 -
   84.72 -typedef struct xen_host_record
   84.73 -{
   84.74 -    xen_host handle;
   84.75 -    char *uuid;
   84.76 -    char *name_label;
   84.77 -    char *name_description;
   84.78 -    int64_t api_version_major;
   84.79 -    int64_t api_version_minor;
   84.80 -    char *api_version_vendor;
   84.81 -    xen_string_string_map *api_version_vendor_implementation;
   84.82 -    bool enabled;
   84.83 -    xen_string_string_map *software_version;
   84.84 -    xen_string_string_map *other_config;
   84.85 -    struct xen_string_set *capabilities;
   84.86 -    xen_string_string_map *cpu_configuration;
   84.87 -    char *sched_policy;
   84.88 -    struct xen_string_set *supported_bootloaders;
   84.89 -    struct xen_vm_record_opt_set *resident_vms;
   84.90 -    xen_string_string_map *logging;
   84.91 -    struct xen_pif_record_opt_set *pifs;
   84.92 -    struct xen_sr_record_opt *suspend_image_sr;
   84.93 -    struct xen_sr_record_opt *crash_dump_sr;
   84.94 -    struct xen_pbd_record_opt_set *pbds;
   84.95 -    struct xen_host_cpu_record_opt_set *host_cpus;
   84.96 -    struct xen_host_metrics_record_opt *metrics;
   84.97 -} xen_host_record;
   84.98 -
   84.99 -/**
  84.100 - * Allocate a xen_host_record.
  84.101 - */
  84.102 -extern xen_host_record *
  84.103 -xen_host_record_alloc(void);
  84.104 -
  84.105 -/**
  84.106 - * Free the given xen_host_record, and all referenced values.  The
  84.107 - * given record must have been allocated by this library.
  84.108 - */
  84.109 -extern void
  84.110 -xen_host_record_free(xen_host_record *record);
  84.111 -
  84.112 -
  84.113 -typedef struct xen_host_record_opt
  84.114 -{
  84.115 -    bool is_record;
  84.116 -    union
  84.117 -    {
  84.118 -        xen_host handle;
  84.119 -        xen_host_record *record;
  84.120 -    } u;
  84.121 -} xen_host_record_opt;
  84.122 -
  84.123 -/**
  84.124 - * Allocate a xen_host_record_opt.
  84.125 - */
  84.126 -extern xen_host_record_opt *
  84.127 -xen_host_record_opt_alloc(void);
  84.128 -
  84.129 -/**
  84.130 - * Free the given xen_host_record_opt, and all referenced values.  The
  84.131 - * given record_opt must have been allocated by this library.
  84.132 - */
  84.133 -extern void
  84.134 -xen_host_record_opt_free(xen_host_record_opt *record_opt);
  84.135 -
  84.136 -
  84.137 -typedef struct xen_host_record_set
  84.138 -{
  84.139 -    size_t size;
  84.140 -    xen_host_record *contents[];
  84.141 -} xen_host_record_set;
  84.142 -
  84.143 -/**
  84.144 - * Allocate a xen_host_record_set of the given size.
  84.145 - */
  84.146 -extern xen_host_record_set *
  84.147 -xen_host_record_set_alloc(size_t size);
  84.148 -
  84.149 -/**
  84.150 - * Free the given xen_host_record_set, and all referenced values.  The
  84.151 - * given set must have been allocated by this library.
  84.152 - */
  84.153 -extern void
  84.154 -xen_host_record_set_free(xen_host_record_set *set);
  84.155 -
  84.156 -
  84.157 -
  84.158 -typedef struct xen_host_record_opt_set
  84.159 -{
  84.160 -    size_t size;
  84.161 -    xen_host_record_opt *contents[];
  84.162 -} xen_host_record_opt_set;
  84.163 -
  84.164 -/**
  84.165 - * Allocate a xen_host_record_opt_set of the given size.
  84.166 - */
  84.167 -extern xen_host_record_opt_set *
  84.168 -xen_host_record_opt_set_alloc(size_t size);
  84.169 -
  84.170 -/**
  84.171 - * Free the given xen_host_record_opt_set, and all referenced values. 
  84.172 - * The given set must have been allocated by this library.
  84.173 - */
  84.174 -extern void
  84.175 -xen_host_record_opt_set_free(xen_host_record_opt_set *set);
  84.176 -
  84.177 -
  84.178 -/**
  84.179 - * Get a record containing the current state of the given host.
  84.180 - */
  84.181 -extern bool
  84.182 -xen_host_get_record(xen_session *session, xen_host_record **result, xen_host host);
  84.183 -
  84.184 -
  84.185 -/**
  84.186 - * Get a reference to the host instance with the specified UUID.
  84.187 - */
  84.188 -extern bool
  84.189 -xen_host_get_by_uuid(xen_session *session, xen_host *result, char *uuid);
  84.190 -
  84.191 -
  84.192 -/**
  84.193 - * Get all the host instances with the given label.
  84.194 - */
  84.195 -extern bool
  84.196 -xen_host_get_by_name_label(xen_session *session, struct xen_host_set **result, char *label);
  84.197 -
  84.198 -
  84.199 -/**
  84.200 - * Get the uuid field of the given host.
  84.201 - */
  84.202 -extern bool
  84.203 -xen_host_get_uuid(xen_session *session, char **result, xen_host host);
  84.204 -
  84.205 -
  84.206 -/**
  84.207 - * Get the name/label field of the given host.
  84.208 - */
  84.209 -extern bool
  84.210 -xen_host_get_name_label(xen_session *session, char **result, xen_host host);
  84.211 -
  84.212 -
  84.213 -/**
  84.214 - * Get the name/description field of the given host.
  84.215 - */
  84.216 -extern bool
  84.217 -xen_host_get_name_description(xen_session *session, char **result, xen_host host);
  84.218 -
  84.219 -
  84.220 -/**
  84.221 - * Get the API_version/major field of the given host.
  84.222 - */
  84.223 -extern bool
  84.224 -xen_host_get_api_version_major(xen_session *session, int64_t *result, xen_host host);
  84.225 -
  84.226 -
  84.227 -/**
  84.228 - * Get the API_version/minor field of the given host.
  84.229 - */
  84.230 -extern bool
  84.231 -xen_host_get_api_version_minor(xen_session *session, int64_t *result, xen_host host);
  84.232 -
  84.233 -
  84.234 -/**
  84.235 - * Get the API_version/vendor field of the given host.
  84.236 - */
  84.237 -extern bool
  84.238 -xen_host_get_api_version_vendor(xen_session *session, char **result, xen_host host);
  84.239 -
  84.240 -
  84.241 -/**
  84.242 - * Get the API_version/vendor_implementation field of the given host.
  84.243 - */
  84.244 -extern bool
  84.245 -xen_host_get_api_version_vendor_implementation(xen_session *session, xen_string_string_map **result, xen_host host);
  84.246 -
  84.247 -
  84.248 -/**
  84.249 - * Get the enabled field of the given host.
  84.250 - */
  84.251 -extern bool
  84.252 -xen_host_get_enabled(xen_session *session, bool *result, xen_host host);
  84.253 -
  84.254 -
  84.255 -/**
  84.256 - * Get the software_version field of the given host.
  84.257 - */
  84.258 -extern bool
  84.259 -xen_host_get_software_version(xen_session *session, xen_string_string_map **result, xen_host host);
  84.260 -
  84.261 -
  84.262 -/**
  84.263 - * Get the other_config field of the given host.
  84.264 - */
  84.265 -extern bool
  84.266 -xen_host_get_other_config(xen_session *session, xen_string_string_map **result, xen_host host);
  84.267 -
  84.268 -
  84.269 -/**
  84.270 - * Get the capabilities field of the given host.
  84.271 - */
  84.272 -extern bool
  84.273 -xen_host_get_capabilities(xen_session *session, struct xen_string_set **result, xen_host host);
  84.274 -
  84.275 -
  84.276 -/**
  84.277 - * Get the cpu_configuration field of the given host.
  84.278 - */
  84.279 -extern bool
  84.280 -xen_host_get_cpu_configuration(xen_session *session, xen_string_string_map **result, xen_host host);
  84.281 -
  84.282 -
  84.283 -/**
  84.284 - * Get the sched_policy field of the given host.
  84.285 - */
  84.286 -extern bool
  84.287 -xen_host_get_sched_policy(xen_session *session, char **result, xen_host host);
  84.288 -
  84.289 -
  84.290 -/**
  84.291 - * Get the supported_bootloaders field of the given host.
  84.292 - */
  84.293 -extern bool
  84.294 -xen_host_get_supported_bootloaders(xen_session *session, struct xen_string_set **result, xen_host host);
  84.295 -
  84.296 -
  84.297 -/**
  84.298 - * Get the resident_VMs field of the given host.
  84.299 - */
  84.300 -extern bool
  84.301 -xen_host_get_resident_vms(xen_session *session, struct xen_vm_set **result, xen_host host);
  84.302 -
  84.303 -
  84.304 -/**
  84.305 - * Get the logging field of the given host.
  84.306 - */
  84.307 -extern bool
  84.308 -xen_host_get_logging(xen_session *session, xen_string_string_map **result, xen_host host);
  84.309 -
  84.310 -
  84.311 -/**
  84.312 - * Get the PIFs field of the given host.
  84.313 - */
  84.314 -extern bool
  84.315 -xen_host_get_pifs(xen_session *session, struct xen_pif_set **result, xen_host host);
  84.316 -
  84.317 -
  84.318 -/**
  84.319 - * Get the suspend_image_sr field of the given host.
  84.320 - */
  84.321 -extern bool
  84.322 -xen_host_get_suspend_image_sr(xen_session *session, xen_sr *result, xen_host host);
  84.323 -
  84.324 -
  84.325 -/**
  84.326 - * Get the crash_dump_sr field of the given host.
  84.327 - */
  84.328 -extern bool
  84.329 -xen_host_get_crash_dump_sr(xen_session *session, xen_sr *result, xen_host host);
  84.330 -
  84.331 -
  84.332 -/**
  84.333 - * Get the PBDs field of the given host.
  84.334 - */
  84.335 -extern bool
  84.336 -xen_host_get_pbds(xen_session *session, struct xen_pbd_set **result, xen_host host);
  84.337 -
  84.338 -
  84.339 -/**
  84.340 - * Get the host_CPUs field of the given host.
  84.341 - */
  84.342 -extern bool
  84.343 -xen_host_get_host_cpus(xen_session *session, struct xen_host_cpu_set **result, xen_host host);
  84.344 -
  84.345 -
  84.346 -/**
  84.347 - * Get the metrics field of the given host.
  84.348 - */
  84.349 -extern bool
  84.350 -xen_host_get_metrics(xen_session *session, xen_host_metrics *result, xen_host host);
  84.351 -
  84.352 -
  84.353 -/**
  84.354 - * Set the name/label field of the given host.
  84.355 - */
  84.356 -extern bool
  84.357 -xen_host_set_name_label(xen_session *session, xen_host host, char *label);
  84.358 -
  84.359 -
  84.360 -/**
  84.361 - * Set the name/description field of the given host.
  84.362 - */
  84.363 -extern bool
  84.364 -xen_host_set_name_description(xen_session *session, xen_host host, char *description);
  84.365 -
  84.366 -
  84.367 -/**
  84.368 - * Set the other_config field of the given host.
  84.369 - */
  84.370 -extern bool
  84.371 -xen_host_set_other_config(xen_session *session, xen_host host, xen_string_string_map *other_config);
  84.372 -
  84.373 -
  84.374 -/**
  84.375 - * Add the given key-value pair to the other_config field of the given
  84.376 - * host.
  84.377 - */
  84.378 -extern bool
  84.379 -xen_host_add_to_other_config(xen_session *session, xen_host host, char *key, char *value);
  84.380 -
  84.381 -
  84.382 -/**
  84.383 - * Remove the given key and its corresponding value from the
  84.384 - * other_config field of the given host.  If the key is not in that Map, then
  84.385 - * do nothing.
  84.386 - */
  84.387 -extern bool
  84.388 -xen_host_remove_from_other_config(xen_session *session, xen_host host, char *key);
  84.389 -
  84.390 -
  84.391 -/**
  84.392 - * Set the logging field of the given host.
  84.393 - */
  84.394 -extern bool
  84.395 -xen_host_set_logging(xen_session *session, xen_host host, xen_string_string_map *logging);
  84.396 -
  84.397 -
  84.398 -/**
  84.399 - * Add the given key-value pair to the logging field of the given host.
  84.400 - */
  84.401 -extern bool
  84.402 -xen_host_add_to_logging(xen_session *session, xen_host host, char *key, char *value);
  84.403 -
  84.404 -
  84.405 -/**
  84.406 - * Remove the given key and its corresponding value from the logging
  84.407 - * field of the given host.  If the key is not in that Map, then do nothing.
  84.408 - */
  84.409 -extern bool
  84.410 -xen_host_remove_from_logging(xen_session *session, xen_host host, char *key);
  84.411 -
  84.412 -
  84.413 -/**
  84.414 - * Set the suspend_image_sr field of the given host.
  84.415 - */
  84.416 -extern bool
  84.417 -xen_host_set_suspend_image_sr(xen_session *session, xen_host host, xen_sr suspend_image_sr);
  84.418 -
  84.419 -
  84.420 -/**
  84.421 - * Set the crash_dump_sr field of the given host.
  84.422 - */
  84.423 -extern bool
  84.424 -xen_host_set_crash_dump_sr(xen_session *session, xen_host host, xen_sr crash_dump_sr);
  84.425 -
  84.426 -
  84.427 -/**
  84.428 - * Puts the host into a state in which no new VMs can be started.
  84.429 - * Currently active VMs on the host continue to execute.
  84.430 - */
  84.431 -extern bool
  84.432 -xen_host_disable(xen_session *session, xen_host host);
  84.433 -
  84.434 -
  84.435 -/**
  84.436 - * Puts the host into a state in which new VMs can be started.
  84.437 - */
  84.438 -extern bool
  84.439 -xen_host_enable(xen_session *session, xen_host host);
  84.440 -
  84.441 -
  84.442 -/**
  84.443 - * Shutdown the host. (This function can only be called if there are no
  84.444 - * currently running VMs on the host and it is disabled.).
  84.445 - */
  84.446 -extern bool
  84.447 -xen_host_shutdown(xen_session *session, xen_host host);
  84.448 -
  84.449 -
  84.450 -/**
  84.451 - * Reboot the host. (This function can only be called if there are no
  84.452 - * currently running VMs on the host and it is disabled.).
  84.453 - */
  84.454 -extern bool
  84.455 -xen_host_reboot(xen_session *session, xen_host host);
  84.456 -
  84.457 -
  84.458 -/**
  84.459 - * Get the host xen dmesg.
  84.460 - */
  84.461 -extern bool
  84.462 -xen_host_dmesg(xen_session *session, char **result, xen_host host);
  84.463 -
  84.464 -
  84.465 -/**
  84.466 - * Get the host xen dmesg, and clear the buffer.
  84.467 - */
  84.468 -extern bool
  84.469 -xen_host_dmesg_clear(xen_session *session, char **result, xen_host host);
  84.470 -
  84.471 -
  84.472 -/**
  84.473 - * Get the host's log file.
  84.474 - */
  84.475 -extern bool
  84.476 -xen_host_get_log(xen_session *session, char **result, xen_host host);
  84.477 -
  84.478 -
  84.479 -/**
  84.480 - * Inject the given string as debugging keys into Xen.
  84.481 - */
  84.482 -extern bool
  84.483 -xen_host_send_debug_keys(xen_session *session, xen_host host, char *keys);
  84.484 -
  84.485 -
  84.486 -/**
  84.487 - * List all supported methods.
  84.488 - */
  84.489 -extern bool
  84.490 -xen_host_list_methods(xen_session *session, struct xen_string_set **result);
  84.491 -
  84.492 -
  84.493 -/**
  84.494 - * Return a list of all the hosts known to the system.
  84.495 - */
  84.496 -extern bool
  84.497 -xen_host_get_all(xen_session *session, struct xen_host_set **result);
  84.498 -
  84.499 -
  84.500 -#endif
    85.1 --- a/tools/libxen/include/xen_host_cpu.h	Tue Apr 24 09:26:32 2007 -0600
    85.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.3 @@ -1,247 +0,0 @@
    85.4 -/*
    85.5 - * Copyright (c) 2006-2007, XenSource Inc.
    85.6 - *
    85.7 - * This library is free software; you can redistribute it and/or
    85.8 - * modify it under the terms of the GNU Lesser General Public
    85.9 - * License as published by the Free Software Foundation; either
   85.10 - * version 2.1 of the License, or (at your option) any later version.
   85.11 - *
   85.12 - * This library is distributed in the hope that it will be useful,
   85.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   85.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   85.15 - * Lesser General Public License for more details.
   85.16 - *
   85.17 - * You should have received a copy of the GNU Lesser General Public
   85.18 - * License along with this library; if not, write to the Free Software
   85.19 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
   85.20 - */
   85.21 -
   85.22 -#ifndef XEN_HOST_CPU_H
   85.23 -#define XEN_HOST_CPU_H
   85.24 -
   85.25 -#include "xen_common.h"
   85.26 -#include "xen_host_cpu_decl.h"
   85.27 -#include "xen_host_decl.h"
   85.28 -
   85.29 -
   85.30 -/*
   85.31 - * The host_cpu class.
   85.32 - * 
   85.33 - * A physical CPU.
   85.34 - */
   85.35 -
   85.36 -
   85.37 -/**
   85.38 - * Free the given xen_host_cpu.  The given handle must have been
   85.39 - * allocated by this library.
   85.40 - */
   85.41 -extern void
   85.42 -xen_host_cpu_free(xen_host_cpu host_cpu);
   85.43 -
   85.44 -
   85.45 -typedef struct xen_host_cpu_set
   85.46 -{
   85.47 -    size_t size;
   85.48 -    xen_host_cpu *contents[];
   85.49 -} xen_host_cpu_set;
   85.50 -
   85.51 -/**
   85.52 - * Allocate a