Skip to content

Commit e8a87bb

Browse files
committed
basical stuff works
1 parent 4cd6f31 commit e8a87bb

3 files changed

Lines changed: 649 additions & 4 deletions

File tree

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620Resource.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import org.apache.cloudstack.hypervisor.xenserver.XenServerResourceNewBase;
2828

2929
import com.cloud.resource.ServerResource;
30+
import com.cloud.storage.resource.StorageSubsystemCommandHandler;
31+
import com.cloud.storage.resource.StorageSubsystemCommandHandlerBase;
3032
import com.cloud.utils.exception.CloudRuntimeException;
3133
import com.cloud.utils.script.Script;
3234

@@ -86,4 +88,10 @@ public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicM
8688
return dynamicMinRam;
8789
}
8890

91+
@Override
92+
protected StorageSubsystemCommandHandler getStorageHandler() {
93+
XenServerStorageProcessor processor = new Xenserver620StorageProcessor(this);
94+
return new StorageSubsystemCommandHandlerBase(processor);
95+
}
96+
8997
}

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerStorageProcessor.java‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
public class XenServerStorageProcessor implements StorageProcessor {
8989
private static final Logger s_logger = Logger.getLogger(XenServerStorageProcessor.class);
9090
protected CitrixResourceBase hypervisorResource;
91-
private String BaseMountPointOnHost = "/var/run/cloud_mount";
91+
protected String BaseMountPointOnHost = "/var/run/cloud_mount";
9292

9393
public XenServerStorageProcessor(CitrixResourceBase resource) {
9494
hypervisorResource = resource;
@@ -446,6 +446,7 @@ public Answer createSnapshot(CreateObjectCommand cmd) {
446446
return new CreateObjectAnswer(details);
447447
}
448448

449+
449450
@Override
450451
public Answer deleteVolume(DeleteCommand cmd) {
451452
DataTO volume = cmd.getData();
@@ -767,7 +768,7 @@ protected Answer execute(AttachPrimaryDataStoreCmd cmd) {
767768
}
768769
}
769770

770-
private boolean IsISCSI(String type) {
771+
protected boolean IsISCSI(String type) {
771772
return SRType.LVMOHBA.equals(type) || SRType.LVMOISCSI.equals(type) || SRType.LVM.equals(type) ;
772773
}
773774

@@ -1069,7 +1070,7 @@ public String swiftBackupSnapshot(Connection conn, SwiftTO swift, String srUuid,
10691070
return lfilename;
10701071
}
10711072

1072-
private String backupSnapshotToS3(final Connection connection, final S3TO s3, final String srUuid, final String folder, final String snapshotUuid,
1073+
protected String backupSnapshotToS3(final Connection connection, final S3TO s3, final String srUuid, final String folder, final String snapshotUuid,
10731074
final Boolean iSCSIFlag, final int wait) {
10741075

10751076
final String filename = iSCSIFlag ? "VHD-" + snapshotUuid
@@ -1182,7 +1183,7 @@ protected String backupSnapshot(Connection conn, String primaryStorageSRUuid, St
11821183
}
11831184
}
11841185

1185-
private boolean destroySnapshotOnPrimaryStorageExceptThis(Connection conn, String volumeUuid, String avoidSnapshotUuid){
1186+
protected boolean destroySnapshotOnPrimaryStorageExceptThis(Connection conn, String volumeUuid, String avoidSnapshotUuid){
11861187
try {
11871188
VDI volume = getVDIbyUuid(conn, volumeUuid);
11881189
if (volume == null) {

0 commit comments

Comments
 (0)