esx_vmx.h 3.9 KB
Newer Older
1 2

/*
3
 * esx_vmx.h: VMX related functions for the VMware ESX driver
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * Copyright (C) 2009 Matthias Bolte <matthias.bolte@googlemail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
 *
 */

#ifndef __ESX_VMX_H__
24
# define __ESX_VMX_H__
25

26 27 28 29
# include "internal.h"
# include "conf.h"
# include "domain_conf.h"
# include "esx_vi.h"
30

M
Matthias Bolte 已提交
31
int
32
esxVMX_SCSIDiskNameToControllerAndID(const char *name, int *controller, int *id);
M
Matthias Bolte 已提交
33

M
Matthias Bolte 已提交
34
int
35
esxVMX_IDEDiskNameToControllerAndID(const char *name, int *controller, int *id);
M
Matthias Bolte 已提交
36

M
Matthias Bolte 已提交
37
int
38
esxVMX_FloppyDiskNameToController(const char *name, int *controller);
M
Matthias Bolte 已提交
39 40

int
41 42
esxVMX_GatherSCSIControllers(virDomainDefPtr conf, char *virtualDev[4],
                             int present[4]);
M
Matthias Bolte 已提交
43

M
Matthias Bolte 已提交
44
char *
45
esxVMX_AbsolutePathToDatastoreRelatedPath(esxVI_Context *ctx,
M
Matthias Bolte 已提交
46
                                          const char *absolutePath);
M
Matthias Bolte 已提交
47 48


49

M
Matthias Bolte 已提交
50 51 52 53
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * VMX -> Domain XML
 */

M
Matthias Bolte 已提交
54
char *
55 56
esxVMX_ParseFileName(esxVI_Context *ctx, const char *fileName,
                     const char *datastoreName, const char *directoryName);
M
Matthias Bolte 已提交
57

58
virDomainDefPtr
59
esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
M
Matthias Bolte 已提交
60
                   const char *datastoreName, const char *directoryName,
61
                   esxVI_APIVersion apiVersion);
62

M
Matthias Bolte 已提交
63
int
64
esxVMX_ParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
M
Matthias Bolte 已提交
65

66
int
67 68
esxVMX_ParseSCSIController(virConfPtr conf, int controller, int *present,
                           char **virtualDev);
69 70

int
71 72 73 74
esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
                 int controller, int id, const char *virtualDev,
                 const char *datastoreName, const char *directoryName,
                 virDomainDiskDefPtr *def);
75
int
76
esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def);
77 78

int
79 80 81
esxVMX_ParseSerial(esxVI_Context *ctx, virConfPtr conf, int port,
                   const char *datastoreName, const char *directoryName,
                   virDomainChrDefPtr *def);
82 83

int
84 85 86
esxVMX_ParseParallel(esxVI_Context *ctx, virConfPtr conf, int port,
                     const char *datastoreName, const char *directoryName,
                     virDomainChrDefPtr *def);
87

M
Matthias Bolte 已提交
88 89 90 91 92 93 94


/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Domain XML -> VMX
 */

char *
95
esxVMX_FormatFileName(esxVI_Context *ctx, const char *src);
M
Matthias Bolte 已提交
96 97

char *
98 99
esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
                    esxVI_APIVersion apiVersion);
M
Matthias Bolte 已提交
100

M
Matthias Bolte 已提交
101
int
102
esxVMX_FormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer);
M
Matthias Bolte 已提交
103

M
Matthias Bolte 已提交
104
int
105 106
esxVMX_FormatHardDisk(esxVI_Context *ctx, virDomainDiskDefPtr def,
                      virBufferPtr buffer);
M
Matthias Bolte 已提交
107 108

int
109 110
esxVMX_FormatCDROM(esxVI_Context *ctx, virDomainDiskDefPtr def,
                   virBufferPtr buffer);
M
Matthias Bolte 已提交
111 112

int
113 114
esxVMX_FormatFloppy(esxVI_Context *ctx, virDomainDiskDefPtr def,
                    virBufferPtr buffer);
M
Matthias Bolte 已提交
115 116

int
117 118
esxVMX_FormatEthernet(virDomainNetDefPtr def, int controller,
                      virBufferPtr buffer);
M
Matthias Bolte 已提交
119 120

int
121 122
esxVMX_FormatSerial(esxVI_Context *ctx, virDomainChrDefPtr def,
                    virBufferPtr buffer);
M
Matthias Bolte 已提交
123 124

int
125 126
esxVMX_FormatParallel(esxVI_Context *ctx, virDomainChrDefPtr def,
                      virBufferPtr buffer);
M
Matthias Bolte 已提交
127

128
#endif /* __ESX_VMX_H__ */