esx_vmx.h 4.1 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 33
esxVMX_SCSIDiskNameToControllerAndUnit(const char *name, int *controller,
                                       int *unit);
M
Matthias Bolte 已提交
34

M
Matthias Bolte 已提交
35
int
36
esxVMX_IDEDiskNameToBusAndUnit(const char *name, int *bus, int *unit);
M
Matthias Bolte 已提交
37

M
Matthias Bolte 已提交
38
int
39
esxVMX_FloppyDiskNameToUnit(const char *name, int *unit);
M
Matthias Bolte 已提交
40 41

int
42 43 44 45 46 47 48 49 50
esxVMX_VerifyDiskAddress(virCapsPtr caps, virDomainDiskDefPtr disk);

int
esxVMX_HandleLegacySCSIDiskDriverName(virDomainDefPtr def,
                                      virDomainDiskDefPtr disk);

int
esxVMX_GatherSCSIControllers(virDomainDefPtr def, int virtualDev[4],
                             bool present[4]);
M
Matthias Bolte 已提交
51

M
Matthias Bolte 已提交
52
char *
53
esxVMX_AbsolutePathToDatastoreRelatedPath(esxVI_Context *ctx,
M
Matthias Bolte 已提交
54
                                          const char *absolutePath);
M
Matthias Bolte 已提交
55 56


57

M
Matthias Bolte 已提交
58 59 60 61
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * VMX -> Domain XML
 */

M
Matthias Bolte 已提交
62
char *
63 64
esxVMX_ParseFileName(esxVI_Context *ctx, const char *fileName,
                     const char *datastoreName, const char *directoryName);
M
Matthias Bolte 已提交
65

66
virDomainDefPtr
67
esxVMX_ParseConfig(esxVI_Context *ctx, virCapsPtr caps, const char *vmx,
M
Matthias Bolte 已提交
68
                   const char *datastoreName, const char *directoryName,
69
                   esxVI_ProductVersion productVersion);
70

M
Matthias Bolte 已提交
71
int
72
esxVMX_ParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
M
Matthias Bolte 已提交
73

74
int
75
esxVMX_ParseSCSIController(virConfPtr conf, int controller, int *present,
76
                           int *virtualDev);
77 78

int
79 80
esxVMX_ParseDisk(esxVI_Context *ctx, virCapsPtr caps, virConfPtr conf,
                 int device, int busType, int controllerOrBus, int unit,
81 82
                 const char *datastoreName, const char *directoryName,
                 virDomainDiskDefPtr *def);
83
int
84
esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def);
85 86

int
87 88 89
esxVMX_ParseSerial(esxVI_Context *ctx, virConfPtr conf, int port,
                   const char *datastoreName, const char *directoryName,
                   virDomainChrDefPtr *def);
90 91

int
92 93 94
esxVMX_ParseParallel(esxVI_Context *ctx, virConfPtr conf, int port,
                     const char *datastoreName, const char *directoryName,
                     virDomainChrDefPtr *def);
95

M
Matthias Bolte 已提交
96 97 98 99 100 101 102


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

char *
103
esxVMX_FormatFileName(esxVI_Context *ctx, const char *src);
M
Matthias Bolte 已提交
104 105

char *
106
esxVMX_FormatConfig(esxVI_Context *ctx, virCapsPtr caps, virDomainDefPtr def,
107
                    esxVI_ProductVersion productVersion);
M
Matthias Bolte 已提交
108

M
Matthias Bolte 已提交
109
int
110
esxVMX_FormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer);
M
Matthias Bolte 已提交
111

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

int
117 118
esxVMX_FormatCDROM(esxVI_Context *ctx, virDomainDiskDefPtr def,
                   virBufferPtr buffer);
M
Matthias Bolte 已提交
119 120

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

int
125 126
esxVMX_FormatEthernet(virDomainNetDefPtr def, int controller,
                      virBufferPtr buffer);
M
Matthias Bolte 已提交
127 128

int
129 130
esxVMX_FormatSerial(esxVI_Context *ctx, virDomainChrDefPtr def,
                    virBufferPtr buffer);
M
Matthias Bolte 已提交
131 132

int
133 134
esxVMX_FormatParallel(esxVI_Context *ctx, virDomainChrDefPtr def,
                      virBufferPtr buffer);
M
Matthias Bolte 已提交
135

136
#endif /* __ESX_VMX_H__ */