Permalink
Browse files

patch to list sizes correctly

  • Loading branch information...
1 parent 75d7775 commit 789df602c553672f771d325d791d99df458ba7ae BuzzTroll committed with labisso Sep 11, 2010
@@ -20,18 +20,16 @@
import edu.emory.mathcs.backport.java.util.concurrent.locks.Lock;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.globus.workspace.Lager;
-import org.globus.workspace.LockManager;
-import org.globus.workspace.WorkspaceConstants;
-import org.globus.workspace.WorkspaceUtil;
-import org.globus.workspace.LockAcquisitionFailure;
-import org.globus.workspace.ErrorUtil;
+import org.globus.workspace.*;
import org.globus.workspace.persistence.PersistenceAdapter;
import org.globus.workspace.persistence.DataConvert;
import org.globus.workspace.scheduler.Scheduler;
import org.globus.workspace.service.binding.BindingAdapter;
import org.globus.workspace.service.binding.GlobalPolicies;
+import org.globus.workspace.service.binding.vm.VirtualMachine;
+import org.globus.workspace.service.binding.vm.VirtualMachinePartition;
import org.globus.workspace.service.impls.async.TaskNotImplementedException;
+import org.globus.workspace.xen.XenUtil;
import org.nimbustools.api.services.rm.ManageException;
import org.nimbustools.api.services.rm.StateChangeCallback;
import org.nimbustools.api.repr.vm.State;
@@ -195,6 +193,39 @@ private void setState(int newstate, Throwable t, boolean evaluate)
}
}
+ private void updateCumulus()
+ {
+ VirtualMachine vm = this.getVM();
+
+ try
+ {
+ RepoFileSystemAdaptor nsTrans = XenUtil.getNsTrans();
+
+ VirtualMachinePartition[] parts = vm.getPartitions();
+
+ for(int i = 0; i < parts.length; i++) {
+ if (parts[i].isRootdisk()) {
+ String img = parts[i].getImage();
+ if(parts[i].getAlternateUnpropTarget() != null)
+ {
+ img = parts[i].getAlternateUnpropTarget();
+ }
+
+ if(nsTrans != null) {
+ nsTrans.unpropagationFinished(img);
+ }
+ break;
+ }
+ }
+ }
+ catch(WorkspaceException wex)
+ {
+ logger.fatal("\nUnable to update the cumulus database about details on the unpropagated file. The information in cumulus will be wrong!\n"
+ + wex.getMessage() + "\n" + wex.toString());
+ }
+ }
+
+
private void setStateImpl(int newstate,
Throwable t,
boolean evaluate) {
@@ -230,6 +261,11 @@ private void setStateImpl(int newstate,
this.setOpsEnabled(false);
}
+ if (newstate == STATE_READY_FOR_TRANSPORT)
+ {
+ updateCumulus();
+ }
+
// Some notifications of completed tasks are ignored if we are in
// the process of destroying. When the resource's target state is
// set to destroying, a series of cancellation actions may be
@@ -48,32 +48,7 @@ protected Exception postExecute(Exception e, boolean fake) {
e = super.postExecute(e, fake);
if(e != null) {
return e;
- }
-
- try {
- VirtualMachine vm = this.ctx.getVm();
-
- RepoFileSystemAdaptor nsTrans = XenUtil.getNsTrans();
-
- VirtualMachinePartition[] parts = vm.getPartitions();
-
- for(int i = 0; i < parts.length; i++) {
- if (parts[i].isRootdisk()) {
- String img = parts[i].getImage();
- if(parts[i].getAlternateUnpropTarget() != null)
- {
- img = parts[i].getAlternateUnpropTarget();
- }
-
- if(nsTrans != null) {
- nsTrans.unpropagationFinished(img);
- }
- break;
- }
- }
- } catch(Exception ex) {
- return ex;
- }
+ }
return null;
}
}

0 comments on commit 789df60

Please sign in to comment.