2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* esx_vmx.c: VMX related methods for the VMware ESX driver
|
|
|
|
*
|
|
|
|
* 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__
|
|
|
|
#define __ESX_VMX_H__
|
|
|
|
|
|
|
|
#include "internal.h"
|
2009-09-23 12:16:41 +00:00
|
|
|
#include "conf.h"
|
2009-07-23 20:21:08 +00:00
|
|
|
#include "domain_conf.h"
|
2009-08-05 08:23:59 +00:00
|
|
|
#include "esx_vi.h"
|
2009-07-23 20:21:08 +00:00
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_SCSIDiskNameToControllerAndID(const char *name, int *controller, int *id);
|
2009-09-23 12:52:36 +00:00
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_IDEDiskNameToControllerAndID(const char *name, int *controller, int *id);
|
2009-09-23 12:52:36 +00:00
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FloppyDiskNameToController(const char *name, int *controller);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_GatherSCSIControllers(virDomainDefPtr conf, char *virtualDev[4],
|
|
|
|
int present[4]);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
2009-09-23 12:52:36 +00:00
|
|
|
char *
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_AbsolutePathToDatastoreRelatedPath(esxVI_Context *ctx,
|
2009-09-23 12:52:36 +00:00
|
|
|
const char *absolutePath);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
|
2009-12-03 16:17:40 +00:00
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* VMX -> Domain XML
|
|
|
|
*/
|
|
|
|
|
2009-09-23 12:52:36 +00:00
|
|
|
char *
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_ParseFileName(esxVI_Context *ctx, const char *fileName,
|
|
|
|
const char *datastoreName, const char *directoryName);
|
2009-09-23 12:52:36 +00:00
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
virDomainDefPtr
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
|
2009-09-23 12:52:36 +00:00
|
|
|
const char *datastoreName, const char *directoryName,
|
2009-08-05 08:23:59 +00:00
|
|
|
esxVI_APIVersion apiVersion);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
2010-01-16 12:52:34 +00:00
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_ParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
|
2010-01-16 12:52:34 +00:00
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_ParseSCSIController(virConfPtr conf, int controller, int *present,
|
|
|
|
char **virtualDev);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
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);
|
2009-07-23 20:21:08 +00:00
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_ParseSerial(esxVI_Context *ctx, virConfPtr conf, int port,
|
|
|
|
const char *datastoreName, const char *directoryName,
|
|
|
|
virDomainChrDefPtr *def);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_ParseParallel(esxVI_Context *ctx, virConfPtr conf, int port,
|
|
|
|
const char *datastoreName, const char *directoryName,
|
|
|
|
virDomainChrDefPtr *def);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* Domain XML -> VMX
|
|
|
|
*/
|
|
|
|
|
|
|
|
char *
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FormatFileName(esxVI_Context *ctx, const char *src);
|
2009-09-23 12:52:36 +00:00
|
|
|
|
|
|
|
char *
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
|
|
|
|
esxVI_APIVersion apiVersion);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
2010-01-16 12:52:34 +00:00
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer);
|
2010-01-16 12:52:34 +00:00
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FormatHardDisk(esxVI_Context *ctx, virDomainDiskDefPtr def,
|
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FormatCDROM(esxVI_Context *ctx, virDomainDiskDefPtr def,
|
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FormatFloppy(esxVI_Context *ctx, virDomainDiskDefPtr def,
|
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FormatEthernet(virDomainNetDefPtr def, int controller,
|
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FormatSerial(esxVI_Context *ctx, virDomainChrDefPtr def,
|
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-01-15 22:05:26 +00:00
|
|
|
esxVMX_FormatParallel(esxVI_Context *ctx, virDomainChrDefPtr def,
|
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
#endif /* __ESX_VMX_H__ */
|