mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
refactor
This commit is contained in:
parent
92d8171760
commit
3a6d0e79a6
@ -187,13 +187,6 @@ import com.xensource.xenapi.SR;
|
||||
import com.xensource.xenapi.Session;
|
||||
import com.xensource.xenapi.Types;
|
||||
import com.xensource.xenapi.Types.BadServerResponse;
|
||||
import com.xensource.xenapi.Types.BootloaderFailed;
|
||||
import com.xensource.xenapi.Types.IpConfigurationMode;
|
||||
import com.xensource.xenapi.Types.OperationNotAllowed;
|
||||
import com.xensource.xenapi.Types.OtherOperationInProgress;
|
||||
import com.xensource.xenapi.Types.UnknownBootloader;
|
||||
import com.xensource.xenapi.Types.VmBadPowerState;
|
||||
import com.xensource.xenapi.Types.VmIsTemplate;
|
||||
import com.xensource.xenapi.Types.VmPowerState;
|
||||
import com.xensource.xenapi.Types.XenAPIException;
|
||||
import com.xensource.xenapi.VBD;
|
||||
@ -3519,13 +3512,7 @@ public abstract class CitrixResourceBase implements ServerResource {
|
||||
}
|
||||
|
||||
protected List<File> getPatchFiles() {
|
||||
|
||||
String patchPath = getPatchPath();
|
||||
String patchfilePath = Script.findScript(patchPath, "patch");
|
||||
File file = new File(patchfilePath);
|
||||
List<File> files = new ArrayList<File>();
|
||||
files.add(file);
|
||||
return files;
|
||||
return null;
|
||||
}
|
||||
|
||||
protected SR getSRByNameLabelandHost(Connection conn, String name) throws BadServerResponse, XenAPIException, XmlRpcException {
|
||||
@ -3792,10 +3779,6 @@ public abstract class CitrixResourceBase implements ServerResource {
|
||||
public CitrixResourceBase() {
|
||||
}
|
||||
|
||||
protected String getPatchPath() {
|
||||
return "scripts/vm/hypervisor/xenserver/xcpserver";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||
_name = name;
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
package com.cloud.hypervisor.xen.resource;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Local;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.xmlrpc.XmlRpcException;
|
||||
@ -28,6 +32,8 @@ import com.cloud.agent.api.SecurityIngressRulesCmd;
|
||||
import com.cloud.hypervisor.xen.resource.CitrixResourceBase;
|
||||
import com.xensource.xenapi.VM;
|
||||
import com.cloud.resource.ServerResource;
|
||||
import com.cloud.utils.exception.CloudRuntimeException;
|
||||
import com.cloud.utils.script.Script;
|
||||
import com.xensource.xenapi.Connection;
|
||||
import com.xensource.xenapi.Types.XenAPIException;
|
||||
|
||||
@ -58,11 +64,19 @@ public class XenServerResource extends CitrixResourceBase {
|
||||
protected void setMemory(Connection conn, VM vm, long memsize) throws XmlRpcException, XenAPIException {
|
||||
vm.setMemoryLimits(conn, memsize, memsize, memsize, memsize);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected String getPatchPath() {
|
||||
return "scripts/vm/hypervisor/xenserver/xenserver56";
|
||||
}
|
||||
protected List<File> getPatchFiles() {
|
||||
List<File> files = new ArrayList<File>();
|
||||
String patch = "scripts/vm/hypervisor/xenserver/xenserver56/patch";
|
||||
String patchfilePath = Script.findScript("" , patch);
|
||||
if ( patchfilePath == null ) {
|
||||
throw new CloudRuntimeException("Unable to find patch file " + patch);
|
||||
}
|
||||
File file = new File(patchfilePath);
|
||||
files.add(file);
|
||||
return files;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean can_bridge_firewall(Connection conn) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user