diff --git a/include/VirtualMachine.h b/include/VirtualMachine.h index 928ef6a09b..d13057f8e8 100644 --- a/include/VirtualMachine.h +++ b/include/VirtualMachine.h @@ -476,6 +476,16 @@ public: return history->rsystem_dir; } + /** + * Returns the remote VM directory for the previous host. + * The hasPreviousHistory() function MUST be called before this one. + * @return the remote system directory for the VM + */ + const string & get_previous_remote_system_dir() const + { + return previous_history->rsystem_dir; + }; + /** * Returns the local VM directory. The VM local dir is in the form: * $SYSTEM_DS_BASE_PATH/$VM_ID. Temporary stores VM disks. @@ -688,6 +698,16 @@ public: return history->checkpoint_file; }; + /** + * Returns the checkpoint filename for the previous host. + * The hasPreviousHistory() function MUST be called before this one. + * @return the checkpoint filename + */ + const string & get_previous_checkpoint_file() const + { + return previous_history->checkpoint_file; + }; + /** * Returns the hostname for the current host. The hasHistory() * function MUST be called before this one. diff --git a/src/tm/TransferManager.cc b/src/tm/TransferManager.cc index 4140c33c4d..f9e6d0cfb8 100644 --- a/src/tm/TransferManager.cc +++ b/src/tm/TransferManager.cc @@ -903,7 +903,7 @@ void TransferManager::prolog_migr_action(int vid) xfr << "MV " << tm_mad << " " << vm->get_previous_hostname() << ":" - << vm->get_remote_system_dir() << "/disk." << disk_id << " " + << vm->get_previous_remote_system_dir() << "/disk." << disk_id << " " << vm->get_hostname() << ":" << vm->get_remote_system_dir() << "/disk." << disk_id << " " << vm->get_oid() << " " @@ -914,7 +914,7 @@ void TransferManager::prolog_migr_action(int vid) xfr << "MV " << vm_tm_mad << " " << vm->get_previous_hostname() << ":" - << vm->get_remote_system_dir() << " " + << vm->get_previous_remote_system_dir() << " " << vm->get_hostname() << ":" << vm->get_remote_system_dir() << " " << vm->get_oid() << " " @@ -1581,7 +1581,7 @@ int TransferManager::epilog_delete_commands(VirtualMachine *vm, } host = vm->get_previous_hostname(); - system_dir = vm->get_remote_system_dir(); + system_dir = vm->get_previous_remote_system_dir(); vm_tm_mad = vm->get_previous_tm_mad(); vm_ds_id = vm->get_previous_ds_id(); diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index e3a6e73c9e..bab8828bcf 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -532,7 +532,7 @@ void VirtualMachineManager::save_action( VirtualMachine * vm; const VirtualMachineManagerDriver * vmd; - string hostname, vnm_mad; + string hostname, vnm_mad, checkpoint_file; string vm_tmpl; string * drv_msg; ostringstream os; @@ -566,13 +566,15 @@ void VirtualMachineManager::save_action( goto error_previous_history; } - hostname = vm->get_previous_hostname(); - vnm_mad = vm->get_previous_vnm_mad(); + hostname = vm->get_previous_hostname(); + vnm_mad = vm->get_previous_vnm_mad(); + checkpoint_file = vm->get_previous_checkpoint_file(); } else { - hostname = vm->get_hostname(); - vnm_mad = vm->get_vnm_mad(); + hostname = vm->get_hostname(); + vnm_mad = vm->get_vnm_mad(); + checkpoint_file = vm->get_checkpoint_file(); } // Invoke driver method @@ -584,7 +586,7 @@ void VirtualMachineManager::save_action( vm->get_deploy_id(), "", "", - vm->get_checkpoint_file(), + checkpoint_file, "", "", "",