2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
/*
|
2010-03-02 21:19:24 +00:00
|
|
|
* esx_vmx.h: VMX related functions for the VMware ESX driver
|
2009-07-23 20:21:08 +00:00
|
|
|
*
|
|
|
|
* 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__
|
2010-03-09 18:22:22 +00:00
|
|
|
# define __ESX_VMX_H__
|
2009-07-23 20:21:08 +00:00
|
|
|
|
2010-06-18 16:16:22 +00:00
|
|
|
# include <stdbool.h>
|
|
|
|
|
2010-03-09 18:22:22 +00:00
|
|
|
# include "internal.h"
|
|
|
|
# include "conf.h"
|
|
|
|
# include "domain_conf.h"
|
|
|
|
# include "esx_vi.h"
|
2009-07-23 20:21:08 +00:00
|
|
|
|
2010-08-05 15:43:19 +00:00
|
|
|
typedef struct _esxVMX_Context esxVMX_Context;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* Context
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef char * (*esxVMX_ParseFileName)(const char *fileName, void *opaque);
|
|
|
|
typedef char * (*esxVMX_FormatFileName)(const char *src, void *opaque);
|
|
|
|
typedef int (*esxVMX_AutodetectSCSIControllerModel)(virDomainDiskDefPtr def,
|
|
|
|
int *model, void *opaque);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* esxVMX_ParseFileName is only used by esxVMX_ParseConfig.
|
|
|
|
* esxVMX_FormatFileName is only used by esxVMX_FormatConfig.
|
|
|
|
* esxVMX_AutodetectSCSIControllerModel is optionally used by esxVMX_FormatConfig.
|
|
|
|
*/
|
|
|
|
struct _esxVMX_Context {
|
|
|
|
void *opaque;
|
|
|
|
esxVMX_ParseFileName parseFileName;
|
|
|
|
esxVMX_FormatFileName formatFileName;
|
|
|
|
esxVMX_AutodetectSCSIControllerModel autodetectSCSIControllerModel;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* Helpers
|
|
|
|
*/
|
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
int
|
2010-06-17 17:57:12 +00:00
|
|
|
esxVMX_SCSIDiskNameToControllerAndUnit(const char *name, int *controller,
|
|
|
|
int *unit);
|
2009-09-23 12:52:36 +00:00
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
int
|
2010-06-17 17:57:12 +00:00
|
|
|
esxVMX_IDEDiskNameToBusAndUnit(const char *name, int *bus, int *unit);
|
2009-09-23 12:52:36 +00:00
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
int
|
2010-06-17 17:57:12 +00:00
|
|
|
esxVMX_FloppyDiskNameToUnit(const char *name, int *unit);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-06-17 17:57:12 +00:00
|
|
|
esxVMX_VerifyDiskAddress(virCapsPtr caps, virDomainDiskDefPtr disk);
|
|
|
|
|
|
|
|
int
|
|
|
|
esxVMX_HandleLegacySCSIDiskDriverName(virDomainDefPtr def,
|
|
|
|
virDomainDiskDefPtr disk);
|
|
|
|
|
|
|
|
int
|
2010-08-05 15:43:19 +00:00
|
|
|
esxVMX_GatherSCSIControllers(esxVMX_Context *ctx, virDomainDefPtr def,
|
2010-07-06 17:02:48 +00:00
|
|
|
int virtualDev[4], bool present[4]);
|
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-07-23 20:21:08 +00:00
|
|
|
virDomainDefPtr
|
2010-08-05 15:43:19 +00:00
|
|
|
esxVMX_ParseConfig(esxVMX_Context *ctx, virCapsPtr caps, const char *vmx,
|
2010-04-18 16:04:24 +00:00
|
|
|
esxVI_ProductVersion productVersion);
|
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-06-18 16:16:22 +00:00
|
|
|
esxVMX_ParseSCSIController(virConfPtr conf, int controller, bool *present,
|
2010-06-17 17:57:12 +00:00
|
|
|
int *virtualDev);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
int
|
2010-08-05 15:43:19 +00:00
|
|
|
esxVMX_ParseDisk(esxVMX_Context *ctx, virCapsPtr caps, virConfPtr conf,
|
2010-06-17 17:57:12 +00:00
|
|
|
int device, int busType, int controllerOrBus, int unit,
|
2010-01-15 22:05:26 +00:00
|
|
|
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-08-05 15:43:19 +00:00
|
|
|
esxVMX_ParseSerial(esxVMX_Context *ctx, virConfPtr conf, int port,
|
2010-01-15 22:05:26 +00:00
|
|
|
virDomainChrDefPtr *def);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
|
|
|
int
|
2010-08-05 15:43:19 +00:00
|
|
|
esxVMX_ParseParallel(esxVMX_Context *ctx, virConfPtr conf, int port,
|
2010-01-15 22:05:26 +00:00
|
|
|
virDomainChrDefPtr *def);
|
2009-07-23 20:21:08 +00:00
|
|
|
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* Domain XML -> VMX
|
|
|
|
*/
|
|
|
|
|
|
|
|
char *
|
2010-08-05 15:43:19 +00:00
|
|
|
esxVMX_FormatConfig(esxVMX_Context *ctx, virCapsPtr caps, virDomainDefPtr def,
|
2010-04-18 16:04:24 +00:00
|
|
|
esxVI_ProductVersion productVersion);
|
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-08-05 15:43:19 +00:00
|
|
|
esxVMX_FormatHardDisk(esxVMX_Context *ctx, virDomainDiskDefPtr def,
|
2010-01-15 22:05:26 +00:00
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-08-05 15:43:19 +00:00
|
|
|
esxVMX_FormatCDROM(esxVMX_Context *ctx, virDomainDiskDefPtr def,
|
2010-01-15 22:05:26 +00:00
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-08-05 15:43:19 +00:00
|
|
|
esxVMX_FormatFloppy(esxVMX_Context *ctx, virDomainDiskDefPtr def,
|
2010-08-06 00:02:03 +00:00
|
|
|
virBufferPtr buffer, bool floppy_present[2]);
|
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-08-05 15:43:19 +00:00
|
|
|
esxVMX_FormatSerial(esxVMX_Context *ctx, virDomainChrDefPtr def,
|
2010-01-15 22:05:26 +00:00
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
|
|
|
int
|
2010-08-05 15:43:19 +00:00
|
|
|
esxVMX_FormatParallel(esxVMX_Context *ctx, virDomainChrDefPtr def,
|
2010-01-15 22:05:26 +00:00
|
|
|
virBufferPtr buffer);
|
2009-09-23 12:16:41 +00:00
|
|
|
|
2009-07-23 20:21:08 +00:00
|
|
|
#endif /* __ESX_VMX_H__ */
|