mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
First version of the Power Hypervisor driver
Features supported: - Connects to HMC/VIOS or IVM systems. - Life cycle commands (resume and shutdown). - dumpxml - 'list' and 'list --all' What is being implemented: - better and centralized control for UUID - definexml - CPU management commands * src/domain_conf.c src/domain_conf.h: first version of the driver * configure.in src/Makefile.am include/libvirt/virterror.h src/domain_conf.[ch] src/libvirt.c src/virterror.c: glue the driver in the general framework
This commit is contained in:
parent
521ac51748
commit
a7a82f9889
55
configure.in
55
configure.in
@ -187,6 +187,10 @@ AC_ARG_WITH([uml],
|
||||
[ --with-uml add UML support (on)],[],[with_uml=yes])
|
||||
AC_ARG_WITH([openvz],
|
||||
[ --with-openvz add OpenVZ support (on)],[],[with_openvz=yes])
|
||||
AC_ARG_WITH([libssh],
|
||||
[ --with-libssh=[PFX] libssh location],[],[with_libssh=yes])
|
||||
AC_ARG_WITH([phyp],
|
||||
[ --with-phyp=[PFX] add PHYP support (on)],[with_phyp=yes],[with_phyp=check])
|
||||
AC_ARG_WITH([vbox],
|
||||
[ --with-vbox add VirtualBox support (on)],[],[with_vbox=yes])
|
||||
AC_ARG_WITH([lxc],
|
||||
@ -776,7 +780,50 @@ AM_CONDITIONAL([HAVE_NUMACTL], [test "$with_numactl" != "no"])
|
||||
AC_SUBST([NUMACTL_CFLAGS])
|
||||
AC_SUBST([NUMACTL_LIBS])
|
||||
|
||||
if test "$with_libssh" != "yes" -a "$with_libssh" != "no"; then
|
||||
libssh_path="$with_libssh"
|
||||
elif test "$with_libssh" = "yes"; then
|
||||
libssh_path="/usr/local/lib/"
|
||||
elif test "$with_libssh" = "no"; then
|
||||
with_phyp="no";
|
||||
fi
|
||||
|
||||
if test "$with_phyp" = "check"; then
|
||||
AC_CHECK_LIB([ssh],[ssh_new],[
|
||||
LIBSSH_LIBS="$LIBSSH_LIBS -lssh -L$libssh_path"
|
||||
AC_SUBST([LIBSSH_LIBS])],[
|
||||
with_phyp="no"
|
||||
with_libssh="no";
|
||||
],[])
|
||||
|
||||
if test "$with_phyp" != "no"; then
|
||||
AC_CHECK_HEADERS([libssh/libssh.h],[
|
||||
with_phyp="yes"
|
||||
LIBSSH_CFLAGS="-I/usr/local/include/libssh"
|
||||
AC_SUBST([LIBSSH_CFLAGS])
|
||||
AC_DEFINE_UNQUOTED([WITH_PHYP], 1,
|
||||
[whether IBM HMC / IVM driver is enabled])
|
||||
],[
|
||||
with_phyp="no"
|
||||
with_libssh="no";
|
||||
],[])
|
||||
fi
|
||||
elif test "$with_phyp" = "yes"; then
|
||||
AC_CHECK_LIB([ssh],[ssh_new],[
|
||||
LIBSSH_LIBS="$LIBSSH_LIBS -lssh -L$libssh_path"
|
||||
AC_SUBST([LIBSSH_LIBS])],[
|
||||
AC_MSG_ERROR([You must install the libssh to compile Phype driver.])
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([libssh/libssh.h],[
|
||||
LIBSSH_CFLAGS="-I/usr/local/include/libssh"
|
||||
AC_SUBST([LIBSSH_CFLAGS])],[
|
||||
AC_MSG_ERROR([Cannot find libssh headers.Is libssh installed ?])
|
||||
],[])
|
||||
AC_DEFINE_UNQUOTED([WITH_PHYP], 1,
|
||||
[whether IBM HMC / IVM driver is enabled])
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_PHYP],[test "$with_phyp" = "yes"])
|
||||
|
||||
dnl libcap-ng
|
||||
AC_ARG_WITH([capng],
|
||||
@ -1518,6 +1565,7 @@ AC_MSG_NOTICE([ UML: $with_uml])
|
||||
AC_MSG_NOTICE([ OpenVZ: $with_openvz])
|
||||
AC_MSG_NOTICE([ VBox: $with_vbox])
|
||||
AC_MSG_NOTICE([ LXC: $with_lxc])
|
||||
AC_MSG_NOTICE([ PHYP: $with_phyp])
|
||||
AC_MSG_NOTICE([ ONE: $with_one])
|
||||
AC_MSG_NOTICE([ ESX: $with_esx])
|
||||
AC_MSG_NOTICE([ Test: $with_test])
|
||||
@ -1556,6 +1604,11 @@ AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Libraries])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ libxml: $LIBXML_CFLAGS $LIBXML_LIBS])
|
||||
if test "$with_libssh" != "no" ; then
|
||||
AC_MSG_NOTICE([ libssh: $LIBSSH_CFLAGS $LIBSSH_LIBS])
|
||||
else
|
||||
AC_MSG_NOTICE([ libssh: no])
|
||||
fi
|
||||
AC_MSG_NOTICE([ gnutls: $GNUTLS_CFLAGS $GNUTLS_LIBS])
|
||||
if test "$with_sasl" != "no" ; then
|
||||
AC_MSG_NOTICE([ sasl: $SASL_CFLAGS $SASL_LIBS])
|
||||
@ -1627,4 +1680,4 @@ AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([Privileges])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([ QEMU: $QEMU_USER:$QEMU_GROUP])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([])
|
||||
|
@ -123,9 +123,10 @@
|
||||
<p>
|
||||
Jim Mereying was maintaining a CVS to git mirror on
|
||||
<a href="http://git.et.redhat.com/?p=libvirt.git">git.et.redhat.com</a>.
|
||||
Existing users should migrate to the new git server, as the
|
||||
old one will be deprecated and turned into a mirror of the
|
||||
libvirt.org one. It's available as:
|
||||
Existing users should migrate to the new libvirt.org git server, as the
|
||||
old one is now deprecated. For the sake of old links including now-
|
||||
rewritten SHA1s, we'll leave the old repository on-line for some time.
|
||||
It is available as:
|
||||
</p>
|
||||
<pre>
|
||||
|
||||
|
@ -53,19 +53,20 @@ typedef enum {
|
||||
VIR_FROM_REMOTE, /* Error from remote driver */
|
||||
VIR_FROM_OPENVZ, /* Error from OpenVZ driver */
|
||||
VIR_FROM_XENXM, /* Error at Xen XM layer */
|
||||
VIR_FROM_STATS_LINUX, /* Error in the Linux Stats code */
|
||||
VIR_FROM_LXC, /* Error from Linux Container driver */
|
||||
VIR_FROM_STATS_LINUX,/* Error in the Linux Stats code */
|
||||
VIR_FROM_LXC, /* Error from Linux Container driver */
|
||||
VIR_FROM_STORAGE, /* Error from storage driver */
|
||||
VIR_FROM_NETWORK, /* Error from network config */
|
||||
VIR_FROM_DOMAIN, /* Error from domain config */
|
||||
VIR_FROM_UML, /* Error at the UML driver */
|
||||
VIR_FROM_NODEDEV, /* Error from node device monitor */
|
||||
VIR_FROM_XEN_INOTIFY, /* Error from xen inotify layer */
|
||||
VIR_FROM_NODEDEV, /* Error from node device monitor */
|
||||
VIR_FROM_XEN_INOTIFY,/* Error from xen inotify layer */
|
||||
VIR_FROM_SECURITY, /* Error from security framework */
|
||||
VIR_FROM_VBOX, /* Error from VirtualBox driver */
|
||||
VIR_FROM_VBOX, /* Error from VirtualBox driver */
|
||||
VIR_FROM_INTERFACE, /* Error when operating on an interface */
|
||||
VIR_FROM_ONE, /* Error from OpenNebula driver */
|
||||
VIR_FROM_ESX, /* Error from ESX driver */
|
||||
VIR_FROM_ONE, /* Error from OpenNebula driver */
|
||||
VIR_FROM_ESX, /* Error from ESX driver */
|
||||
VIR_FROM_PHYP, /* Error from IBM power hypervisor */
|
||||
} virErrorDomain;
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@ INCLUDES = \
|
||||
-I@top_srcdir@/include \
|
||||
-I@top_srcdir@/qemud \
|
||||
$(LIBXML_CFLAGS) \
|
||||
$(LIBSSH_CFLAGS) \
|
||||
$(XEN_CFLAGS) \
|
||||
$(SELINUX_CFLAGS) \
|
||||
$(DRIVER_MODULE_CFLAGS) \
|
||||
@ -129,13 +130,16 @@ LXC_CONTROLLER_SOURCES = \
|
||||
veth.c veth.h \
|
||||
cgroup.c cgroup.h
|
||||
|
||||
PHYP_DRIVER_SOURCES = \
|
||||
phyp/phyp_driver.c phyp/phyp_driver.h
|
||||
|
||||
OPENVZ_DRIVER_SOURCES = \
|
||||
openvz_conf.c openvz_conf.h \
|
||||
openvz_driver.c openvz_driver.h
|
||||
|
||||
VBOX_DRIVER_SOURCES = \
|
||||
vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h \
|
||||
vbox/vbox_driver.c vbox/vbox_driver.h \
|
||||
VBOX_DRIVER_SOURCES = \
|
||||
vbox/vbox_XPCOMCGlue.c vbox/vbox_XPCOMCGlue.h \
|
||||
vbox/vbox_driver.c vbox/vbox_driver.h \
|
||||
vbox/vbox_V2_2.c vbox/vbox_CAPI_v2_2.h
|
||||
|
||||
VBOX_DRIVER_EXTRA_DIST = vbox/vbox_tmpl.c vbox/README
|
||||
@ -149,18 +153,18 @@ UML_DRIVER_SOURCES = \
|
||||
uml_conf.c uml_conf.h \
|
||||
uml_driver.c uml_driver.h
|
||||
|
||||
ONE_DRIVER_SOURCES = \
|
||||
./opennebula/one_conf.c \
|
||||
./opennebula/one_conf.h \
|
||||
./opennebula/one_driver.c \
|
||||
./opennebula/one_driver.h \
|
||||
./opennebula/one_client.c \
|
||||
ONE_DRIVER_SOURCES = \
|
||||
./opennebula/one_conf.c \
|
||||
./opennebula/one_conf.h \
|
||||
./opennebula/one_driver.c \
|
||||
./opennebula/one_driver.h \
|
||||
./opennebula/one_client.c \
|
||||
./opennebula/one_client.h
|
||||
|
||||
ESX_DRIVER_SOURCES = \
|
||||
esx/esx_driver.c esx/esx_driver.h \
|
||||
esx/esx_util.c esx/esx_util.h \
|
||||
esx/esx_vi.c esx/esx_vi.h \
|
||||
ESX_DRIVER_SOURCES = \
|
||||
esx/esx_driver.c esx/esx_driver.h \
|
||||
esx/esx_util.c esx/esx_util.h \
|
||||
esx/esx_vi.c esx/esx_vi.h \
|
||||
esx/esx_vi_methods.c esx/esx_vi_methods.h \
|
||||
esx/esx_vi_types.c esx/esx_vi_types.h \
|
||||
esx/esx_vmx.c esx/esx_vmx.h
|
||||
@ -201,7 +205,7 @@ STORAGE_HELPER_DISK_SOURCES = \
|
||||
|
||||
|
||||
# Security framework and drivers for various models
|
||||
SECURITY_DRIVER_SOURCES = \
|
||||
SECURITY_DRIVER_SOURCES = \
|
||||
security.h security.c
|
||||
|
||||
SECURITY_DRIVER_SELINUX_SOURCES = \
|
||||
@ -295,6 +299,18 @@ endif
|
||||
libvirt_driver_xen_la_SOURCES = $(XEN_DRIVER_SOURCES)
|
||||
endif
|
||||
|
||||
if WITH_PHYP
|
||||
if WITH_DRIVER_MODULES
|
||||
mod_LTLIBRARIES += libvirt_driver_phyp.la
|
||||
else
|
||||
noinst_LTLIBRARIES += libvirt_driver_phyp.la
|
||||
libvirt_la_LIBADD += libvirt_driver_phyp.la
|
||||
endif
|
||||
libvirt_driver_phyp_la_LDFLAGS = $(LIBSSH_LIBS)
|
||||
libvirt_driver_phyp_la_CFLAGS = $(LIBSSH_CFLAGS)
|
||||
libvirt_driver_phyp_la_SOURCES = $(PHYP_DRIVER_SOURCES)
|
||||
endif
|
||||
|
||||
if WITH_OPENVZ
|
||||
if WITH_DRIVER_MODULES
|
||||
mod_LTLIBRARIES += libvirt_driver_openvz.la
|
||||
@ -511,6 +527,7 @@ EXTRA_DIST += \
|
||||
$(UML_DRIVER_SOURCES) \
|
||||
$(ONE_DRIVER_SOURCES) \
|
||||
$(OPENVZ_DRIVER_SOURCES) \
|
||||
$(PHYP_DRIVER_SOURCES) \
|
||||
$(VBOX_DRIVER_SOURCES) \
|
||||
$(ESX_DRIVER_SOURCES) \
|
||||
$(NETWORK_DRIVER_SOURCES) \
|
||||
|
@ -57,7 +57,8 @@ VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST,
|
||||
"vmware",
|
||||
"hyperv",
|
||||
"vbox",
|
||||
"one")
|
||||
"one",
|
||||
"phyp")
|
||||
|
||||
VIR_ENUM_IMPL(virDomainBoot, VIR_DOMAIN_BOOT_LAST,
|
||||
"fd",
|
||||
|
@ -55,6 +55,7 @@ enum virDomainVirtType {
|
||||
VIR_DOMAIN_VIRT_HYPERV,
|
||||
VIR_DOMAIN_VIRT_VBOX,
|
||||
VIR_DOMAIN_VIRT_ONE,
|
||||
VIR_DOMAIN_VIRT_PHYP,
|
||||
|
||||
VIR_DOMAIN_VIRT_LAST,
|
||||
};
|
||||
|
@ -23,6 +23,7 @@ typedef enum {
|
||||
VIR_DRV_VBOX = 8,
|
||||
VIR_DRV_ONE = 9,
|
||||
VIR_DRV_ESX = 10,
|
||||
VIR_DRV_PHYP = 11,
|
||||
} virDrvNo;
|
||||
|
||||
|
||||
|
@ -55,6 +55,9 @@
|
||||
#ifdef WITH_OPENVZ
|
||||
#include "openvz_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_PHYP
|
||||
#include "phyp/phyp_driver.h"
|
||||
#endif
|
||||
#ifdef WITH_VBOX
|
||||
#include "vbox/vbox_driver.h"
|
||||
#endif
|
||||
@ -323,6 +326,9 @@ virInitialize(void)
|
||||
#ifdef WITH_OPENVZ
|
||||
if (openvzRegister() == -1) return -1;
|
||||
#endif
|
||||
#ifdef WITH_PHYP
|
||||
if (phypRegister() == -1) return -1;
|
||||
#endif
|
||||
#ifdef WITH_VBOX
|
||||
if (vboxRegister() == -1) return -1;
|
||||
#endif
|
||||
@ -896,6 +902,10 @@ virGetVersion(unsigned long *libVer, const char *type,
|
||||
if (STRCASEEQ(type, "LXC"))
|
||||
*typeVer = LIBVIR_VERSION_NUMBER;
|
||||
#endif
|
||||
#if WITH_PHYP
|
||||
if (STRCASEEQ(type, "phyp"))
|
||||
*typeVer = LIBVIR_VERSION_NUMBER;
|
||||
#endif
|
||||
#if WITH_OPENVZ
|
||||
if (STRCASEEQ(type, "OpenVZ"))
|
||||
*typeVer = LIBVIR_VERSION_NUMBER;
|
||||
|
1374
src/phyp/phyp_driver.c
Normal file
1374
src/phyp/phyp_driver.c
Normal file
File diff suppressed because it is too large
Load Diff
66
src/phyp/phyp_driver.h
Normal file
66
src/phyp/phyp_driver.h
Normal file
@ -0,0 +1,66 @@
|
||||
#include <config.h>
|
||||
#include <libssh/libssh.h>
|
||||
|
||||
#define LPAR_EXEC_ERR -1
|
||||
#define SSH_CONN_ERR -2 /* error while trying to connect to remote host */
|
||||
#define SSH_CMD_ERR -3 /* error while trying to execute the remote cmd */
|
||||
|
||||
typedef struct _ConnectionData ConnectionData;
|
||||
typedef ConnectionData *ConnectionDataPtr;
|
||||
struct _ConnectionData {
|
||||
SSH_SESSION *session;
|
||||
virConnectAuthPtr auth;
|
||||
};
|
||||
|
||||
/* This is the lpar (domain) struct that relates
|
||||
* the ID with UUID generated by the API
|
||||
* */
|
||||
typedef struct _lpar lpar_t;
|
||||
typedef lpar_t *lparPtr;
|
||||
struct _lpar {
|
||||
unsigned char uuid[VIR_UUID_BUFLEN];
|
||||
int id;
|
||||
};
|
||||
|
||||
/* 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 {
|
||||
int nlpars;
|
||||
lparPtr *lpars;
|
||||
};
|
||||
|
||||
int phypGetLparUUID(unsigned char *uuid, int lpar_id, virConnectPtr conn);
|
||||
|
||||
void init_uuid_db(virConnectPtr conn);
|
||||
|
||||
int phypRegister(void);
|
||||
|
||||
void stripPath(char *striped_path, char *path);
|
||||
|
||||
void stripNewline(char *striped_string, char *string);
|
||||
|
||||
int buffer_add_u8(struct buffer_struct *buffer, u8 data);
|
||||
|
||||
int phypGetLparState(virConnectPtr conn, unsigned int lpar_id);
|
||||
|
||||
unsigned long phypGetLparMem(virConnectPtr conn,
|
||||
const char *managed_system, int lpar_id,
|
||||
int type);
|
||||
|
||||
unsigned long phypGetLparCPU(virConnectPtr conn,
|
||||
const char *managed_system, int lpar_id);
|
||||
|
||||
int phypGetRemoteSlot(virConnectPtr conn, const char *managed_system,
|
||||
const char *lpar_name);
|
||||
|
||||
char *phypGetBackingDevice(virConnectPtr conn, const char *managed_system,
|
||||
char *lpar_name);
|
||||
|
||||
int phypDiskType(virConnectPtr conn, char *backing_device);
|
||||
|
||||
SSH_SESSION *openSSHSession(virConnectPtr conn, virConnectAuthPtr auth);
|
||||
|
||||
int escape_specialcharacters(char *src, char *dst);
|
@ -124,6 +124,9 @@ static const char *virErrorDomainName(virErrorDomain domain) {
|
||||
case VIR_FROM_CONF:
|
||||
dom = "Config ";
|
||||
break;
|
||||
case VIR_FROM_PHYP:
|
||||
dom = "IBM power hypervisor ";
|
||||
break;
|
||||
case VIR_FROM_OPENVZ:
|
||||
dom = "OpenVZ ";
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user