|
| 1 | +/** |
| 2 | + * |
| 3 | + * This software is licensed under the GNU General Public License v3 or later. |
| 4 | + * |
| 5 | + * It is free software: you can redistribute it and/or modify |
| 6 | + * it under the terms of the GNU General Public License as published by |
| 7 | + * the Free Software Foundation, either version 3 of the License, or any later version. |
| 8 | + * This program is distributed in the hope that it will be useful, |
| 9 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | + * GNU General Public License for more details. |
| 12 | + * |
| 13 | + * You should have received a copy of the GNU General Public License |
| 14 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | + * |
| 16 | + */ |
| 17 | +package com.cloud.hypervisor.xen.resource; |
| 18 | + |
| 19 | + |
| 20 | +import javax.ejb.Local; |
| 21 | +import org.apache.log4j.Logger; |
| 22 | +import org.apache.xmlrpc.XmlRpcException; |
| 23 | + |
| 24 | +import com.cloud.hypervisor.xen.resource.CitrixResourceBase; |
| 25 | +import com.xensource.xenapi.VM; |
| 26 | +import com.cloud.resource.ServerResource; |
| 27 | +import com.xensource.xenapi.Connection; |
| 28 | +import com.xensource.xenapi.Types.XenAPIException; |
| 29 | + |
| 30 | + |
| 31 | +@Local(value=ServerResource.class) |
| 32 | +public class XenServerResource extends CitrixResourceBase { |
| 33 | + private static final Logger s_logger = Logger.getLogger(XenServerResource.class); |
| 34 | + |
| 35 | + |
| 36 | + public XenServerResource() { |
| 37 | + super(); |
| 38 | + } |
| 39 | + |
| 40 | + @Override |
| 41 | + protected String getGuestOsType(String stdType) { |
| 42 | + return stdType; |
| 43 | + } |
| 44 | + |
| 45 | + @Override |
| 46 | + protected void setMemory(Connection conn, VM vm, long memsize) throws XmlRpcException, XenAPIException { |
| 47 | + vm.setMemoryLimits(conn, memsize, memsize, memsize, memsize); |
| 48 | + } |
| 49 | + |
| 50 | + @Override |
| 51 | + protected String getPatchPath() { |
| 52 | + return "scripts/vm/hypervisor/xenserver/xenserver56"; |
| 53 | + } |
| 54 | + |
| 55 | +} |
0 commit comments