提交 3811eaaa 编写于 作者: E Eduardo Otubo 提交者: Daniel Veillard

POWER add create() and destroy() support

* src/phyp/phyp_driver.[ch]: add new entry points and a number of
  cleanups
上级 3023ec5e
此差异已折叠。
/*
* Copyright IBM Corp. 2009
*
* phyp_driver.c: ssh layer to access Power Hypervisors
*
* Authors:
* Eduardo Otubo <otubo at linux.vnet.ibm.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
*/
#include "conf/capabilities.h"
#include "conf/domain_conf.h"
#include <config.h>
#include <libssh2.h>
......@@ -26,22 +52,53 @@ struct _lpar {
/* Struct that holds how many lpars (domains) we're
* handling and a pointer to an array of lpar structs
* */
typedef struct _uuid_db uuid_db_t;
typedef uuid_db_t *uuid_dbPtr;
struct _uuid_db {
typedef struct _uuid_table uuid_table_t;
typedef uuid_table_t *uuid_tablePtr;
struct _uuid_table {
int nlpars;
lparPtr *lpars;
};
int phypGetLparUUID(unsigned char *uuid, int lpar_id, virConnectPtr conn);
/* This is the main structure of the driver
* */
typedef struct _phyp_driver phyp_driver_t;
typedef phyp_driver_t *phyp_driverPtr;
struct _phyp_driver {
uuid_tablePtr uuid_table;
virCapsPtr caps;
int vios_id;
char *managed_system;
};
void init_uuid_db(virConnectPtr conn);
int phypCheckSPFreeSapce(virConnectPtr conn, int required_size, char *sp);
int phypRegister(void);
int phypGetVIOSPartitionID(virConnectPtr conn);
virCapsPtr phypCapsInit(void);
int phypBuildLpar(virConnectPtr conn, virDomainDefPtr def);
int phypUUIDTable_WriteFile(virConnectPtr conn);
int phypUUIDTable_ReadFile(virConnectPtr conn);
int phypUUIDTable_AddLpar(virConnectPtr conn, unsigned char *uuid, int id);
int phypUUIDTable_RemLpar(virConnectPtr conn, int id);
void stripPath(char *striped_path, char *path);
int phypUUIDTable_Pull(virConnectPtr conn);
void stripNewline(char *striped_string, char *string);
int phypUUIDTable_Push(virConnectPtr conn);
int phypUUIDTable_Init(virConnectPtr conn);
int escape_specialcharacters(char *src, char *dst, size_t dstlen);
int waitsocket(int socket_fd, LIBSSH2_SESSION * session);
int phypGetLparUUID(unsigned char *uuid, int lpar_id, virConnectPtr conn);
int phypRegister(void);
int phypGetLparState(virConnectPtr conn, unsigned int lpar_id);
......@@ -52,6 +109,10 @@ unsigned long phypGetLparMem(virConnectPtr conn,
unsigned long phypGetLparCPU(virConnectPtr conn,
const char *managed_system, int lpar_id);
unsigned long phypGetLparCPUGeneric(virConnectPtr conn,
const char *managed_system,
int lpar_id, int type);
int phypGetRemoteSlot(virConnectPtr conn, const char *managed_system,
const char *lpar_name);
......@@ -60,6 +121,5 @@ char *phypGetBackingDevice(virConnectPtr conn, const char *managed_system,
int phypDiskType(virConnectPtr conn, char *backing_device);
LIBSSH2_SESSION *openSSHSession(virConnectPtr conn, virConnectAuthPtr auth, int *internal_socket);
int waitsocket(int socket_fd, LIBSSH2_SESSION * session);
LIBSSH2_SESSION *openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
int *internal_socket);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册