2010-03-14 11:11:51 +00:00
|
|
|
/*
|
|
|
|
* xenapi_utils.h: Xen API driver -- utils header
|
2012-08-09 21:37:03 +00:00
|
|
|
* Copyright (C) 2012, Red Hat, Inc.
|
2010-03-14 11:11:51 +00:00
|
|
|
* Copyright (C) 2009, 2010 Citrix Ltd.
|
|
|
|
*
|
|
|
|
* 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
|
2012-09-20 22:30:55 +00:00
|
|
|
* License along with this library. If not, see
|
2012-07-21 10:06:23 +00:00
|
|
|
* <http://www.gnu.org/licenses/>.
|
2010-03-14 11:11:51 +00:00
|
|
|
*
|
|
|
|
* Author: Sharadha Prabhakar <sharadha.prabhakar@citrix.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __VIR_XENAPI_UTILS__
|
|
|
|
# define __VIR_XENAPI_UTILS__
|
|
|
|
|
|
|
|
# include <xen/api/xen_all.h>
|
|
|
|
# include "internal.h"
|
2012-02-24 18:48:55 +00:00
|
|
|
# include "viruri.h"
|
2010-03-14 11:11:51 +00:00
|
|
|
# include "domain_conf.h"
|
|
|
|
|
|
|
|
# define NETWORK_DEVID_SIZE (12)
|
|
|
|
|
|
|
|
typedef uint64_t cpumap_t;
|
|
|
|
|
|
|
|
void
|
|
|
|
xenSessionFree(xen_session *session);
|
|
|
|
|
|
|
|
char *
|
|
|
|
xenapiUtil_RequestPassword(virConnectAuthPtr auth, const char *username,
|
|
|
|
const char *hostname);
|
|
|
|
|
|
|
|
int
|
2012-02-24 18:48:55 +00:00
|
|
|
xenapiUtil_ParseQuery(virConnectPtr conn, virURIPtr uri, int *noVerify);
|
2010-03-14 11:11:51 +00:00
|
|
|
|
|
|
|
enum xen_on_normal_exit
|
2014-06-03 07:18:58 +00:00
|
|
|
actionShutdownLibvirt2XenapiEnum(virDomainLifecycleAction action);
|
2010-03-14 11:11:51 +00:00
|
|
|
|
|
|
|
enum xen_on_crash_behaviour
|
2014-06-03 07:18:58 +00:00
|
|
|
actionCrashLibvirt2XenapiEnum(virDomainLifecycleCrashAction action);
|
2010-03-14 11:11:51 +00:00
|
|
|
|
|
|
|
char *
|
|
|
|
createXenAPIBootOrderString(int nboot, int *bootDevs);
|
|
|
|
|
2014-06-03 07:18:58 +00:00
|
|
|
virDomainBootOrder map2LibvirtBootOrder(char c);
|
2010-03-14 11:11:51 +00:00
|
|
|
|
2014-06-03 07:18:58 +00:00
|
|
|
virDomainLifecycleAction
|
2010-03-14 11:11:51 +00:00
|
|
|
xenapiNormalExitEnum2virDomainLifecycle(enum xen_on_normal_exit action);
|
|
|
|
|
2014-06-03 07:18:58 +00:00
|
|
|
virDomainLifecycleCrashAction
|
2010-03-14 11:11:51 +00:00
|
|
|
xenapiCrashExitEnum2virDomainLifecycle(enum xen_on_crash_behaviour action);
|
|
|
|
|
|
|
|
void getCpuBitMapfromString(char *mask, unsigned char *cpumap, int maplen);
|
|
|
|
|
|
|
|
int getStorageVolumeType(char *type);
|
|
|
|
|
|
|
|
char *returnErrorFromSession(xen_session *session);
|
|
|
|
|
|
|
|
virDomainState
|
|
|
|
mapPowerState(enum xen_vm_power_state state);
|
|
|
|
|
|
|
|
char *
|
|
|
|
mapDomainPinVcpu(unsigned char *cpumap, int maplen);
|
|
|
|
|
|
|
|
int
|
|
|
|
createVMRecordFromXml (virConnectPtr conn, virDomainDefPtr defPtr,
|
|
|
|
xen_vm_record **record, xen_vm *vm);
|
|
|
|
|
|
|
|
int
|
|
|
|
allocStringMap (xen_string_string_map **strings, char *key, char *val);
|
|
|
|
|
|
|
|
#endif /* __VIR_XENAPI_UTILS__ */
|