From 84f912866bcba863f601be8c562b4ea16e7f506e Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 17 Nov 2011 12:13:51 +0100 Subject: [PATCH] decode vmm_exec parameters --- src/vmm_mad/exec/one_vmm_exec.rb | 44 ++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index fff1872265..7b5e0c0e4d 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -49,8 +49,11 @@ class ExecDriver < VirtualMachineDriver end # DEPLOY action, sends the deployment file to remote host - def deploy(id, host, remote_dfile, not_used) - local_dfile = get_local_deployment_file(remote_dfile) + def deploy(id, drv_message) + data = decode(drv_message) + + local_dfile = data['LOCAL_DEPLOYMENT_DATA'] + host= data['HOST'] if !local_dfile || File.zero?(local_dfile) send_message(ACTION[:deploy],RESULT[:failure],id, @@ -74,27 +77,52 @@ class ExecDriver < VirtualMachineDriver # Basic Domain Management Operations - def shutdown(id, host, deploy_id, not_used) + def shutdown(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + do_action("#{deploy_id} #{host}", id, host, :shutdown) end - def cancel(id, host, deploy_id, not_used) + def cancel(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + do_action("#{deploy_id} #{host}", id, host, :cancel) end - def save(id, host, deploy_id, file) + def save(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + file = data['CHECKPOINT_FILE'] + do_action("#{deploy_id} #{file} #{host}", id, host, :save) end - def restore(id, host, deploy_id, file) + def restore(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + file = data['CHECKPOINT_FILE'] + do_action("#{file} #{host}", id, host, :restore) end - def migrate(id, host, deploy_id, dest_host) + def migrate(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + do_action("#{deploy_id} #{dest_host} #{host}", id, host, :migrate) end - def poll(id, host, deploy_id, not_used) + def poll(id, drv_message) + data = decode(drv_message) + host = data['HOST'] + deploy_id = data['DEPLOY_ID'] + do_action("#{deploy_id} #{host}", id, host, :poll) end end