2010-10-01 19:12:13 +04:00
/* -------------------------------------------------------------------------- */
2018-01-02 20:27:37 +03:00
/* Copyright 2002-2018, OpenNebula Project, OpenNebula Systems */
2010-10-01 19:12:13 +04:00
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
2009-01-26 21:25:15 +03:00
2008-07-04 20:55:49 +04:00
# ifndef LIBVIRT_DRIVER_H_
# define LIBVIRT_DRIVER_H_
# include <map>
# include <string>
# include <sstream>
# include "VirtualMachineManagerDriver.h"
class LibVirtDriver : public VirtualMachineManagerDriver
{
public :
2016-04-07 12:06:43 +03:00
LibVirtDriver ( int userid , const map < string , string > & attrs , bool sudo ,
VirtualMachinePool * pool , const string & emu )
: VirtualMachineManagerDriver ( userid , attrs , sudo , pool ) , emulator ( emu )
2008-07-04 20:55:49 +04:00
{ } ;
~ LibVirtDriver ( ) { } ;
private :
2016-04-07 12:06:43 +03:00
static const float CGROUP_BASE_CPU_SHARES ;
2013-05-18 22:22:47 +04:00
2016-04-07 12:06:43 +03:00
static const int CEPH_DEFAULT_PORT ;
2013-05-18 22:22:47 +04:00
2016-04-07 12:06:43 +03:00
static const int GLUSTER_DEFAULT_PORT ;
2014-12-11 15:17:52 +03:00
2016-04-07 12:06:43 +03:00
static const int ISCSI_DEFAULT_PORT ;
2014-12-11 15:17:52 +03:00
2016-04-07 12:06:43 +03:00
int deployment_description ( const VirtualMachine * vm , const string & fn ) const
2010-10-01 19:12:13 +04:00
{
int rc = - 1 ;
2013-05-18 22:22:47 +04:00
if ( emulator = = " kvm " | | emulator = = " qemu " )
2010-10-01 19:12:13 +04:00
{
2016-04-07 12:06:43 +03:00
rc = deployment_description_kvm ( vm , fn ) ;
2010-10-01 19:12:13 +04:00
}
return rc ;
}
2016-04-07 12:06:43 +03:00
int deployment_description_kvm ( const VirtualMachine * v , const string & f ) const ;
2010-10-01 19:12:13 +04:00
2008-07-04 20:55:49 +04:00
const string emulator ;
} ;
# endif /*LIBVIRT_DRIVER_H_*/